SAP PI developers.
According SAP PI help Link, “you can generally implement a multi-mapping with all types of mapping programs”.
Intention of this Wiki page is to point out that all types of mapping programs can be used to generate multi-mapping (1: N)..
Name: Raghu Vamseedhar Reddy .K
Company: Infosys Limited
Created on: 8/29/2011
I am SAP Certified Development Associate - Process Integration with SAP Netweaver (PI 7.1). I have about 5 year experience of SAP XI/PI implementation and support.
I am also, Sun Certified Programmer for the Java Platform, Standard Edition 6. I have good understanding of XML, XSLT, SOAP, WSDL, ABAP. I am an active member in SAP SND.
PI considers a mapping (Graphical, Java, ABAP) as multi-mapping when,
- Mapping is able to able to generate the multi-mapping envelope, and
- Occurrence of service interfaces in Operational mapping is other than 1.
Each Multi-Mapping program should create following envelope:-
- Please pay attention to name-space http://sap.com/xi/XI/SplitAndMerge it is constant and Messages -- Message1, Message2, Message3.
- Each Message should have root XML element (it can be anything, <root> or <A> or <MT_type>). i.e., <Message1> <root>Payload1</root> </Message1>.
- Number of messages produced by mapping should be equal to number of service interfaces which are referred in Operational mapping target side.
- i.e., if in Operational Mapping you have referred only one service interface then mapping should produce only Message1.
Below Java Mapping will generate this XML output:-
When this interface (File to File) is run end to end, it will pick up one file and produce 3 output files.
First file content
<?xml version="1.0" encoding="utf-8" ?><root>Payload1</root>
Second file content
<?xml version="1.0" encoding="utf-8" ?><root>Payload2</root>
Third file content
<?xml version="1.0" encoding="utf-8" ?><root>Payload3</root>
You can follow all steps mentioned in this Graphical multi-mapping Link, except graphical mapping (instead implement java mapping).
XSLT multi-mapping Link.
Java multi-mapping (this blog) has the advantages of Java mappings i.e., archiving complex mapping logics.
- Java Mapping for multi-mapping to split the flat file to different flat files. i.e. let say, if input file is of 15 MB, then it can be split into 3 separate 5 MB files.
- XML file can be split. Let say a proxy can handle 999 records at a time. If payload is having 1200 records, then split the message into 2 XML messages. First with 999 records and second with 201 records.
- Files rename can be done using variable substitution. i.e. multiple files can be created with dynamic file name, using variable substitution. Note: DynamicConfiguration, cannot be used.