Connector for SAP Business Suite - Developer's Manual - Appendix

1. API functions simpleRFC

Method Comment
Functions for SAP connections
boolean simpleRfcConnect(String p_instance, String p_loginmode) Establish connection to the SAP system
boolean simpleRfcClose() Close connection to the SAP system
Functions for BAPI/RFC functions
boolean simpleRfcFunctionLoad(String p_function) Load BAPI/RFC function
boolean simpleRfcFunctionExecute(boolean p_commit) Execute BAPI/RFC function
boolean simpleRfcFunctionClose(boolean p_commit) End BAPI/RFC function
Functions for accessing function module parameters
boolean simpleRfcSetFocusImportParameter(String p_parameter) Focus on import parameter
boolean simpleRfcSetFocusImportStructure(String p_structure) Focus on import structure
boolean simpleRfcSetFocusImportTable(String p_table) Focus on import table
boolean simpleRfcSetFocusExportParameter(String p_parameter) Focus on export parameter
boolean simpleRfcSetFocusExportStructure(String p_structure) Focus on export structure
boolean simpleRfcSetFocusExportTable(String p_table) Focus on export table
boolean simpleRfcSetFocusTable(String p_table) Focus on table from table parameter
Functions for accessing tables and structures
boolean simpleRfcSetFocusStructureField(String p_fieldname) Focus on field from the current structure
boolean simpleRfcSetFocusTableField(String p_fieldname) Focus on field from the current table (rows)
int simpleRfcTableGetCount() Get number of table rows in the current table
Vector simpleRfcTableGetEntries() All table rows in the current table as a quantity
boolean simpleRfcTableSetLine(Integer p_index) Focus on a row in the current table
boolean simpleRfcTableAddLine() Add a row to the current table
Access to parameters/single values
boolean simpleRfcSetParameterValue(String p_value) Set the value of the current parameter/field as a string
boolean simpleRfcSetParameterValue(double p_value) Set the value of the current parameter/field as a double
String simpleRfcGetParameterValue() Get the value of the current parameter as a string
Misc. functions
void simpleRfcErrorReset() Reset error messages
String simpleRfcErrorGet() Get last error message as a string
String simpleRfcTrigger(String p_instance, String p_loginmode, String p_function, String p_parameter) Call a special RFC module that receives the value of "p_parameter" in the parameter "INPUT". If a parameter "RESULT" is found, a result will be returned.

2. API functions for SAP SSO scenarios

Functions for SAP connections
boolean SAPConnectionCheck(String p_instance, String p_loginmode, boolean p_connect) Checks an existing connection to the SAP system "p_instance" in the login mode "p_loginmode". If "p_connect = true" you aren't connected yet, a connection will be established.
boolean SAPConnectionSystemClose(String p_instance) Close a connection to the SAP system "p_instance"
boolean SAPConnectionUserClose(String p_instance) Close a connection to the SAP system "p_instance" of the user
boolean SAPConnectionSystemConnect(String p_instance) Create a connection to the SAP system "p_instance"
boolean SAPConnectWithUserPassword(String p_instance, String p_user,String p_password) Create a user connection to the SAP system "p_instance" with username and password
Functions for personalization functions
void SAPUserLoginSetToken(String p_instance, String p_user, String p_token, String p_method) Set the login information via a token for an SAP system manually. The token (e.g. SSO ticket) contains the parameter "p_token". Depending on the token type, the parameter "p_method" also needs to be set (e.g. "MYSAPSSO2" for SSO ticket)
void SAPUserLoginSetUserPassword(String p_instance, String p_user, String p_password) Set the login information username/password or a user from the current sessions manually
boolean SAPUserLoginDelete(String p_instance) Reset the login information for a user (e.g. SSO ticket information, for user switch)
String ssoPrepare(String p_instance, String p_loginmode, ServerBridgeRequest p_request, boolean p_mapurl) Integrating this function in Velocity enables you to use the SAP interface of the utilizing page. SSO initializations are performed and SSO JavaScript functions are made available, for example. The parameter "p_request" expects the transfer of the Velocity $Request object. The mapping of SAP URLS is controlled using the flag "p_mapurl"
public String ssoIncludeURL(String p_url, String p_width, String p_height, boolean p_mapurl) Using this function in Velocity integrates an SAP web interface as an iFrame. The call requires the function "ssoPrepare" on the same page to be able to use the necessary JavaScript functions (e.g. set SAP ticket, initialize URL mapping). The URL mapping is activated via the active flag "p_mapurl".
public String ssoIXLoginUserPasswordSession(Session p_session, String p_user, String p_password, String p_domain, String p_method) This function enables you to log in to the Intrexx portal via an Intrexx page (anonymously). Once the login is successful, a session ID will be returned.
public void ssoMapUrlDeleteCache() Deletes the cache of URL mappings (requires administrative changes)

