Skip to Content
avatar image
Former Member

N:1 Multi mapping Not working !!

Hi Guys,

I have input xml message structure as follows:

<ROOT>
    <OUTPUT>    ----------------------0..n
        <XQ_Segment>  ---------------- 0..1
                XQ_DATA  -----------------0..1
                XQ_Value  -----------------0..1
         </XQ_Segment>
         <DTM_Segment> --------------0..n
             <DATES>         --------------0..1
                   Receiving_Date --------0..1
                   Process_Date   --------0..1
             </DATES>
          </DTM>
      </OUTPUT>
  </ROOT>

like 'n' number of input message ---> mapping into target message (both side message structures are same). Basically I am merging 'n' number messages. Using BPM working fine. Rather bundling 10 messages, 10 individual messages are coming out. I am using CollectTime patter.

Please can any give me their very good exposure how to map these source and target messages? Field level, Node level etc.,

Many Thanks in advance

Kind Regards

San

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 19, 2010 at 05:27 AM

    If Your souce Test message for Example is like given below

    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:MT_Test_Forum xmlns:ns1="http://YH1309/TestMapping">
             <Root>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data1</XQ_DATA>
                      <XQ_Value>value1</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive1</Receiving_Date>
                         <Process_Date>DateProcess1</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data111</XQ_DATA>
                      <XQ_Value>value111</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive111</Receiving_Date>
                         <Process_Date>DateProcess111</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
             </Root>
          </ns1:MT_Test_Forum>
          <ns1:MT_Test_Forum xmlns:ns1="http://YH1309/TestMapping">
             <Root>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data2</XQ_DATA>
                      <XQ_Value>value2</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive2</Receiving_Date>
                         <Process_Date>DateProcess2</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
             </Root>
          </ns1:MT_Test_Forum>
       </ns0:Message1>
    </ns0:Messages>
    

    and You want to get the Target Message as

    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:MT_Test_Forum xmlns:ns1="http://YH1309/TestMapping">
             <Root>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data1</XQ_DATA>
                      <XQ_Value>value1</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive1</Receiving_Date>
                         <Process_Date>DateProcess1</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data111</XQ_DATA>
                      <XQ_Value>value111</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive111</Receiving_Date>
                         <Process_Date>DateProcess111</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
                <Output>
                   <XQ_Segment>
                      <XQ_DATA>data2</XQ_DATA>
                      <XQ_Value>value2</XQ_Value>
                   </XQ_Segment>
                   <DTM_Segment>
                      <DATES>
                         <Receiving_Date>dateReceive2</Receiving_Date>
                         <Process_Date>DateProcess2</Process_Date>
                      </DATES>
                   </DTM_Segment>
                </Output>
             </Root>
          </ns1:MT_Test_Forum>
       </ns0:Message1>
    </ns0:Messages>
    

    Then do the Mapping as follows

    Output(Change the Context to Message1)----


    >Output.

    For all other fiels just do the direct mapping from source Root toTarget Root .and similarly for other fields

    You can also refer this wiki as a reference to collect message and bundle then into one message using BPM pattern

    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=133562783

    Regard ,

    Kubra fatima.

    Edited by: Kubra fatima on Jul 19, 2010 7:33 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 19, 2010 at 02:08 AM

    Just check if you have done following properly:

    1) Message Mapping, Source Message Occurence is 0:unbound, target message is 1:1

    2) Operation Mapping (Message Mapping), Source is 0:unbound, target is 1:1

    3) In Message Mapping, target only, you can map any constant value to target message type node

    4) In Target message, only one Root node need to be created, so you can also map a constant value to it.

    5) ROOT in source will map to our OUTPUT in target, I guess (you have to carify how you merge your data in business level).

    Regards

    Liang

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi ASandhya ,

      
       I change the mapping like the link you sent me. Only first message one <OUTPUT> tag is coming. Please push me a bit,
      

      I think You have missed one point from my previous reply

      Then do the Mapping as follows
      Output(Change the Context to Message1)----------->Output.
      

      right click on the Output field of the source message and selct Context ,Message1.

      As your requirement is to Collect and Bundle Messages from One Interface

      There are three ways of doing it as mentioned in this link

      http://help.sap.com/saphelp_nwpi711/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm

      and The link that I have mentioned for collect the message is based on Payload depended.In your case as you dont know the no of message to be collected and it dependens on Time..then You have to go for

      Time-Dependent Loop .

      The most important is your transformation step after the loop ends.

      So I suggest you to check your mapping in the test tab by duplicating the requirend nodes.

      Regards ,

      Kubra fatima