Connector for SAP Business Suite - Developer's Guide: Appendix

SimpleRfc API Functions

Method

Note

Functions for SAP Connections

boolean simpleRfcConnect(String p_instance, String p_loginmode)

Establish a connection to the SAP system

boolean simpleRfcClose()

Disconnect from 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)

Exit BAPI/RFC Function

Functions for Accessing Function Module Parameters

boolean simpleRfcSetFocusImportParameter(String p_parameter)

Focus on Import Parameters

boolean simpleRfcSetFocusImportStructure(String p_structure)

Focus on the import structure

boolean simpleRfcSetFocusImportTable(String p_table)

Focus on the Import Table

boolean simpleRfcSetFocusExportParameter(String p_parameter)

Focus on Export Parameters

boolean simpleRfcSetFocusExportStructure(String p_structure)

Focus on the Export Structure

boolean simpleRfcSetFocusExportTable(String p_table)

Focus on the Export Table

boolean simpleRfcSetFocusTable(String p_table)

Bring a table from the table parameters into focus

Functions for Accessing Tables and Structures

boolean simpleRfcSetFocusStructureField(String p_fieldname)

Bring a field from the current structure into focus

boolean simpleRfcSetFocusTableField(String p_fieldname)

Bring a field from the current table (row) into focus

int simpleRfcTableGetCount()

Determine the number of rows in the current table

Vector simpleRfcTableGetEntries()

All rows of the current table as a set

boolean simpleRfcTableSetLine(Integer p_index)

Highlight a row in the current table

boolean simpleRfcTableAddLine()

Add a new row to the current table

Access to Parameters/Individual 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 to a Double

String simpleRfcGetParameterValue()

Determine the value of the current parameter as a string

Other Features

void simpleRfcErrorReset()

Reset Error Messages

String simpleRfcErrorGet()

Get the last error message as a string

String simpleRfcTrigger(String p_instance, String p_loginmode, String p_function, String p_parameter)

Calling a specific RFC module that receives the value of "p_parameter" in the "INPUT" parameter. Any "RESULT" parameter that may be present is returned in the result

API Functions for SAP SSO Scenarios

Method

Note

Functions for SAP Connections

boolean SAPConnectionCheck(String p_instance, String p_loginmode, boolean p_connect)

Check for an existing connection to the SAP system "p_instance" in the "p_loginmode" login mode. If "p_connect = true" and a connection has not yet been established, a connection is established.

boolean SAPConnectionSystemClose(String p_instance)

Establish a connection to the SAP system "p_instance"

boolean SAPConnectionUserClose(String p_instance)

Establish an SAP connection to the user's SAP system p_instance

boolean SAPConnectionSystemConnect(String p_instance)

Establish a connection to the SAP system "p_instance"

boolean SAPConnectWithUserPassword(String p_instance, String p_user, String p_password)

Establish a user connection to the SAP system "p_instance" using a username and password

Personalization Features

void SAPUserLoginSetToken(String p_instance, String p_user, String p_token, String p_method)

Manually set the token-based credentials for an SAP system. The token (e.g., SSO ticket) contains the "p_token" parameter. Depending on the type of token, the "p_method" parameter must be set (e.g., "MYSAPSSO2" for an SSO ticket)

void SAPUserLoginSetUserPassword(String p_instance, String p_user, String p_password)

Manually set the username and password for a user in the current session

boolean SAPUserLoginDelete(String p_instance)

Reset a user's login credentials (e.g., SSO ticket information, for switching users)

String ssoPrepare(String p_instance, String p_loginmode, ServerBridgeRequest p_request, boolean p_mapurl)

Integrating this feature into Velocity allows you to use SAP interfaces on the page where it is used. SSO initializations are performed, and SSO JavaScript functions, for example, are made available. The "p_request parameterr expects the Velocity $Request object to be passed to it. The "p_mapurl" flag controls the mapping of SAP URLs.

public String ssoIncludeURL(String p_url, String p_width, String p_height, boolean p_mapurl)

Using this feature in Velocity embeds an SAP web interface as an iFrame. This call requires the "ssoPrepare" function to be called on the same page in order to perform the necessary JavaScript functions (e.g., setting the SAP ticket, initializing URL mapping). URL mapping is enabled via the "p_mapurl" flag.

