cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Multi mapping

former_member208396
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Vishnu Srivastava,

In MTB section, kindly use the parameter ignoreRecordsetName as false and see if it works.

Kind Regards,

Souvik

former_member208396
Participant
0 Kudos

Hi Souvik,

Please let me know where to edit MTB??

Regards,

Vishnu

Former Member
0 Kudos

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

former_member208396
Participant
0 Kudos

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 SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">GENERIC</SAP:Code>

<SAP:P1>Split mapping created no messages</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>Split mapping created no messages</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>


          Regards,

          Vishnu

Former Member
0 Kudos

I hope that you are using different interface determination per operational mapping / message mapping.

Can you kindly check that as well ?

Kind Regards,

Souvik

former_member208396
Participant
0 Kudos

Hello Experts,

Please provide your valuable suggestions. I am stuck-up in this from past 3 days.

Regards,

Vishnu Srivastava

pvishnuvardan_reddy
Active Contributor
0 Kudos

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

azharshaikh
Active Contributor
0 Kudos

Hi Vishnu,

1. Please re-check if you have Mapped Constant [] to the header Nodes (Messages, Message1, Message2) in Target Structure...

2. Do Display Queue for each mapping and check the Input and Output thats being passed.

Regards,

Azhar

former_member208396
Participant
0 Kudos

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 SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">GENERIC</SAP:Code>

<SAP:P1>Split mapping created no messages</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>Split mapping created no messages</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>


     Please suggest..?


     Regards,

     Vishnu

iaki_vila
Active Contributor
0 Kudos

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.

former_member208396
Participant
0 Kudos

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

iaki_vila
Active Contributor
0 Kudos

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.

pvishnuvardan_reddy
Active Contributor
0 Kudos

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

former_member208396
Participant
0 Kudos

Hi Inaki,

PFA the requested details.

EMPIDID tag of employeedetails is visible because ID has direct map with ID.

Also I am unable to get by: i think working with contexts you can solve meantime you can replicate the logic for one of this tags as well.

Please elaborate.

Regards,

Vishnu

former_member208396
Participant
0 Kudos

Hello,

I have tried with mapping nodes with constants, but failed with same error.

Queues details has been shared in above reply. please let me know if you require any further detail?

Regards,

Vishnu

iaki_vila
Active Contributor
0 Kudos

Hi Vishnu,

With Vishnu suggestion and according your queue screenshoot, is LOCATION the target field?, why don' use the source LOCATION tag in the then part?.

Regards.

pvishnuvardan_reddy
Active Contributor
0 Kudos

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

markangelo_dihiansan
Active Contributor
0 Kudos

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

former_member208396
Participant
0 Kudos

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

iaki_vila
Active Contributor
0 Kudos

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.

former_member208396
Participant
0 Kudos

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

iaki_vila
Active Contributor
0 Kudos

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.

former_member208396
Participant
0 Kudos

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

former_member208396
Participant
0 Kudos

For more details please refer to below link from which I have tried to implement multi Mapping,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90dcc6f4-0829-2d10-b0b2-c892473f1...

Regards,

Vishnu Srivastava

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Srivastava,

Instead of IfwithoutElse boolean function, try using CreateIf node function, keep the remaining functions as it is.

Try this out and let me know if you still face any issues.

Regards

Muniyappan
Active Contributor
0 Kudos

can you please do a mapping test and show as us screen shot?

former_member208396
Participant
0 Kudos

Hi Vishnu,

Tried with this option also but not worked as no value is coming in node itself.

Regards,

Vishnu

former_member208396
Participant
0 Kudos

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 SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">GENERIC</SAP:Code>

<SAP:P1>Split mapping created no messages</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>Split mapping created no messages</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</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