3. JavaScript functions for SAP SSO scenarios

Method Comment
function biasap_start_transaction_url(p_instance, p_loginmode, p_transaction, p_extra, p_skip, p_url) Starts the SAPGUI for the specified SAP data source as a transaction in the given login mode (usually "user"). Additional parameters (e.g. fields to be populated) are defined in "p_extra". The start screen can be skipped with "p_skip = "true"". The flag "p_url" controls whether the portal URL needs to be evaluated (e.g. different SAP router strings). To do this, the page needs to have been initiated with "ssoPrepare" in Velocity.
function biasap_start_transaction(p_instance, p_loginmode, p_transaction, p_extra, p_skip) Like the function "biasap_start_transaction_url" but without URL evaluation
function biasap_start_report_url(p_instance, p_loginmode, p_report, p_variant, p_url) Starts a report in the specified SAP system with or without variants. The flag "p_url" controls the adjusting of the path to the SAP system via the portal URL.
function biasap_start_report(p_instance, p_loginmode, p_report, p_variant) Like the function "biasap_start_report_url" but without URL evaluation
function biasap_set_cookie( name, value, expires, path, domain, secure ) Set a cookie (e.g. for SSO)
function biasap_get_cookie( name ) Get a cookie
function biasap_delete_cookie( name, path, domain ) Delete a cookie
function biasap_set_ticket(p_message, p_cancel_on_error) Set the SSO ticket for SAP web interfaces. If identifying a valid SSO token is not possible and an error message is available via "p_message", this error message will be displayed. The parameter "p_cancel_on_error" controls whether a defective ticket should cancel the processing of the script and also subsequent scripts (e.g. for buttons). This means the SAP web interface will not be displayed of the ticket is erroneous.
function biasap_call_sapurl(p_button, p_url) Calls from button an SAP web interface and can be used in button events (e.g. onclick). "p_button" contains a reference to the button. The URL to the SAP site may already have been defined as an external link destination. "p_url" would overwrite this destination. Placeholders (e.g. "<sapserver>"), which were triggered by a previous "ssoPrepare()" can be used in the URL.

4. API functions for the SAP OCI interface

Method Comment
boolean ociInit(Session p_session, ServerBridgeRequest p_request, String p_loginmethod) This method initializes the SAP OCI functions of the Connector for SAP Business Suite. This method is intended for integration on a view page (Velocity). The current session and the request are transferred. The third parameter defines which authentication method should be used. A login to the portal is performed with the transferred parameters and the received parameters are checked for validity for SAP OCI. The result is boolean. If the value is "true", then the login was successful. If the value was "false", then either the login was incorrect or the transferred parameters are not valid for SAP OCI.
boolean ociCheck() This function checks whether a valid SAP OCI session is active. Use this function to, for example, adjust link destinations in the application if the application is not used for SAP OCI scenarios.
String ociStatus() This function returns an HTML text that contains the current OCI information. The function can be used to present technical OCI information quickly.
String ociGetInfo(String p_info) With this function, a specific value can be identified from the OCI data. With "$!GSAP.ociGetInfo("vendor")" for example, the vendor number can be read and used as a suggested value for edit fields. Possible values for "p_info" are:
  • sapuser
    Technical name of the logged-in SAP user
  • login
    Login name for the portal
  • domain
    Login domain for the portal
  • customer
    Customer number of the purchaser at the vendor
  • vendor
    Supplier number at the vendor
  • oci_version
    OCI version
  • opi_version
    OPI version
