on 07-31-2015 11:58 AM
Hello Experts,
I want to test multi mapping concept in SAP PI.
Source fields structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_SENDER_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping">
<EMPDETAILS>
<ID/>
<FIRSTNAME/>
<LASTNAME/>
<DEPT/>
<LOCATION/>
</EMPDETAILS>
</ns1:MT_SENDER_MULTI_MAP>
</ns0:Message1>
</ns0:Messages>
Target field1 structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_RECEIVER_FILE_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping">
<EMPLOYEEDETAILS>
<EMPID/>
<EMPFIRSTNAME/>
<EMPLASTNAME/>
<EMPLOCATION>noida</EMPLOCATION>
</EMPLOYEEDETAILS>
</ns1:MT_RECEIVER_FILE_MULTI_MAP>
</ns0:Message1>
<ns0:Message2/>
</ns0:Messages>
Target Field2 Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1/>
<ns0:Message2>
<ns1:MT_RECEIVER_JDBC_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping">
<EMPLOYEEDETAILS>
<EMPID/>
<EMPFIRSTNAME/>
<EMPLASTNAME/>
<EMPDEPT/>
</EMPLOYEEDETAILS>
</ns1:MT_RECEIVER_JDBC_MULTI_MAP>
</ns0:Message2>
</ns0:Messages>
Requirement:
If Source "Location" = "INDIA" then populate Target filed1
If Source "Location" != "INDIA" then Polulate Target field2.
Logic:
Please find logic and other details in PFA.
I have checked for Location with IfWithoutElse boolean function and given source and target fileds as accordingly but since "ns1:MT_SENDER_MULTI_MAP" itself don't contain any value so target filed is coming as "".
Please help.
Regards,
Vishnu
Hello Vishnu Srivastava,
In MTB section, kindly use the parameter ignoreRecordsetName as false and see if it works.
Kind Regards,
Souvik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vishnu,
By MTB, I mean Message Transformation Bean, and you will add it in module tab of sender communication channel. Over there in the module section (i.e. in the lower section), please add along with the rest of the parameters ignoreRecordsetName with its value being false. Also dont forget to mention the module key.
Kind Regards,
Souvik
Hi,
I have added attached value in sender file channel of module tab but same below error .
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Request Message Mapping
-->
</SAP:Error>
Regards,
Vishnu
Hello Experts,
Please provide your valuable suggestions. I am stuck-up in this from past 3 days.
Regards,
Vishnu Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishnu,
As you are saying if you do the testing in ESR mapping test tab, it is becoming successful, but not end to end.
Did you take the same message payload which got failed in moni and tested in mapping?
Please share the screen shots of the same.
Also, check the occurrence of target messages in signature tab.
Regards
Hello Azhar,
By mapping constant to header nodes it is failing with below error.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Request Message Mapping
-->
</SAP:Error>
Please suggest..?
Regards,
Vishnu
Hi Vishnu,
I have a little idea. You have use your logic to determine if the field MT_SENDER_MULTI_MAP need to be created or not, but i think you should use your logic with the field Message1, because if the Message1 tag is created but you don't have any tag inside could be problematic.
Regards.
Hi inaki,
I have changed target field in my logic with meesage1 & message2 but the required target payload is still missing. Below is the target payload.
<?xml version="1.0" encoding="utf-8" ?><ns1:MT_RECEIVER_FILE_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping"><EMPLOYEEDETAILS/></ns1:MT_RECEIVER_FILE_MULTI_MAP>
Regards,
Vishnu
Hi Vishnu,
Are you saying that the tags:
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
are not being generated??
or the problem is that the tags inside EMPLOYEEDETAILS are not being generated?, could you share the queue for Message1 and one of these EMPLOYEEDETAILS tags?. In this case, i think working with contexts you can solve meantime you can replicate the logic for one of this tags as well.
Regards.
Hi Vishnu,
I assume your message mapping looks like as below:
Map constants to Message1 & Message2 target nodes. For MT_... nodes, give the required logic to create these nodes whenever the condition satisfies.
Also, if the internal fields are not getting populated, can you please cross check what exactly these fields are getting populated in mapping level. Please share screen shots of the display queue values.
Regards
Hi Vishnu,
Can you use CreateIf node function instead of If boolean function in the logic.
Also please check the mapping logic for the subfields present in the structure. Can you share the test instance display queue values for the subfields by testing with the failed payload in message mapping.
Regards
Hi Vishnu.
Please find logic and other details in PFA.
I have checked for Location with IfWithoutElse boolean function and given source and target fileds as accordingly but since "ns1:MT_SENDER_MULTI_MAP" itself don't contain any value so target filed is coming as "".
You can add values in the test xml, just go to mapping test tab, select generate instance and then add the values there.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mark,
I have saved the instance as per your suggestion but still no values in target file. Please find the target file content below.
Source file content:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_SENDER_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping">
<EMPDETAILS>
<ID>3349</ID>
<FIRSTNAME>Vishnu</FIRSTNAME>
<LASTNAME>Srivastava</LASTNAME>
<DEPT>SAP</DEPT>
<LOCATION>India</LOCATION>
</EMPDETAILS>
</ns1:MT_SENDER_MULTI_MAP>
</ns0:Message1>
</ns0:Messages>
Target file content:
<?xml version="1.0" encoding="utf-8" ?><ns1:MT_RECEIVER_FILE_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping"><EMPLOYEEDETAILS/></ns1:MT_RECEIVER_FILE_MULTI_MAP>
Regards,
Vishnu
Hi Vishnu,
You said before:
I tried to test the mapping in ESR(test) and end to end test. First one is successful but in end to end test it failed with below error.
If you generate a test from ESR and you get a desired response then the problem could be in the namespaces, have you compared your ESR test XML with the runtime namespacces?, are the XML with the same structure?
Regards.
Hello Inaki,
I have used only one namespace as "http://sopra.com/po/test/multi_mapping" in my entire scenario.
But I can see one more namespace in source file content as "http://sap.com/xi/XI/SplitAndMerge"
Is this causing the problem..??
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_SENDER_MULTI_MAP xmlns:ns1="http://sopra.com/po/test/multi_mapping">
<EMPDETAILS>
<ID>123</ID>
<FIRSTNAME>asda</FIRSTNAME>
<LASTNAME>zxcc</LASTNAME>
<DEPT>jghg</DEPT>
<LOCATION>noijh</LOCATION>
</EMPDETAILS>
</ns1:MT_SENDER_MULTI_MAP>
</ns0:Message1>
</ns0:Messages>
Regards,
Vishnu
Hi Vishnu,
But I can see one more namespace in source file content as "http://sap.com/xi/XI/SplitAndMerge"
Is this causing the problem..??
No, there is not a problem, you can have several namespaces.
The main problem, if i have read right all the thread, is that you can test from ESR successfully but in runtime the messages are not getting generated. I wanted to mean that perhaps you have different XMLs, in runtime can be generating a different XML that the expected. When i have this problem, sometimes is because the namespaces has not been poppulated correctly, i only want to ask you if you have compared the two XMLs. If i have any wrong supposition, please correct me.
Regards.
Hi Inaki,
Since it is multimapping, by default it is taking receiver namespace as http://sap.com/xi/XI/System and reviver interface as InterfaceCollection.
I have just tried to remove one mapping from ERS and made it as simple scenario but still the values are not getting populated in target file though receiver namespace changed to configured one.
My question is: in the attched logic will all the corresponding fields in note will populate in target while note itself if empty but child node carrier some values.
Regards,
Vishnu
For more details please refer to below link from which I have tried to implement multi Mapping,
Regards,
Vishnu Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Muniyappan,
I tried to test the mapping in ESR(test) and end to end test. First one is successful but in end to end test it failed with below error.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Request Message Mapping
-->
</SAP:Error>
If I use "map with default" node function after "if without else" then it won't fail but the target file also don't contain any values.
Regards,
Vishnu
I
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.