public String ssoIXLoginUserPasswordSession(Session p_session, String p_user, String p_password, String p_domain, String p_method)

This feature allows you to log in to the Intrexx portal via an Intrexx page (anonymously). If the login is successful, a session ID is returned.

public void ssoMapUrlDeleteCache()

Clears the cache for URL mappings (required for administrative changes).

JavaScript Functions for SAP SSO Scenarios

Method

Note

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 filled in) are specified in "p_extra". Setting "p_skip = 'true'" allows you to skip the startup screen. The "p_url" flag controls whether the portal URL needs to be evaluated (e.g., different SAP router strings). However, for this to work, the page must have been initialized with "ssoPrepare" in Velocity.

function biasap_start_transaction(p_instance, p_loginmode, p_transaction, p_extra, p_skip)

How to use the "biasap_start_transaction_url" function without URL evaluation

function biasap_start_report_url(p_instance, p_loginmode, p_report, p_variant, p_url)

Runs a report in the specified SAP system, with or without a variant. The "p_url" flag controls the customization of the path to the SAP system via the portal URL.

function biasap_start_report(p_instance, p_loginmode, p_report, p_variant)

Like "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 )

Identify 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 a valid SSO token cannot be obtained and an error message is available via "p_message," this error message is displayed. The "p_cancel_on_error" parameter controls whether an invalid ticket should terminate the processing of the script and any subsequent scripts (e.g., for buttons) (Result: the SAP Web Interface is not displayed if the ticket is invalid).

function biasap_call_sapurl(p_button, p_url)

Opens an SAP Web interface from its button and can be used in button events (e.g., onclick). "p_button" contains a reference to the button. The URL for the SAP page may already have been maintained as an external link. A value assigned to the "p_url" parameter would override this link destination. Placeholders (e.g., "<sapserver>") can be used in the URL; these can be resolved using a prior "ssoPrepare()" call.

API Functions for the SAP OCI Interface

Method

Note

boolean ociInit(Session p_session, ServerBridgeRequest p_request, String p_loginmethod)

The method initializes the SAP-OCI functions of the connector for SAP Business Suite. This method is intended for integration into a view page (Velocity). The current session and the request are passed. The third parameter specifies the authorization method to be used. The default setting is "PlainAuth," which must be configured in the portal. The portal logs in using the parameters provided and checks the received parameters for validity with SAP-OCI. The result is a Boolean. If the value is "true," the login was successful. If the value is "false," either the login was incorrect or the parameters passed are not valid for SAP-OCI.

boolean ociCheck()

This function checks whether a valid SAP OCI session is active. Use this function to customize jump targets in the application, for example, if the application is used for scenarios other than SAP OCI.

String ociStatus()

This function returns HTML text containing the current OCI information. This function can be used to quickly display technical OCI information.

String ociGetInfo(String p_info)

This function can be used to determine a specific value from the OCI data. For example, you can use "$!GSAP.ociGetInfo("vendor")" to retrieve the vendor number and use it as a default value for input fields. Possible values for "p_info" are:

  • sapuser

    Technical name of the logged-in SAP user

  • login

    Portal username

  • domain

    Login domain on the portal

  • customer

    The purchaser's customer number with the supplier

  • vendor

    Supplier number on the buyer's side

  • oci_version

    OCI Version

  • opi_version

    OPI Version

String ociCheckout(String p_instance)

This function is required for the final page, where the shopping cart is compiled and must be sent to the SAP system. This automatically makes certain functions available for the SAP-OCI interface (e.g., JavaScript, initializations). A configured SAP data source is expected as a parameter here. In systems that are not connected to an SAP system, enter "sapoci" here.

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

Method

Note

sapoci_set_returnurl(p_button)

Sets the redirect URL after sending. A button is expected to be passed.

sapoci_addItemMain(row, quantity, unit, articleid, description)

Generates the most important transfer data for a shopping cart item (the "row")

sapoci_addItemField(row, name, value)

Generates additional data for a shopping cart item. "name" should contain the technical name of the OCI specification (e.g., "VENDORMAT")

