RFC and BAPI function interfaces

ECC RFC function interfaces vary. The HCL Domino Connector for SAP® Solutions allows you to call any RFC or BAPI that is Remote Function Call enabled in your ECC system.

Note: All parameter and function calls in SAP must be in upper case.

An RFC/BAPI is comprised of IMPORTS, EXPORTS, TABLES and EXCEPTIONS.

Imports

These elements hold data that is imported to the function. In most cases, Imports contain selection criteria specified in an HEI or DECS activity. Imports are filled in through the Select Statement within the HEI Direct Transfer activity when ECC is a source. When ECC is a target, the SAP import metadata can be mapped to the fields of the data source using the Field Mapping functionality of the activity documents if you enter ‘*’ for the table name (Metadata). When you do this, the tables will be named IMPORTS + <the name of the parameter or structure>. This gives you the ability to view imports as well as fields defined in tables.

For example, within an HEI or DECS Virtual Fields activity, when you call BAPI_CUSTOMER_GETDETAIL2, the information for IMPORTSCUSTOMERNO and IMPORTSCOMPANYCODE would be visible, along with the FIELDS in table CUSTOMERBANKDETAIL, when you select Field Mapping. If there is an Import Structure to be filled out, you will see names of the format IMPORTS + STRUCTURE + FIELD. In this example, field NUMBER in Import Structure PARTS would be displayed in mapping as IMPORTSPARTSNUMBER.

Exports

The export elements hold data that is exported to the function. The most common example that you may encounter is when an Export parameter returns a success or failure status, or a simple message. They are best used through the Domino Connector LSX interface because they are generally intended to provide error information and to guide application logic. See the LSX examples section in the RFC_CUSTOMER_UPDATE example for more information.

Exports may also be accessed using HEI. If ECC is a data source and you would like to use a Direct Transfer activity capture these Exports, you must enter ‘*’ for your table name -- your metadata. This will allow you to set up field mapping between the RFC’s (or BAPI's) Export parameters and, for example, the fields in a Notes document. They will be named EXPORTS + <the name of your export parameter or structure>. If there is an Export Structure to be read from, you will see names in the format: EXPORTS + STRUCTURE + FIELD. For example, field MESSAGE in Structure RESULTS would be displayed in mapping as EXPORTSRESULTSMESSAGE.

Tables

Tables are used to provide result sets (when reading) or to contain data to be written to ECC.

An RFC/BAPI function may contain multiple tables as a result set.

When an RFC/BAPI function returns multiple tables as a result set the following rules apply:
  • All tables are assumed to have a one to one relation.
  • Individual table rows are assumed to match (for example, row 5 of table one refers to row 5 in table two, and so on.)
  • In case one table has fewer rows than another table, those missing rows are considered to be empty rows.
  • To make sure that all field names are unique, all field names contained in a table are represented as a concatenation of the name of the table and the actual field name. For example, table CUSTOMERBANKDETAIL contains a field CUSTOMER. The representation of that field is CUSTOMERBANKDETAILCUSTOMER.
Note: In most cases ECC uses a ‘-’ separator but Notes does not accept a ‘-’ for a field name or other separators.

Exceptions

Exceptions cannot be returned through a specific HEI activity selection. Exceptions are reported to the HEI Server log, however, DECS and HEI Virtual Fields activities do not log exceptions. You can only see successes in the activity log file.

Note: You can use the Connector LSX classes with the Domino Connector for SAP Solutions to capture exceptions.

Examples of supported functions

See below for example scripts for the following three functions (the scripts are written in the ABAP programming language):
  • BAPI_CUSTOMER_GETDETAIL2
  • RFC_CUSTOMER_UPDATE
  • BAPI_COMPANYCODE_GETLIST
Also, see below for information about RFC_READ_TABLE:
BAPI_CUSTOMER_GETDETAIL2
*"  IMPORTING
*"     VALUE(CUSTOMERNO) LIKE  BAPICUSTOMER_ID-CUSTOMER
*"     VALUE(COMPANYCODE) LIKE  BAPICUSTOMER_ID-COMP_CODE OPTIONAL
*"  EXPORTING
*"     VALUE(CUSTOMERADDRESS) LIKE  BAPICUSTOMER_04 STRUCTURE
*"        BAPICUSTOMER_04
*"     VALUE(CUSTOMERGENERALDETAIL) LIKE  BAPICUSTOMER_KNA1 STRUCTURE
*"        BAPICUSTOMER_KNA1
*"     VALUE(CUSTOMERCOMPANYDETAIL) LIKE  BAPICUSTOMER_05 STRUCTURE
*"        BAPICUSTOMER_05
*"     VALUE(RETURN) LIKE  BAPIRET1 STRUCTURE  BAPIRET1
*"  TABLES
*"      CUSTOMERBANKDETAIL STRUCTURE  BAPICUSTOMER_02 OPTIONAL
RFC_CUSTOMER_UPDATE
*"       EXPORTING        
*"              RFCRC LIKE  SY-SUBRC           
*"              ERROR_TEXT LIKE  T100-TEXT     
*"       TABLES           
*"              CUSTOMER_T STRUCTURE  BRFCKNA1 
*"       EXCEPTIONS       
*"              UPDATE_ERROR
BAPI_COMPANYCODE_GETLIST
*"       EXPORTING        
*"             VALUE(RETURN) LIKE  BAPIRETURN STRUCTURE  BAPIRETURN 
*"       TABLES           
*"              COMPANYCODE_LIST STRUCTURE  BAPI0002_1   
RFC_READ_TABLE

The RFC_READ_TABLE function is accessible through the Domino Connector for SAP Solutions. Using select statement syntax, you can define tables and structures to be used as input to your RFCs.

Note: The FIELDS import table must contain all the table names that your RFC_READ_TABLE will be instructed to search for.
You can define your table using a select statement in an HEI activity document.
  • OPTIONS -- only for input
  • FIELDS -- for input and output
  • DATA -- only for output