Message mapping - Duplicate subtree

Hi Experts,
I am working on 7.0 server.
In the existing message mapping I found that target nodes are duplicated.
For example
/ns0:FiletoFile_ib_mt/Record/Emp[1]
/ns0:FiletoFile_ib_mt/Record/Emp
And the order for the node in the target message structure is same as above.
And in the output, the order is reversed as below
/ns0:FiletoFile_ib_mt/Record/Emp
/ns0:FiletoFile_ib_mt/Record/Emp[1]
But when am duplicating one more node in the existsing mapping the order is
/ns0:FiletoFile_ib_mt/Record/Emp[2]
/ns0:FiletoFile_ib_mt/Record/Emp[1]
/ns0:FiletoFile_ib_mt/Record/Emp
And now the output is
/ns0:FiletoFile_ib_mt/Record/Emp[2]
/ns0:FiletoFile_ib_mt/Record/Emp[1]
/ns0:FiletoFile_ib_mt/Record/Emp
But I need the output as
/ns0:FiletoFile_ib_mt/Record/Emp
/ns0:FiletoFile_ib_mt/Record/Emp[1]
/ns0:FiletoFile_ib_mt/Record/Emp[2]
Please let me know if you have faced similar issue.
If am creating a new message mapping and duplicating the subtrees the order is given below
/ns0:FiletoFile_ib_mt/Record/Emp
/ns0:FiletoFile_ib_mt/Record/Emp[1]
Why in the existing mapping duplicate subtree is going in the top order and for new message mapping duplicate subtree is going in the bottom. Please advice
Thanks
Suma S

Hi Lucas
I checked this sap note but I used PI 7.0.
This happens from 7.10 onwards and this is primarily due to the reason that the occurence of the duplicated node was not remembered when the mapping program gets executed. So, the mapping program was expecting data from the payload for the duplicated node and hence the error

