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

API functions simpleRFC

Method

Comments

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 block 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 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()

Determine the 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/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 as a double

String simpleRfcGetParameterValue()

Determine the value of the current parameter as a string

Other functions

void simpleRfcErrorReset()

Reset error messages

String simpleRfcErrorGet()

Determine last error message as a string

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

Calls a special RFC module that accepts the value of "p_parameter" in the "INPUT" parameter. Any existing parameter "RESULT" is returned in the result

API functions for SAP SSO scenarios

Method

Comments

Functions for SAP connections

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

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

boolean SAPConnectionSystemClose(String p_instance)

Close a connection to the "p_instance" SAP system

boolean SAPConnectionUserClose(String p_instance)

Close a connection to the SAP system ""p_instance"" of the user

boolean SAPConnectionSystemConnect(String p_instance)

Establish a connection to the "p_instance" SAP system

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

Establish a user connection to the SAP system "p_instance" with user/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 parameter "p_token". Depending on the type of token, the parameter "p_method" must 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 "p_request parameterr expects the Velocity-$Request object to be transferred. 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 function in Velocity integrates an SAP web interface as an iFrame. The call requires the "ssoPrepare" function on the same page in order to execute the necessary JavaScript functions (e.g. set SAP ticket, initialize URL mapping). 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)

JavaScript functions for SAP SSO scenarios

Method

Comments

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 specified login mode (usually "user"). Additional parameters (e.g. fields to be filled) are included in "p_extra". The start screen can be skipped with "p_skip = "true"". The "p_url" flag controls whether an evaluation of the portal URL is necessary (e.g. different SAP router strings). To do this, however, the page must have been initialized with "ssoPrepare" in Velocity.

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

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

Determine 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 it is not possible to determine a valid SSO token and an error message is available via "p_message", this error message is displayed. The parameter "p_cancel_on_error" controls whether an erroneous ticket should cancel the processing of the script and also the subsequent scripts (e.g. for buttons) (effect: no display of the SAP web interface if the ticket is incorrect).

function biasap_call_sapurl(p_button, p_url)

Calls 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 to the SAP site may already have been defined as an external link destination. A filled parameter "p_url" would overwrite this jump target. Placeholders (e.g. "<sapserver>") can be used in the URL, which can be resolved using a previous "ssoPrepare()".

API functions for the SAP OCI interface

Method

Comments

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. The default setting is "PlainAuth", which must be configured in the portal. 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 it has the value "true", the login was successful. With the value "false", the logon was either 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 adjust jump targets in the application, for example, if the application is not only 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 out and used as a default value for input 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 connected SAP system, enter "sapoci" here.

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

Method

Comments

sapoci_set_returnurl(p_button)

Sets the return address after sending. A button is expected to be transferred. A button is expected to be transferred.

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

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

sapoci_addItemField(row, name, value)

Generates more data for a basket item. The technical name of the OCI specification is expected in "name" (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. Catching errors with try...catch is possible

Available resources for the Connector for SAP Business Suite

Category

Technical name

Use

Velocity script*

biasap_shortcut.vm

To initialize the SAPGUI from the portal

JavaScript**

sap_utils

Diverse JavaScripts with utility functions

sapsso

Diverse JavaScript functions for SSO with SAP

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

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.

Attributes

Data type

Level*

Use

bia-timezone

String

DQ, 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 SAP access (<system>|<user>|<mixed>)

bia-handler

String

DG

Handler for 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 debugging. SAP debugging is only possible if the portal is running on your own computer and a SAP GUI is installed.

bia-forcefilter

Boolean

DG

This parameter (active = "true") can be used to control that no data is determined for table accesses if no filter is active. 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 advance (use of new features).

bia-simplekey

Boolean

DG

bia-simplekeyBooleanDG 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 activated, the data is cached on the server. If the data in the SAP system changes, only the old data is 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" would not normally be called for new data records. 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 data records are generally given the ID -1 by Intrexx. With this option, this default key is deleted. In SAP, it could be queried 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 used, for example, in the "Generic Report" data handler 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 "Generic Report" data handler. 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 used at data group level, the key is automatically treated as a numerical SAP ID.

bia-timefield

String

DF

This option tries to solve the problem that time stamps usually are not used in SAP but separate fields for date and time instead. Intrexx, on the other hand, uses timestamps and can also display them 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. This option provides a simple possibility: the "Generic View" data handler attempts to determine 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 thus be mapped from "sapsystem.internesicht.net" to "archiv.externesicht.com" as soon as the user uses the external 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

Important SAP transactions

The following table contains an overview of the most important transactions in connection 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 of table contents

SE11

Dictionary: Display technical information on dictionary objects (e.g. tables, views)

SAP configuration

SPRO

Implementation guide: 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: troubleshooting after aborts

SM21

System log: Troubleshooting for system problems

SLG1

Application log: Logs for many applications

SMQ1, SMQ2, SM58

Data exchange with external systems with qRFC and tRFC

Users and permissions

SU01

User maintenance

SU21

Maintenance of authorization objects: generate with function "SAP_ALL", among others

PFCG

Roles and permissions

ST01

Permissions trace

SM04

Users online

SMGW

Logged-in remote systems

Development

SE80

ABAP Workbench: Central Development Transaction

SE38, SA38

ABAP reports: Development and start

SE37

Function modules/BAPI: Developing, testing

BAPI

BAPI browser

SWO1

SAP BusinessObjects

More information

General

Installation

Create connection

Integration in 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 - Implementation of own processing modules

API description part 4 - sample coding

Developer manual part 1

Developer's Guide Part 2 - Integration scenario SAP external data group

Developer's Guide Part 3 - Scripting integration scenario

Developer Manual Part 4 - Personalized SAP Access / Single Sign On (SSO)

Developer's Guide Part 5 - Addons

Developer manual - Sample coding