Use
ABAP mappings are mapping programs in ABAP objects that customers can implement using the ABAP Workbench.
Prerequisites
Note the prerequisites in the sections Purpose and Integration as well as the Restrictions in Mapping Development with the ABAP Workbench.
Features
An ABAP mapping comprises an ABAP class that implements the interface IF_MAPPING in the package SAI_MAPPING. The interface has a method EXECUTE with the following signature:
Importing Parameter
Parameter | Meaning |
SOURCE | Source XML document |
PARAM | Parameter object for read access to runtime constants (see below) |
TRACE | Trace object for writing messages in the mapping trace (see below) |
Exporting Parameter
Parameter | Meaning |
RESULT | Target XML document |
Exception: CX_MAPPING_FAULT
Applications can decide themselves in the method EXECUTE how to import and change the source XML document. If you want to use the XSLT processor of SAP Web AS, you can use the ABAP Workbench to develop a stylesheet directly (see XSLT Mappings (ABAP Engine)) rather than using ABAP mappings.
Mapping Trace
You use the trace object to write messages in the mapping trace, which you can view in message monitoring. If using the method TRACE, you enter the trace level and the output message:
Trace Level | Meaning |
0 | No trace is written |
1 | Warnings are output |
2 | Warnings and error information are output |
3 | Warnings, error information, and debugging information are output |
Alternatively, you can use the methods TRACE1, TRACE2, or TRACE3 to write messages for trace levels 1, 2, or 3 in the trace.
The trace level that you set for an Integration Engine pipeline determines which messages appear in monitoring. See also: Displaying/Changing Configuration Data.
Runtime Constants
In ABAP mapping you can read access message header fields. To do this, an object of type IF_MAPPING_PARAM is transferred to the EXECUTE method. The interface has constants for the names of the available parameters and a method GET, which returns the respective value for the parameter name. The constants are the same as in Java mappings, although the constant MAPPING_TRACE does not exist for ABAP mappings. Instead, the trace object is transferred directly using the parameter TRACE of the method IF_MAPPING~EXECUTE (see above).
Example: Accessing a Runtime Constant
Method IF_MAPPING~EXECUTE.
* Get mapping constant SENDER_SERVICE
data: l_sender_service type string.
l_sender_service = param->get( IF_MAPPING_PARAM=>SENDER_SERVICE ).
ENDMETHOD.
No comments:
Post a Comment