Similar Messages

  • Using useOneAsMany function in Message Mapping if subtree is optional

    Hi,
    I am trying to develop a message mapping for the following case:
    In the source message, there is a value "Value1" which is on the same level as a subtree "Struct2" which can occur 0..unbound times
    In the target message the value "Value1" has to be part of that subtree, so it has to be copied for each occurence of "Struct2" in the source message
    For the case that the subtree has cardinality 1..n there are some examples on the web, e.g. useOneAsMany (SAP-Bibliothek - Partner Connectivity Kit). But that does not fit my case. The subtree in the source message is optional here.
    See a screenshot of the message mapping and my solution for the mapping of "Value1" below:
    All other values are mapped 1:1.
    Sadly, this solution does not work when "Struct2" has cardinality 0..unbound, for 1..unbound it works perfectly. Here is my example:
    When I try the mapping, I get the following error message:
    That is true. The first queue of the useOneAsMany function has more values than the second. But I don't know how I can fix it, so that it works for my example. Can anyone give me a hint please?
    Setup is AEX 7.31.

    Hi Stefan,
    You can use this mapping.
    And for Struct2-Value1
    Result:
    Hope this helps,
    Mark

  • Message mapping challenge for a newbie

    Dear PI message mapping experts,
    I'm a newbie in PI and facing a mapping problem using graphical message mapping.
    I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.
    Here after is the mapping i need to perform :
    Source structure IDOC :
    <E1EDKA1> (0..99)
       <NAME1> A </NAME1>  (0..1)
       <NAME2> B </NAME2>  (0..1)
       <NAME3> C </NAME3>  (0..1)
       <NAME4> D </NAME4>  (0..1)
    </E1EDKA1>
    Target structure :
    <AccountingCustomerParty>  (1..1)
       <Party> (0..1)
          <PartyName> (0..unbounded)
              <Name>A</Name> (1..1)
          </PartyName>
          <PartyName>
              <Name>B</Name>
          </PartyName>
          <PartyName>
              <Name>C</Name>
          </PartyName>
          <PartyName>
              <Name>D</Name>
          </PartyName>
       </Party>
    </AccountingCustomerParty>
    I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.
    Could you please help me ?
    Thanks in advance,
    Alysee

    Hi,
    Please try as below:
    1. Create a source structure
    <AccountingCustomerParty>  (1..1)
       <Party> (0..1)
           <PartyName> (0..unbounded)
                <Name>A</Name> (1..1)
           </PartyName>
       </Party>
    </AccountingCustomerParty>
    2. When in message mapping, duplicate the node 'PartyName' 4 times. Right click on the 'PartyName' Node and you would find Duplicate Subtree.
    3. Map 'Name1' field in the source to the first 'PartyName' node in the target. Similarly, map Name2, Name3 and Name4 fields to their respective 'PartyName' nodes.
    4. Map the 'Name1' field in the source structure to first 'Name' field in the first 'PartyName' Node. Similarly, follow the same process for Name2, Name3 and Name4 fields. By doing so, your requirement would be met.
    Thank  you.
    Regards,
    Subbu

  • Duplicate subtree for source message

    Hi,
    What do I do if I need to duplicate the source tag?
    For example Left occurs 0 thru 4, however system will always pass two occurrences, say,
    Left(0) = 100
    Left(1) = 200
    I need to map these to different fields in the target for example..
    Rightfirst = 100
    Rightsomeotherfield = 200
    If I right click on the source tag, I cannot duplicate subtree to do the mapping. Any ideas?

    Hi,
    You will need to use an user-function, with the context of Left as input.  In the user-function you can send the specific occurance of Left as output.
    In the user-function, Left is an array.
    Example:
    result.addValue(Left[0]);  // to send the 1st value
    or
    result.addValue(Left[1]);  // to send the 2nd value
    Then, assign the the output of the user-function to Rightfirst, or Rightsomeotherfield.
    Regards,
    Bill

  • Duplicate subtree in PI 7.11(EHP1) not working as it works in XI 3.0

    Hi Friends,
    I've exported a mapping program(graphical) from XI 3.0 to PI 7.1 as we are upgrading from old version to new one.
    The mapping consists of the following target structure:
    Item(Occ->0..1) Node
          Err(Occ->0..1)Subnode under Item
                 Errtext0(Occ->0..1)Field under Err--->field being duplicated
                 Errtext0[1](duplicated field of Errtext0)--->field after duplication
                 Errtext0[2]](duplicated field of Errtext0)--->field after duplication
                 Errtext0[3]](duplicated field of Errtext0)--->field after duplication
    In XI 3.0 when the duplicate fields are populated with values during mapping the fields appear at the target but in PI 7.1 the duplicate fields are not appearing even after values being populated.
    One more observation is, In XI 3.0 when I duplicate a field its type(eg: String) and occurrence gets copied or is visible once the field is duplicated but in PI 7.1 the attributes are not visible.
    Ultimately only the value of the field being duplicated is occuring after mapping transformation but not the values of duplicated fields.
    Please let me know the answer if anyone of you have come across similar problem
    Many thanks.

    Hi
    We are using PI7.1 EHP1. our issue is, we have create one data type, message type in PI7.1 EHP1.
    Now whenever we are using the Message type in message mapping & whenever we are trying to duplicate any of the field using the duplicate subtree option in  context menu, it is generating the duplicate subtree field without the occurence and the data type of field.
    Now if we will do the mapping for the duplicate field, the field is not coming in the target structure, if we are testing our mapping using test option.
    The issue we are facing with Pi7.1 EHP1. we already tried the same in XI3.0and PI7.1  and it is working fine.
    could you please suggest if it is any service pack issue or any technical issue with mapping?
    Thanks

  • Duplicate subtree in PI 7.1 (EHP1) not working as it did in XI 3.0

    Hello,
    When I duplicate a subtree with occurrence of 0---Unbounded in PI 7.1 (EHP1), the node gets duplicated but without the occurrence and type in the duplicated node.
    When duplicating a subtree with occurrence of 0---Unbounded  in XI 3.0, the occurrence and the type would be copied exactly the same to the duplicate node.
    Does anyone know how to solve this issue?  I have moved a message mapping from XI 3.0 which worked successfully there, but due to this issue, the mapping is failing in PI 7.1.
    I have already seen the following which has not helped me.
    Note 1340036 - Duplicating a subtree does not change the cardinality
    Note 1404364 - Recursive nodes are not rendered correctly after duplication
    Note 1371541 - Duplicate subtree is Message Mapping not working properly
    Duplicate subtree in PI 7.11(EHP1) not working as it works in XI 3.0
    Thank you,
    Rhonda

    Hi VK,
    Thank you so much.  Yes, after doing some more testing, I realize you are correct.  Even though we don't see the occurrences, it still works the same.
    My problem was actually something different in the mapping which I have resolved now too.
    I have given you points.
    Thanks again,
    Rhonda

  • Testing message mapping

    helo xi guroos.
    i just got one doubt like
    in my scenario i have created one message mapping program.
    in this mapping program i want to test for multiple records in body.
    i found a technique of duplicate subtree for creating dummy multiple records in body.
    but while testing the result is not matching when compered to my last mapping test with only single record in body.
    waiting for u r response.
    bye.
    regards.
    seeta ram.

    Hi Ram,
    just see the maximum occurace of topmost target node - it should be 0..unbounded and then you will get multiple target nodes for multiple source nodes..........also just assign the topmost target node to a constant field if you dont have any condition for creation of topmost target node........
    Thanks,
    Rajeev Gupta

  • Unable to duplicate subtree E1EDK14 for ORDERS05

    Hi,
    For File to Idoc flow, my mapping requirement is
    For E1EDK14,
    ORGID/QUALF=012           ORGID = ORDERTYPE
    ORGID/QUALF=008           ORGID = SALESORG
    For that, I have to duplicate subtree E1EDK14 and map it from the source field.
    But when I save it the second node of of E1EDK14 is deleted with message.
    Target structure has no such path:
    /ORDERS05/IDOC/E1EDK14[1]/ORGID. Skipping mapping
    Note that the occurance of E1EDK14 is 0..12
    Is there any way to achieve this?
    regards,
    Anirudh.

    Hi Anirudh,
    You can achieve the above condition by checking the conditon of source filed which is mapped to Qualifier field of idoc and with check you can map it to OrderType. like
    if --->SourceField -->Equals --> 012 then ---> ORDERTYPE --->OrgID
    and foe second case
    if --->SourceField -->Equals --> 008 then ---> SALESORG --->OrgID
    Otherwise if you want to duplicate Create New mapping and first duplicate the Segment and then proceed with the mapping.
    Thanks!

  • Certification Exam content  clarification - Message mapping patterns

    I was going through the Exam content for  SAP NetWeaver´04 - Exchange Infrastructure & Integration  Dev.Cons.
    Link
    Check out this part -
    " 4. Mapping (++)
    Concepts / Overview
    Test / Debug Environment
    Standard functions
    User-defined Functions
    Message mapping patterns
    Multi-mapping
    ABAP, Java, XSLT mapping overview "+
    What does Message mapping patterns mean?
    I have cert docs but nothing verifies this.
    Thanks for your time,
    Priya.

    Hi,
    Mapping “patterns” are some of the common mapping requirements found in the past which XSLT was used, because we did not think that Message Mapping provided the functionality
    Summarization
    Sequence–Number Generation
    Duplicating Subtrees
    Table / Value Lookups
    Tree–Reversal
    <removed_by_moderator>
    Read the "Rules of Engagement"
    Nilesh
    Edited by: Juan Reyes on Apr 3, 2009 11:15 AM

  • Generating target nodes dynamically in message mapping

    Hi XI GURUS
    I am trying to generate target node using using more then source node. Is it possible to do this.
    I need this as in source I have 2 different nodes (0 to unbounded) and in target I want to create corresponding number of target nodes. For e.g if I have 2 + 1 nodes in source then I want to create 3 nodes in target
    Source as below
    <FIRSTNAME>
         <Raj>
         <Kum>
    </FIRSTNAME>
    <FIRSTNAME>
         <Naveen>
         <Kumar>
    </FIRSTNAME>
    <CITY>
    <bANGALORE>
    </CITY>
    Desired output in target as below
    <ADDRESS>
    <qwerty1>
    <ADDRESS>
    <ADDRESS>
    <qwerty2>
    <ADDRESS>
    <ADDRESS>
    <qwerty2>
    <ADDRESS>
    Can i follow an alternative approach (using java function) of counting the total number of occurences of  source nodes and generating as many number of the target node
    Thanx

    If you have a condition check for each of the source node to be mapped to the target node,
    use "create if" standard function and pass the boolean result of your Condition check as an input to this standard function. For each "true" a value would be added to the output queue. If you have a simple condition check on some source field value for each correspoding node, use "if without else" or depending on the complexity of the condition you may use a udf to get the boolean outcome.
    And for mapping from more than on type of source node, you may duplicate subtree for target node.
    Regards,
    Suddha

  • Is it possible to copy segment mapping in message mapping??

    Hii Experts,
    I want to duplicate one segment and I want to copy all the mappings of one segment into the other in message mapping.
    Mapping Templete does not work here.
    Anyone knows any other work around ?? The segment contains hell lot of mapping rules and it is difficult to copy each and every rule.
    Thanks in advance.
    Shri

    Hi shripad
    just try one thing right click on target field which you want to copy and select option copy node ..if it is work then it may.....otherwise i donot think its possible..
    Thanks
    Kunaal

  • MESSAGE MAPPING PROBLEM PLS HELP

    hi forum i have a problem in message mapping...
    i have a file to file scenario...with a BPM..
    the components are:
    1. one outbound async MI:->   MI_OA_fileSender
    2. one abstract async MI:->   MI_AA_fileSender
    the above two has messsage structure as:
    <ns0:MT_sourceFile xmlns:ns0="http://zpoc.com.test/rana3">
       <recordset> 1...1
          <record>  1..unbound
             <batch_num/> 1..1
             <quantity/>  1..1
          </record>
       </recordset>
    </ns0:MT_sourceFile>
    3. one abstract async MI: -> MI_AA_fileDestination
    4. one inbound async MI:-> MI_IA_fileDestination..
    the above two has messsage structure as:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_destinationFile xmlns:ns0="http://zpoc.com.test/rana3">
       <recordset> 1..1
          <record> 1..unbound
             <rec_number/> 1...1
             <qty/> 1...1
          </record>
       </recordset>
    </ns0:MT_rana3_destinationFile>
    inside the BPM i m doing a simple one to one interface mapping between MI_AA_fileSender and MI_AA_fileDestination AND then use a send step to send it to receiver service. But inside the graphical editor, for the message maaping in the interface mapping, i change the target structure a bit by duplicating <rec_number> making it:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_destinationFile xmlns:ns0="http://zpoc.com.test/rana3">
       <recordset> 1..1
          <record> 1.. unbound
             <rec_number/> 0..1
             <rec_number/> 0..1 //did right click   and "duplicate sub-tree, so it becomes 0...0"
             <qty/>
          </record>
       </recordset>
    </ns0:MT_destinationFile>
    But i dont change the original structure of MT_destinationFile.
    Now in the resultant file in the receiver side i recive two <rec_number> tags....
    but since i didnt change the original structure of MT_destinationFile.....but i only made a change in the mapping by duplicating the node <rec
    _number>(right click and done "duplicate sub tree").............SHOULD IT NOT THROW AN ERROR
    Message was edited by:
            sudeep dhar
    Message was edited by:
            sudeep dhar

    >.............SHOULD IT NOT THROW AN ERROR
    Not necessarily.
    See, XI won't realize, by default, a schema validation in your messages. If you want a validation, you'll have to implement one, as described in
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/e1343e8c7f6329e10000000a114084/frameset.htm
    However, for some particular steps in BPM, I have observed that an invalid XML will some times result in a error in BPM execution. In particular, if you have switch steps, container operation steps and/or correlations where you use a particular field of that message, it may throw some exception when you have an invalid xml. Also, I have observed some errors with conditional receiver determination for invalid messages.
    As a best practice, if you have any kind of dependency on a particular message inside your system (like switches, container operations, correlations, condition in receiver or interface determination etc), it is a good idea to implement a schema validation.
    Also, if you do want to create a thrustable scenario, you might want to perform schema validation for all your output messages.
    Regards,
    Henrique.

  • PI message mapping 1 to many

    Hello,
    Is there a way to easily perform the following mapping in ESR (graphical tool)?
    Source:
    <ShipFrom>CUST01</ShipFrom>
    <ShipTo>CUST02</ShipTo>
    Destination:
    <Party>
         <RoleCode>Z1</RoleCode>
         <InternalID>CUST01</InternalID>
    </Party>
    <Party>
         <RoleCode>Z2</RoleCode>
         <InternalID>CUST02</InternalID>
    </Party>
    Party has occurence 0..unbounded.
    RoleCode Z1 and Z2 are constants.
    Thank you in advance for your help,
    Guillaume

    Hi Guillaume
    If RoleCode Z1 and Z2 are constants, you can just duplicate subtree for target Party segment and map directly 1 to 1.
    Party = blank constant
    RoleCode = Z1
    InternalID = ShipFrom
    Duplicate another subtree for Party
    Party = blank constant
    RoleCode = Z2
    InternalID = ShipTo
    Rgds
    Eng Swee

  • Message mapping 2D structure

    Please excuse me, this seems to be a very simple issue but being resonably new to message mapping I am having issues solving it.
    Ok each field maps to a repeating structure in the target IDOC, I ahve duplicated the subtree in the Structure and mapped each of the fields.
    _Source_                    _Desired_                                      _Actual_
    <header>                    <header>                                          <header>           
      <line1>                     <line1>                                           <line1>
         <Field1>                    <Field1>                                           <Field1>
         <Field2>     Message        <Field2>                                           <Field2>
         <Field3>       Mapping       <Field3>                                          <Field3>
       <line2>           ------>   <line2>                                               <Field4>
         <Field4>                      <Field4>                                         <Field5>
         <Field5>                      <Field5>                                         <Field6>   
         <Field6>                      <Field6>                                     <line2>
    Each lineNode has been mapped across, and the FieldNode's have been mapped to the line as well. I have had to map the lineNode to the fieldNode as well as I am duplicating the subtree for the fieldNode which is 1..N range.
    My issue is all the fields are mapping into the first node and not maintaining their structure. The value in the fields is coming through correctly in the repeating structure but the node itself is misplaced.

    Thought it was solved ... it isnt...
    To clafiry...
    There are fields in the incoming structure that map into Nodes in the target structure ...
    So Field1 in Line1 .... will actually become Field1Node in the target. To add addition complexity the target node is a repeating node, so used the copt subtree feature but I think it is loosing context.
    So...
    <lineNode1>    -
    > <lineNode1>
        <field1>      -
    >     <FieldNode1>
                                                               <field1 value>
                                                               <field1 constant> --- provided by PI
        <field2>     -
    >    <FieldNode2>
    and so on .... basically the fields in the originating message and creating a bunch of nodes in the user exit, With some small constants to hardcoded in PI to add context to the value in the field.
    A real example ...
    <saleLine1>                                             <saleLine1>
    <saleValue>100</saleValue>                                 <userExitGenericNode>
    </saleLine1>                                                    <Value>100</Value>
                                                                     <ID>SaleValue</ID>
                                                                </userExitGenericNode>
                                                            </saleLine1>

  • Message mapping - Map 2 source contexts into one target context

    Hi,
    I have an issue as follows:
    Source context 1 (defined as 1.....unbounded)
    Source context 2 (defined as 1.....unbounded)
    Target context 1 (defined as 1.....unbounded)
    I need to map both source contexts into the single target contexts.
    For example....
    Source context 1 has 3 entries
    Source context 2 has 2 entries
    Target context would have 5 entries in total (Source context 1 and Source context 2)
    I have only limited knowledge of working with multiple contexts so need a bit of advice.
    Can someone provide an easy way to do this ? I'm sure there is.
    Cheers
    Colin.

    The answer is quite simple.
    Right-click on the target node in the mapping editor and select the option "duplicate subtree".
    You will then have two destination nodes.
    Now you can map source1 to target1 and source2 to target2

Maybe you are looking for