RFC_READ_TABLE_to_XML_Preparser
Configuration file |
None. |
Class name |
com.ebd.hub.datawizard.parser.SystemCallPreParser |
Preliminary remarks
This preparser is only relevant for customers with a licensed SapConnectionService.
Queries to SAP database tables can be made in phase 1 by calling RFC_READ_TABLE.
The data delivered in the response of the RFC_READ_TABLE consists of two tables FIELDS and DATA, both in fixed-length format.
The Data table delivers the data records from the select row by row, but the assignment of the values to individual table columns must be interpreted with the result of the FIELDS table.
The preparer described here generates the interpreted data records as XML data from the fixed-length structure of the response, whereby the actual field names of the SAP table appear as XML tags.
This allows the response to be parsed in the source structure of the profile in the context of the database table.
Example
The select of the fields LAND1, SPRAS, LANDK, INTCA3, LNPLZ of table T005 with the WHERE clause INTCA3 LIKE 'D%' returns the following response in fixed-length format.
At the beginning is the name of the interface parameter of the RFC with a length of 30 characters, followed by the corresponding data record as a fixed-length data record without separators. The FIELDS table contains the name, offset position, length, type and descriptive text of the columns of the SAP database table. With this structural information, each data record of the select result must be evaluated in the DATA table.
The RFC_READ_TABLE_to_XML_Preparser converts the data into an XML format containing the field names of the SAP database table as XML fields.
The root element ITEMS contains as attributes the number of data records, the SAP table name, the SAP alias, as well as the request parameters ROWCOUNT and ROWSKIP, which are ignored with 0.
In addition, the applied query is contained under OPTIONS. The ITEM data records with sequential number contain the corresponding column values of the SAP table. This data can be parsed as XML.
Structure import
The class contains the required option to import the source structure after configuring the corresponding RFC call RFC_READ_TABLE in phase 1, additionally changing the document type of the profile from Fixed-length to XML and the name of the root tag to ITEMS.
Prerequisites for the structure import
The time-driven Inout Agent "SAP" is selected in phase 1.
The document type of the profile is "Fixed-length".
The "RFC name" is "RFC_READ_TABLE" (in Input Agent).
The "Output format" is "FIXRECORD".
After clicking "Request RFC", the parameter "QUERY_TABLE" appears. The name of the SAP database table is to be entered there, e.g. "T005".
The names of the database columns to be selected were entered under the table parameters "Fields", or, if "Fields" remains empty, all columns are used in natural order.
The profile has been temporarily saved.
Now you can created the source structure with button "Create structure". If the above requirements are not met, the usual fixed-length structure of the RFC_READ_TABLE is generated. If all prerequisites are met, the routine within the preparser class will instead create the corresponding 'semantic' XML structure and change the document type of the profile to XML, as well as entering the XML root name ITEMS.
Limitations
Since the structural information of the FIELDS lines of the RFC response is always at the end, all data of the response must be kept in the working memory by the preparser during the conversion. The preparser is therefore not suitable for real mass data that would blow up the working memory. A corresponding restriction through the WHERE condition in OPTIONS or through the request parameter ROWCOUNT is absolutely necessary.