Loading RFC structure from SAP repository

Here the procedures for the source and target structure are different.

For the source structure


The source structure is created in phase 1 of a profile with a time-driven Input Agent of type "SAP".

When importing an RFC structure into the source structure, the export structure of the RFC is imported, that is, its output parameter.

The following screenshot shows the source structure that was created for the function module RFC_READ_TABLE by using the button "Create structure". For the naming of nodes and fields of the source structure see section Naming Conventions for SAP RFCs below.


images/download/thumbnails/189463533/866-version-1-modificationdate-1738736141004-api-v2.png

For the target structure


An RFC target structure is created in phase 3 of a profile. See the corresponding subsection in section Loading SAP templates.

When importing an RFC structure into the target structure, the import structure of the RFC is imported, that is, its input parameter.

The following figure shows the dialogue for importing an RFC structure from the repository of an SAP system (connected via SAP service) into the target structure.


images/download/attachments/189463533/873-version-1-modificationdate-1738736141001-api-v2.png


(1) The alias that specifies from which SAP system the RFC structure should be imported. All aliases that have been configured in the SAP service can be selected (see configuration file ./etc/sap.xml).

(2) Here you can specify a pattern for the RFC name. Example: *RFC* stands for all RFC names that contain RFC. However, you can also explicitly enter the complete name of the RFC.

(3) List of found RFCs.

(4) See the corresponding items in section Loading internal IDoc structure.

Naming conventions for SAP RFCs


The naming convention for the node and field names can be seen in the source structure screenshot above.

The nodes and fields of the structure receive the name prefix SAP_Table_ for tables and SAP_Fld_ for the corresponding fields.

So if you have an RFC field XYZ, for example, it corresponds to a field in the structure with the name SAP_Fld_XYZ.

If this field is located in a node named SAP_Fields, it is considered the IMPORT field of the RFC. If it is in a node SAP_Struct_ABC, it is transferred as component XYZ of the IMPORT structure ABC (in ABAP ABC-XYZ). If the field is in a node SAP_Table_STUVW, it is transferred as component XYZ of the table STUVW.

When you import the structure online from the SAP system, the names of the fields and nodes are created according to this naming convention.

Note: The function call-sap-rfc(alias a,rfc b,[inMap c,timeout d,filter e,outList f,debug g,h,i]) uses these conventions as well.


Occasionally, an RFC uses field, structure, or table names with a namespace prefix. Such names contain the slash character (/), which is not allowed in field and node names in the profile. The slash is therefore converted to an underscore (_). But this will violate the naming convention. In this case, the RFC field name must be in the description of the field with the prefix SAP: to establish the relationship to the name in the RFC.

When importing an RFC structure, the description field is filled accordingly if it is a domain name. Example: If the SAP name is /XYZ0/ABC, the value SAP:/XYZ0/ABC in the description field stores the original SAP name of the field.