For some reasons it can be necessary to log messages at XI, for example:
You want to realize an own caching mechanism
You want to realize an own recovering mechanism
You want to realize an individual error monitoring
The logging is implemented in ABAP stack to use comfortable and performant SAP tables. Some alternatives like Java or XSLT are thinkable.
The basic mechanism can be reduced to:
A message, which should be logged, is going to a an outbound interface
An additional ABAP mapping is logging the message in a cluster table (strings!)
The "normal" mapping is executed before filling of inbound interface
Reading is nearly the same:
A message, which should be mapped with logged parts of another message, is going to a an outbound interface
An additional ABAP mapping is reading a message from that cluster table
The "normal" mapping is executed before filling of inbound interface
Implementation
Prepare of ABAP Mappings
Please put an additional parameter into your exchange profile: IB / Administration / Exchange Profile / IntegrationServer.MappingRuntime Value: com.sap.aii.repository.mapping.additionaltypes=R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine) Have a look to SAP Library: Mapping Development with the ABAP Workbench
Create a ABAP Mapping
Create a new ABAP class with interface "IF_MAPPING"
Put your source code into method "execute"
The parameters "SOURCE" and "RESULT" are typed with "XSTRING", which has to be converted for the most reasons