String ociCheckout(String p_instance) This function is required for the last page where the basket needs to be compiled and sent to the SAP system. Using this, specific functions for the SAP OCI interface are provided automatically ( e.g. JavaScripts, initializations). A configured SAP data source is expected as the parameter. In systems without a linked SAP system, "sapoci" should be entered here.

The API function "ociCheckout()" provides additional JavaScript functions:

Method Comment
sapoci_set_returnurl(p_button) Sets the return address after sending. A button is expected to be transferred.
sapoci_addItemMain(row, quantity, unit, articleid, description) Generates the most important transfer data for a basket item (of the line "row")
sapoci_addItemField(row, name, value) Generates more data for a basket item. In "name", the technical name of the OCI specification is expected (e.g. "VENDORMAT")
sapoci_addLongText(row, value) Generates a longtext at the position
sapoci_addFormField(name, value) Generates a another transfer field stating the technical name
sapoci_send() Send the data packet to the caller. It is possible to intercept errors with try...catch

5. Available resources for the Connector for SAP Business Suite

Category Technical name Use
Velocity script* biasap_shortcut.vmTo initialize the SAPGUI from the portal
JavaScript** sap_utilsDiverse JavaScripts with utility functions
sapsso Diverse JavaScript functions for SSO with SAP

* is automatically intalled in the portal directory via the SAP Connector API method "install(boolean p_check, boolean p_full_log)".
** can be integrated via the SAP API method "getJavascriptInclude(String)".

6. Expert attributes for SAP external data groups

The following expert attributes are to some extent automatically set by selecting the datahandler and can be adjusted later. Some of the parameters are optional and cause specific behaviors.

