on 10-27-2009 3:15 PM
Hi
I have a scenario with the following requirement
R3 --> XI --> Multiple files
I used a multi-mapping scenario using message mapping. to get the following output
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<Transaction> </Transaction>
<Transaction> </Transaction>
</ns0:Message1>
<ns0:Messages>
Each <Transaction> </Transaction> produces a file in runtime. So far so good.
Now, there was a new requirement to introduce a dtd line as the first line in each of the target files created - that looks like follows :
<!DOCTYPE Transaction PUBLIC \"-//XXXXX//DTD BatchReceiptAuthorization//EN\" \"http://dtd.XXXXX.com/dtds/ReceiptAuthorization.dtd\">
How do I go about introducing this header line above the <Transaction> node in each and every target file - that is created by multi-mapping ? This header line is not a part of the target schema and hence cannot be mapped to as an constant element in the target.
Any suggestions/ideas as to how this can be done ?
Hi Karthik,
This can be achieved by adding a java mapping or xslt mapping after the message mapping in the Interface mapping.
I don't think you can insert an additional namespace in the target file using standard message mapping functions.
Regards,
Gautam Purohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gautam
I did use a java mapping , as a second step after the message mapping - so that the dtd line can be introduced as a header for each target message/file written by the muti-mapping in the first step.
In my scenario, I sent the inputstream that is being passed to the Java execute method - to trace and I see that the whole of the xml file - as shown below - which is the output of message mapping ( from the first mapping step ) in sent to the execute method of the java mapping a single call
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<Transaction> </Transaction>
<Transaction> </Transaction>
</ns0:Message1>
<ns0:Messages>
So, I modified Java mapping program to look for multiple occurences of <Transaction> tag and prefix them with my constant DTD Literal - which is the primary reason , why I had to use Java mappings after the message mapping.
Now, I get an error is XI- SXMB_MONI
***********************************************************************************************************************************
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="MAPPING" />
<SAP:P1>unexpected symbol; expected '<'</', entity refe</SAP:P1>
<SAP:P2>rence, character data, CDATA section, processing i</SAP:P2>
<SAP:P3>0</SAP:P3>
<SAP:P4>113</SAP:P4>
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>The exception occurred (program: CL_XMS_MAIN===================CP, include CL_XMS_MAIN===================CM00A, line: 609)</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
**********************************************************************************************************************************
Can you help me out here ?
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.