When calling for example the Z_TEST_TYPES function we have a set of import (input) and export (output) parameters. These sets correspond to the attributes in the Export and Import classes. Each attribute can have the following tagged values:
|nativeType||native ABAP type. For allowed types and valid internal/native type combinations see appendix beneath.||mandatory|
|internalLength||except for FLT, INT; DATS, TIMS): parameter length as given in the ABAP dictionary.||mandatory|
|decimals||number of decimals||mandatory for native type |
In any case, the upper multiplicity of the attributes or associations must NOT be greater than one. Otherwise, the classes cannot be mapped to SAP parameters and SAP tables should be used instead.
Figure: Export parameters in SAP
Figure: UML classes describing the interface of Z_TEST_TYPES
All examples so far handled simple type parameters only. However, it is also possible to assign SAP structure to SAP parameters, as the following example shows:
The above example shows the function Z_TEST_STRUCTURE. This operation is found in the class Z_TEST_STRUCTURE in figure UML classes describing the interface of Z_TEST_TYPES above. This operation as one export and one import parameter named EP_STRUCT respectively IP_STRUCT. Both parameters are of type ZTSTRUCT having the stereotype <<SAPStructure>>:
When calling for example the IDOC_INBOUND_ASYNCHRONOUS function we get or send two SAP tables :
Tables parameters in SAP
Figure: SAP table record example: EDI_DD40
All SAP tables consist of structures, such as EDI_DD40. Thus, an SAP table parameter can be modeled as an association to complex types of stereotype <<SAPStructure>> having a multiplicity greater than one. For example, the SAP table IDOC_DATA_REC40 is modeled as association to the EDI_DD40 class corresponding to the EDI_DD40 SAP structure having the upper multiplicity of '*'. The association name equals the SAP table parameter name: IDOC_DATA_REC40.
However, sometimes it is convenient to map records to flat, simple types like String. This means, if we model the table as array of simple types like for instance strings, the Server will map the record to a simple type. The latter case we call unstructured tables, the first case structured tables. The following class diagram shows examples of both variants.
In any case, the upper multiplicity of the attributes or associations must be greater than one. Otherwise, these classes cannot be mapped to SAP tables.
Figure : Unstructured SAP RFC tables
Figure: Structured SAP RFC tables
The following native SAP types are yet supported. Each native type is mapped to an internal type. Because SAP types are sometimes restricted in their length and number of decimals, we use tagged values to transport this meta information. For details of the native type definitions, please refer to the SAP documentation.
|Native Type||Internal Type||Internal Length||Decimals|