Attribute Data type Level* Use
bia-timezone String DS, DG Adjust the timezone for time stamp fields. SAP systems often run in the CET timezone, Intrexx in UTC on the server. This causes displacements when times are being displayed. However, it is better to define the timezone in the configuration of the data source (attribute in the file sap.cfg).
bia-loginuser String DG Login mode for the SAP access (<system>|<user>|<mixed>)
bia-handler String DG Handler for the SAP access (e.g. "GENERIC_VIEW", "DEVELOPER_API")
bia-variant String DG Variant of the SAP handler (e.g. "DEFAULT"). Can be used for a divergent identification of the SAP datahandler
bia-param1...bia-param5 String DG Option to transfer controlling parameters to the SAP handler. The values are available in the CONTROL structure in the SAP datahandler.
bia-abapdebug String DG Option to activate the debugging for the pertaining external data group only. "true" activates the debugging. SAP debugging is only possible if the portal is on your own computer and SAPGUI is installed.
bia-forcefilter Boolean DG When accessing tables, you can define that data should only be identified if a filter is not active with this parameter (active = "true"). This prevents hidden tables from being accessed in the SAP system in conjunction with dynamic filters.
bia-trace Boolean DG Activates the trace for this data group. Extended messages for this will be provided in the logfile in doing so.
bia-requiredbl Boolean DG Contains a specification of which version of the Business Logic is required to avoid errors in advanced (use of new features).
bia-simplekey Boolean DG For SAP data groups with complex keys (e.g. VBAP), only a count from 1...n is used as the key for simplification reasons. A link to a details page is not possible here. However, this option can simplify access to cells within a free layout table.
bia-usecache Boolean DG If this option is acitvated, the data will be cached on the server. If the data in the SAP system is changed, the old data will still be displayed in the portal. The option is especially well-suited for customizing tables that are used as references (performance). The server-side cache can be reset by closing the connection to SAP.
bia-newrec_getdetail Boolean DG This option is only relevant in the datahandlers for the Developer API. The SAP API method "Get_Detail" is not usually requested for new datasets. However, this can be forced with this option to preallocate values from SAP.
bia-newrec_delrecid Boolean DG This option is also only relevant within the Developer API. New datasets are generally given the ID -1 by Intrexx. With this option, this default key is deleted. In SAP it would then be requestable with "if iv_key eq space".
bia-nolangtab Boolean DG As an alternative to the corresponding bia-variant, this option activates that the text table is not determined automatically in SAP. This allows problem cases such as the table MARA to be displayed in the portal with reasonable effort.
bia-htmloutput Boolean DG This option activates that specific data is transferred as HTML code instead of normal text. This option is, for example, used in the datahandler "Generic Report" to transfer an SAP report in the SAP-typical colors.
bia-singleline Boolean DG This option activates the transfer of longer texts as longtext instead of multiple lines. This option is used in the datahandler "Generic Report". The report is therefore not transferred in lines and needs to be presented as a free layout table. A string field contains the entire report with this option.
bia-numkeylen Integer DG, DF This option activates an automatic mapping of SAP-typical numberical keys. Via the defined length, the logic of the Connector for SAP Business Suite knows that this field needs to be completed with leading zeroes when transferrring to SAP (alphanumerical keys are an exception). These fields are presented without the leading zeroes in the portal. If this option is implemented at the data group level, the key is automaticall treated as a numerical SAP ID.
bia-timefield String DF This option tries to solve the problem that time stamps usually aren't used in SAP but separate fields for date and time instead. Whereas Intrexx uses time stamps and additionally can present these as "date only" or "time only". Using this option, the data field from the SAP system is informed as to which SAP field contains the corresponding time. The SAP date field becomes the time stamp in doing so and can be used as such (e.g. in calendar controls). When presenting times, the time is often displaced (e.g. 2h). This is because the SAP server and the portal run in different timezones (CET vs UTC). That is way, the SAP timezone can be configured in the data source or via bia-timezone. This function should also work the other way round (writing time stamps to two separate SAP fields). The field for the SAP date is key here as well. The corresponding time field may need to be available on the pages (hidden), however.
bia-mapcodefield Boolean DF Encodings are often used in SAP systems (typical characters 1...6 fields; e.g. VBAK-VBTYP). These are transferred as text - meaning as SAP code - and cannot be used by the user therefore. There is of course the option to connect the corresponding customizing table in a language-dependent manner as a reference. However, this can be very complex in some circumstances. A simple option is available: the datahandler "Generic View" tries to identify suitable texts from the configured search help or other SAP mechanisms. This approach cannot be used everywhere (e.g. in more complex search helps with multiple keys).
bia-mapurl Boolean DF With this option, URLS can be mapped whilst taking the portal URL into account. This is required for hiding the real URL on the SAP systems (calling archived documents), for example. An internal access can be mapped from "" to "" as soon as the user uses the exernal access to the Intrexx portal.
bia-maptouppercase Boolean DF Makes the value upper-case. Useful in SAP matchcode fields.
bia-maptolowercase Boolean DF Makes the value lower-case.

* DS – Data source, DG – Data group, DF - Data field

7. Important SAP transactions

The following table contains an overview of the most important transactions in conjunction with the Intrexx portal. These transactions are not available to all users in some cases (insufficient permissions).

Category Transaction code Use
Tables/Views SE16 Data browser: Display table content
SE11 Dictionary: Display technical information about dictionary objects (e.g. Tables, Views)
SAP configuration SPRO Implementation guideline: Central SAP customizing
SM30 Table maintenance of configuration tables
SM59 Maintain RFC destinations: Configure access to external systems
SICF Internet connectivity: Released services
Debugging ST22 Dump analysis: Debugging after cancellations
SM21 System log: Debugging for system problems
SLG1 Application log: Protocols for many applications
SMQ1, SMQ2, SM58 Data exchange with external systems with qRFC and tRFC
Users and permissions SU01User maintenance
SU21 Maintenance of permission objects: Generate with the function "SAP_ALL" among others
PFCG Roles and permissions
ST01 Permissions trace
SM04 Logged-in users
SMGW Logged-in remote systems
Development SE80 ABAP workbench: Central development transaction
SE38, SA38 ABAP reports: Development and initiation
SE37 Function modules/BAPI: Develop, test
BAPI BAPI browser
SWO1 SAP BusinessObjects

8. More information

API Developer's Manual