sapoci_addLongText(row, value)

Generates a long text for the item

sapoci_addFormField(name, value)

Creates an other transfer field by specifying the technical name

sapoci_send()

Send the data packet to the caller. It is possible to catch errors using try...catch

Available Resources for the SAP Business Suite Connector

Category

Technical Name

Uses

Velocity Script*

biasap_shortcut.vm

To launch SAPGUI from the portal

JavaScript**

sap_utils

Various JavaScript files with utility functions

sapsso

Various JavaScript functions for SSO with SAP

* is automatically installed in the portal directory using the SAP Adapter API method "install(boolean p_check, boolean p_full_log)"
** can be included using the SAP API method "getJavascriptInclude(String)".

Expert Attributes for SAP External Data Groups

Some of the following expert attributes are set automatically when you select the data handler and can be adjusted afterward. Some parameters are optional and result in specific behaviors.

Attributes

Data Type

Level*

Uses

bia-timezone

String

DQ, DG

Adjusting the time zone for timestamp fields. SAP systems often run in the CET time zone, while Intrexx runs on the server in UTC. This causes discrepancies in the display of times. However, the time zone should be set in the data source configuration (attribute in the sap.cfg file).

bia-loginuser

String

DG

Login mode for SAP access (<system>|<user>|<mixed>)

bia-handler

String

DG

Handlers for SAP access (e.g., "GENERIC_VIEW," "DEVELOPER_API")

bia-variant

String

DG

Variant of the SAP handler (e.g., "DEFAULT"). Can be used to define a different SAP data handler

bia-param1...bia-param5

String

DG

Ability to pass control parameters to the SAP handler. The values are available in the SAP Data Handler within the CONTROL structure.

bia-abapdebug

String

DG

Option to enable debugging only for the specific external data group. "True" enables debugging. SAP debugging is only possible if the portal is running on your own computer and SAPGUI is installed.

bia-forcefilter

Boolean

DG

This parameter (active = "true") can be used to control table access so that no data is retrieved if no filter is active. This prevents access to the SAP system when tables are hidden in connection with dynamic filters.

bia-trace

Boolean

DG

Enables tracing for this data group. As a result, the log file contains more detailed entries.

bia-requiredbl

Boolean

DG

Includes information about which version of the business logic is required in order to prevent errors in advance (use of new features).

bia-simplekey

Boolean

DG

For SAP data groups with complex keys (e.g., VBAP), a simple sequence from 1 to n is used as the key for the sake of simplicity. It is not possible to jump to a detail page this way. However, this option can make it easier to access cells within custom-designed view tables.

bia-usecache

Boolean

DG

If this option is enabled, the data is cached on the server. Even if the data in the SAP system changes, only the old data is displayed in the portal. This option is particularly suitable for Customizing tables that are used as references (performance). The server-side cache can be reset by disconnecting from SAP.

bia-newrec_getdetail

Boolean

DG

This option is only relevant in the data handlers of the Developer API. For new records, the SAP API method "Get_Detail" would not normally be called. However, this can be enforced using this option to pre-populate values from SAP.

bia-newrec_delrecid

Boolean

DG

This option is also only relevant within the Developer API. New records are generally assigned the ID -1 by Intrexx. This option deletes this predefined key. In SAP, this could be queried using "if iv_key eq space."

bia-nolangtab

Boolean

DG

This option, as an alternative to the corresponding bia-variant, prevents SAP from automatically determining the text table. This makes it possible to display complex cases such as the MARA table in the portal with a reasonable amount of effort.

bia-htmloutput

Boolean

DG

When this option is enabled, certain data is passed as HTML code instead of plain text. This option is used, for example, in the "Generic Report" data handler to render an SAP report in the standard SAP colors.

bia-singleline

Boolean

DG

This option enables longer texts to be displayed as a single block of text rather than across multiple lines. This option is used in the "Generic Report" data handler. The report will then no longer be transferred line by line and must be displayed as a freely formatted table. When this option is selected, a string field contains the entire report.

bia-numkeylen

Integer

DG, DF

