RFC Interface Definition as XML File
The interface definition is done in an XML file whose path is specified in the listener configuration in parameter xmlFile. The structure of the XML file is checked via the DTD file sap_rfc_configure_1_0.dtd, which must be available under the path ./etc/dtd/. The root element is called RFC and the name of the RFC is expected in the name attribute. It must match the functionName in the listener configuration.
<?
xml
version
=
"1.0"
encoding
=
"ISO-8859-1"
?>
<!DOCTYPE RFC PUBLIC
"-//EBD Integration//DTD SAP RFC Configuration 1.0//EN"
"
http://www.ebd-entwicklung.de/dtd/sap_rfc_configure_1_0.dtd
">
<
RFC
name
=
"RFC_name"
>
<!-- Further settings-->
</
RFC
>
Section <!-- Further settings--> contains the definition of the
import parameters as simple fields or 'flat' structures,
export parameters as simple fields or 'flat' structures,
table parameters and
exceptions.
We assume that the basic concept of an SAP RFC interface (ABAP) is known. All parts of the interface are optional.
IMPORT Parameters
<
INPUTPARAMS
>
<!-- Field definitions and/or structure definitions -->
</
INPUTPARAMS
>
EXPORT Parameters
<
OUTPUTPARAMS
>
<!-- Field definitions and/or structure definitions -->
</
OUTPUTPARAMS
>
TABLE Parameters
<
TABLES
>
<
TABLE
name
=
"name"
refname
=
"tablerefname"
description
=
"description"
tabletype
=
"type"
>
<
ROW
>
<!-- Field definitions -->
</
ROW
>
</
TABLE
>
<!-- Further table definitions -->
</
TABLES
>
Every TABLE definition contains exactly one ROW. One can imagine the ROW as a nameless structure. The values of a table then form a list of such composite structure values.
If multiple tables are defined with the absolute same structure, you should use the same refname. The refname can be created by using the prefix REF_ and name. The tabletype can have the values in, out or inout. Note: The class DataWizardForwardRequestListener can only have the value in.
Exceptions
<
EXCEPTIONS
>
<
EXCEPTION
name
=
"name"
description
=
"description"
/>
</
EXCEPTIONS
>
Field Definitions
<
FIELD
name
=
"field_name"
type
=
"field_type"
length
=
"length"
decimals
=
"decimal_points"
description
=
"description_of_the_field"
/>
Field Type |
Meaning |
BCD |
Binary number format with decimal places, length and decimals are mandatory. |
BYTE |
Binary data (byte sequence), length is necessary. |
CHAR |
Character sequence with fixed length, length is necessary. |
DATE |
Date without time, format yyyyMMdd, length=8. |
FLOAT |
Floating point number, length and decimals are mandatory. |
INT |
4 byte integer. |
INT1 |
1 byte integer (careful). |
INT2 |
2 byte integer (careful). |
NUM |
Numeric value as character string, length is necessary. |
STRING |
Character string with variable length, not for STRUCTURE or TABLE. |
TIME |
Time without date, format HHmmss, length=6. |
For types where decimals has no meaning, the value is ignored. The types INT1 and INT2 should not be used because the JCo will report an incorrect length. Use NUM with length instead.
Structure Definitions
Structures in the import and export parameters are 'flat' structures, which means that a structure only contains fields, but no further structures.
<
STRUCTURE
name
=
"STRUCT1"
refname
=
"REF_STRUCT1"
description
=
"description"
>
<!-- Field definitions -->
</
STRUCTURE
>
Similar to the table definitions, multiple structures with absolutely the same structure should use the same refname.
Structure of the Example RFC MY_RFC
The example defines the function module MY_RFC that only expects one numerical value as import field NUMERIC_ID.
<?
xml
version
=
"1.0"
encoding
=
"ISO-8859-1"
?>
<!DOCTYPE RFC PUBLIC
"-//EBD Integration//DTD SAP RFC Configuration 1.0//EN"
"
http://www.ebd-entwicklung.de/dtd/sap_rfc_configure_1_0.dtd
">
<
RFC
name
=
"MY_RFC"
>
<
INPUTPARAMS
>
<
FIELD
name
=
"NUMERIC_ID"
type
=
"INT"
length
=
"4"
decimals
=
"0"
description
=
"Numeric ID"
/>
</
INPUTPARAMS
>
</
RFC
>
Note about Data Types in STRUCTURE and TABLE
The term 'flat structure' refers to a composite data type composed of a sequence of simple fields. Each individual field must have a specific field length. The variable length type STRING is therefore not allowed for structures.
A TABLE parameter is actually a list of rows, with each row representing a flat structure. Therefore, the use of the type STRING is also inadmissible in the TABLE definition.
On the SAP side, we always recommend the use of repository types. The user has to ensure conformity on the Lobster side by using a suitable data type (preferably CHAR or NUM) with the length specified as defined in the SAP repository.
Example: If you use the repository type CHAR13 in SAP for an EAN, the field on the Lobster side has to be defined with the following attributes.
.... type=“CHAR“ length=“13“ .... |
Fields in STRUCTURE and TABLE definitions should have the same order as on the Lobster side.