This option enables automatic mapping for numeric keys typical of SAP. Based on the specified length, the logic of the connector for SAP Business Suite knows that leading zeros must be automatically added to this field during transfer to SAP (with the exception of alphanumeric keys). When displayed in the portal, these fields are shown without leading zeros. If this option is used at the data group level, the key is automatically treated as a numeric SAP ID.

bia-timefield

String

DF

This option attempts to resolve the issue that SAP typically uses separate fields for date and time rather than timestamps. Intrexx, on the other hand, uses timestamps and can also display them as "date only" or "time only." This option tells the SAP system's data field which SAP field contains the corresponding time. This turns the SAP date field into a timestamp, and it can be used as such (e.g., in calendar controls). When displaying times, time shifts often occur (e.g., 2h). This is because the SAP server and the portal run in different time zones (CET vs. UTC). Therefore, the SAP time zone can be configured at the data source or via bia-timezone. This behavior should also work in reverse (writing timestamps to two separate SAP fields). The SAP date field is the leading field here again. However, the corresponding time field may need to be available (hidden) on the pages.

bia-mapcodefield

Boolean

DF

In SAP systems, codes are often used (typically 1- to 6-character fields; e.g., VBAK-VBTYP). These are transferred as text—that is, as SAP code—and are therefore unusable by users in this form. Of course, it is possible to link the relevant Customizing tables as references based on the language. However, this can sometimes involve a lot of effort. This option provides a simple solution: the "Generic View" data handler attempts to identify suitable texts based on the configured search help or other SAP mechanisms. This method is not possible in all cases (e.g., more complex search filters with multiple search criteria).

bia-mapurl

Boolean

DF

This option allows you to map URLs based on the portal URL. This is required, for example, to hide the actual URL on SAP systems (when accessing archived documents). Internal access can thus be mapped from "sapsystem.internesicht.net" to "archiv.externesicht.com" as soon as the user accesses the Intrexx portal via the external interface.

bia-maptouppercase

Boolean

DF

Converts the value to uppercase. Useful in SAP matchcode fields.

bia-map-lowercase

Boolean

DF

Converts the value to lowercase.

* DQ – Data Source, DG – Data Group, DF – Data Field

Important SAP Transactions

The following table provides an overview of the most important transactions related to the Intrexx portal. These transactions may not be available to everyone (due to a lack of permissions).

Category

Transaction Code

Uses

Tables/Views

SE16

Data Browser: Viewing Table Contents

SE11

Dictionary: Displaying technical information about Dictionary objects (e.g., tables, views)

SAP Configuration

SPRO

Implementation Guide: Central SAP Customizing

SM30

Maintenance of Configuration Tables

SM59

Maintaining RFC Destinations: Configuring Access to External Systems

SICF

Internet Connectivity: Enabled Services

Troubleshooting

ST22

Dump Analysis: Troubleshooting Crashes

SM21

System Log: Troubleshooting System Problems

SLG1

Application Log: Logs for Many Applications

SMQ1, SMQ2, SM58

Data Exchange with External Systems Using qRFC and tRFC

Users and Permissions

SU01

User Management

SU21

Maintaining authorization objects: including generating them using the "SAP_ALL" function

PFCG

Roles and Permissions

ST01

Authorization Trace

SM04

Logged-in Users

SMGW

Registered Remote Systems

Development

SE80

ABAP Workbench: Central Development Transaction

SE38, SA38

ABAP Reports: Development and Execution

SE37

Function Modules/BAPIs: Development, Testing

BAPI

BAPI Browser

SWO1

SAP Business Objects

More Information

General Information

Installation

Create a connection

Integration into Applications

SAP Script Generator

SAP Trust Manager SSO Configuration

API Description, Part 1 - Overview

API Description, Part 2 - SAP Portal Plugin

API Description, Part 3 - Implementing Custom Processing Modules

API Description, Part 4 - Sample Code

Developer's Guide, Part 1

Developer's Guide, Part 2 - Integration Scenario: SAP External Data Group

Developer's Guide, Part 3 - Integration Scenario: Scripting

Developer's Guide, Part 4 - Personalized SAP Access / Single Sign-On (SSO)

Developer's Guide, Part 5 - Add-ons

Developer's Guide - Sample Code