N:n mapping of subtrees?

Hi
I need to map a sub-tree that occurs n times on exactly the same sub-tree in another structure (also occurs n times where n1 = n2).
When I test my mapping it only creates the first sub-tree and igonres the rest. Is there anything special that I need to be aware of?
Thanks a lot,
Nana

HI Nana,
<i>*****Now if I map the source wit two <sub2> on the target, I only get one <sub2> structure</i>
You mean to say, you have two Sub2 structures in the Target ??? Like this
<root>
<sub1>[occurs: 1]</sub1>
<sub2>[occurs: 0..unbound]</sub2>
<sub2>[occurs: 0..unbound]</s
<sub2>
What I understood is you have source with 1 sub2 node and you need to generate multiple sub2 node based on the soure occurence. If so try with context change,SPlitBy Value concepts.
Also make sure that your target occurence of sub2 node is 0-unbounded.
Inorder to get the all the field values under sub2 node, you may need to write small user defined function stating that for each values of sub2 , generate all these values of current sub2 node,
Hope this helps.
Regards,
Moorthy

Similar Messages

  • 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

  • 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 UseOneAsMany Map multiply subtree

    Hello,
    I've got following source structure.
    <struct>
       <field>
       </field>
       <field1>
       </field1>
       <field2>
       </field2>
       <field3>
       </field4>
    </struct>
    Is it possible to multiply the complete struct in one mapping or have I to create serveral mappings with "useoneasmany" for each <field*> Tag
    Thanks Christian

    Yes,
    the source structure is following:
    <struct>
       <field>
       </field>
       <field1>
       </field1>
       <field2>
       </field2>
       <field3>
       </field4>
    </struct>
    <table>
         <item>
               <field></field>
               <field></field>
         </item> (occurance 0..unbounded)
    </table>
    this i want to map to following struc
    <line> (0..unbounded)
    <struct>
       <field>
       </field>
       <field1>
       </field1>
       <field2>
       </field2>
       <field3>
       </field4>
    </struct>
    <field></field>
    <field></field>
    </line>
    I hope you understand

  • Mapping node from a different subtree

    Hi Experts,
    I am doing a mapping where the source structure contains two segments LINE and VAT. Under LINE, I have a field called ABC. Also under VAT, I have a field called ABC. What I want to do is, if ABC under LINE is blank then I want to populate the value of ABC under VAT. Any idea how to go about this?
    Thanks,
    Dhawal

    Use ifWithElse & exist function.
    check if ABC from line exists then map it to traget else map ABC of VAT to target.
    oR just use the equalS & NOT function instead of exist function and then check if LINE (ABC) not equalS Blank (empty constant) then map ABC of Line into target else map ABC of VAT to target.

  • Help Need in Graphical Mapping.

    Hi
    Can you do help for mapping between my file structure to BAPI structure..this is auctully  file would call BAPI for 1: N(file having various headers and line items, each header and associated line items would able to call BAPI in target side).
    Now i am just trying to do test using following map...but following error came when i am checking in IM. But when i am doing test this map in MM editor using Duplicate subtree it is working fine.
    <b>ERROR: Mapping program Message Mapping MM_request | urn:testing does not match the interface mapping. The number or frequencies of source or target messages for the message mapping are not identical to the number or frequencies of source or target interfaces.</b>
    I thought some where i made wrong..!but it is difficult to find out for me! i dint find any wrong in my mapping.
    map like this:
    Sourcefilestructure:       TargetBAPI
    Messages (1:1)            Message(1:1)
    Message1(1:1)             Message1(1:1)
      MT_Request(1:1)  
       Recordset(0:U) -->     BAPI_INCOMINGINVOICE(0:U)
        HDR   (0:1)            HeaderData(1:1)
         Filed(0:1)   -->       filed1(0:1)
         Field(0:1)   -->       field2(0:2)  
                    HDR--->   GLACCOUNTDATA(0:1)
         LINEITEM(0:U)--->      item(0:U)    
           field1(0:1) --->       field(0:1)
           field2(0:1) --->       field2(0:1)
    Thanks,
    Regards
    Sankar!
    Message was edited by: Sankar

    Hi,
    You have this error message when inside your Interface Mapping you uses occurences which are NOT these one defined in your Message Mapping.
    In your Message Mapping, look at tab "Message" and keep in mind the occurence.
    Then in your Interface Mapping, do the same action and compare both occurence.
    Mickael
    Message was edited by: Mickael Huchet

  • Multi-Mapping-Programm (1:n)

    Hi,
    I have to make a 1:n Mapping with the graphical mapping editor. The situation is as follows:
    I have 1 ORDER with n positions and I have to convert this order to n ORDERS with 1 position in each order. My problem is, that I have to use the header-data of the input-order for each of the output orders and I have to use the first position of the input-order for the frist output-order the second postition for the second order and so on. Which mapping-steps do I have to use. I think this is an ordnary problem, but I could not find anything in the XI-help about this. Maybe anyon has got an idea. THANKS !!!

    Hello Werner,
    If the number of the E1EDK14 segments is always exactly 4 per IDOC, you may use the duplicate subtree functionality. Therefore you have to place your mouse-pointer on the E1EDK14 segment in your target structure and right-click un your mouse. You'll get a context menu, where you can select duplicate subtree. After having done this three times, you can define the mappings for the 4 E1EDK14 segments independently.
    The <i>useOneAsMany</i> function should work also. But you have to make sure that the queue of the first and the second input field contain the same number of <b>contexts</b>, whereas the second and the third input field have to contain the same number of <b>values</b>.
    Please check the figure on http://help.sap.com/saphelp_nw04s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm
    for details.
    Best regards
    Joachim

  • 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

  • Mapping Problem . or help in UDF

    Hi...
          I am having problem in mapping.
    I am having 3 messages in the source structure and 1 message in the target structure. 3:1 mapping.
    Source Messages:
    Message1: Warehouse Details(plant name,warehouselocation)
    Message2:Supplier Details(suppid,suppname,leadtime,matname,cost)
    Message3:Input(matname,plant,unit,item,itemname,ReqQty,OrderQty,Cost,suppid,suppname,leadtime,date,warehouseloc)
    Target Message:
    Output
    If the Availability field in Message3 !=0, then it should map warehouseloc of message 1 to the Output mesage. or else it should map 0 to the warehouse and map message 2 items to the output message.
    Source messages are 0:unbounded.
    Could you please help me out in this issue. or else can you please tell how to write the userdefined function for that.
    Below is the structure.
    Source Message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
       <ns0:Message1>
          <ns1:getWareHouseDetailsResponse xmlns:ns1="http://DefaultNamespace">
             <getWareHouseDetailsReturn>
                <Plant>
                   <plantName/>
                   <wareHouseLocation>W001</wareHouseLocation>
                </Plant>
             </getWareHouseDetailsReturn>
          </ns1:getWareHouseDetailsResponse>
       </ns0:Message1>
       <ns0:Message2>
          <ns2:GetPreferredSuppliersResponse xmlns:ns2="http://tempuri.org/">
             <ns2:GetPreferredSuppliersResult>
                <ns2:Supplier>
                   <ns2:SupplierId>S001</ns2:SupplierId>
                   <ns2:SupplierName>TRW</ns2:SupplierName>
                   <ns2:LeadTime>1111</ns2:LeadTime>
                   <ns2:MaterialName>M001</ns2:MaterialName>
                   <ns2:Cost>1000</ns2:Cost>
                </ns2:Supplier>
             </ns2:GetPreferredSuppliersResult>
          </ns2:GetPreferredSuppliersResponse>
       </ns0:Message2>
       <ns0:Message3>
          <ns3:MT_Output xmlns:ns3="http://BlockTest">
             <Material>
                <Matname>M001</Matname>
                <Plant>P001</Plant>
                <Unit>KG</Unit>
                <Item/>
                <Itemname/>
                <ReqQty>5</ReqQty>
                <AvailQty>0</AvailQty>
                <Cost/>
                <Suppid/>
                <Supname/>
                <LeadTime/>
                <Date>12.05.2008</Date>
                <OrderQty>0</OrderQty>
                <WarehouseLoc/>
             </Material>
             <Material>
                <Matname>M002</Matname>
                <Plant>P002</Plant>
                <Unit>PC</Unit>
                <Item/>
                <Itemname/>
                <ReqQty>5</ReqQty>
                <AvailQty>5000</AvailQty>
                <Cost/>
                <Suppid/>
                <Supname/>
                <LeadTime/>
                <Date>12.05.2008</Date>
                <OrderQty>0</OrderQty>
                <WarehouseLoc/>
             </Material>
             <Pcost/>
             <Tcost/>
             <Ocost/>
          </ns3:MT_Output>
       </ns0:Message3>
    </ns0:Messages>
    Target Message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    <ns0:Message1>
    <ns3:MT_Output xmlns:ns3="http://BlockTest">
    <Material>M001</Material>
    <Plant>P001</Plant>
    <Unit>KG</Unit>
    <Item></Item>
    <Itemname></Itemname>
    <ReqQty>5</ReqQty>
    <AvailQty>0</AvailQty>
    <Cost>1000</Cost>
    <Suppid>S001</Suppid>
    <Supname>TRW</Supname>
    <LeadTime>1111</LeadTime>
    <Date>12.05.2008</Date>
    <OrderQty>0</OrderQty>
    <WarehouseLoc>0</WarehouseLoc>
    </Material>
    <Material>M002</Material>
    <Plant>P002</Plant>
    <Unit>KG</Unit>
    <Item></Item>
    <Itemname></Itemname>
    <ReqQty>5</ReqQty>
    <AvailQty>0</AvailQty>
    <Cost>1000</Cost>
    <Suppid/>
    <Supname/>
    <LeadTime/>
    <Date>12.05.2008</Date>
    <OrderQty>0</OrderQty>
    <WarehouseLoc>W001</WarehouseLoc>
    </Material>
    </ns3:MT_Output>
    </ns0:Message1>
    </ns0:Messages>
    Edited by: leelaratnam morampudi on Oct 14, 2008 1:13 PM

    I think there is no need to use UDF, you can achive this by using IF function.
    to make your mapping simple, in your message mapping on MT_Output, right click your mouse and click on duplicate subtree. you will now have two structure in your target.
    first one is for if AvailQty != 0 then warehouseloc of message 1 to the Output mesage
    and second one is for if AvailQty = 0 now map 0 to the warehouse and map message 2 items to the output message.
    try this and let us know if you face any issues.

  • Mapping issue with if else

    Src. Structure:
    A (0-unbounded)
       within A-> p
    B (0-unbounded)
      within B-> p
    NOTE: at a given instant either A/B can occur, # of K(Target)should b same as # of A/B
    Target structure
    K(0-unbounded)
        within K---> z(1)
    now i have done A/B -> K mapping,
    question comes when i try to map the p to Z field within K,
    depending on weather A/ B exists i need to map the P in A/B to the Z field in K,
    here is what i have done so far:A/B->K mapping
    A --> exists -->OR createif --> SplitByValue -->K
    B --> exists -->
    for mapping p-> Z (i used if then else function)
    A --> exists -->if then  --> A.p --> K.z
    else-> B.p-> K.z
    Here is the test scenario i am doing:
    I send a test without A's only 3 Bs
    I get 1 K element with 1 z in it.
    the remainder of the elements of B in other contexts don't show up.
    When i do a display queue: for my p->z mapping  at the if-then-else function i can see only 1 output from it though there are 3 p fields, this is because in my K structure z field can occur max only once,
    HOW CAN I HAVE  seperate Z elements, each within different K elements?
    Your help is very much appreciated,  this sounds so complicated i hope not, i m sure im not doing something correct, can some1 help me understand this?
    Thanks,
    Hank

    If you have not got the solution, then consider this logic:
    K is 0..unbounded so in the MM duplicate the subtree for K (so now you will have 2 K nodes)
    A -
    > exists -
    > createIf ---> K  ........K will occur when A node exists in the source...to one of the two K nodes
    To map A.p to K.p
    A.p -
    > K.p  ....... you may need to increase the Context of the A.p node....K.p should be the first K node to which the above exists logic (A exists) is applied.
    B ---> exists ---> createIf ---> K   .........K will occur when B node exists in the source...to second K node
    To map B.p to K.p
    B.p ---> K.p....... you may need to increase the Context of the B.p node....K.p should be the second K node to which the above exists logic (B exists) is applied.
    Regards,
    Abhishek.

  • 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

  • Mapping an XML structure into one field

    Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
    Regards,
    Abhishek.

    Hi,
    Chk this:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Re: Conversion of source XML structure to single string using PI 7.1
    Thanks
    Amit

  • 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

  • Help needed on IDOC segents mapping

    Hi All,
    I have a requirement.
    The scenario is File -- XI -- IDOC  and inside mapping i have a RFC look up.   The file is as below.
    ConractNumber1, line item1 Price, line itm1UOM,etc...
    ConractNumber2, line item2 Price, line itm2UOM,etc...
    ConractNumber3, line item3 Price, line itm3UOM,etc...
    The busniess requiremetnt is as below.
    There is a existing contract data in R3 and for every contract there are line items. In the text file i have existing contract number and some line items. What i need to do is,...  i need to add my line items at the end of the contrat in R3. For this reson.. there is a custum RFC is alreay in place, which takes Contratnumber as in put and returns NEXT AVAILABLE position  to update line item for that contact.
    Here I can write A RFC look up and get Next Availeble Position from RFC into PI mapping.... But my problem is i need to map that value IDOC Segment to look like E1EDK01[NEXT AVAILABLE Poistion].
    I know that we can do this by adding subtree provision in mapping... But is is not dayamic... like if i duplicate sub tree... i will get E1EDK01[1]... But not E1EDK01[54] where 54 is value form RFC lookup.
    Here Text file contains  recrods 1...Infinity..
    ecah and every record contains its own contract data and one line item to be added. next record may contain diffrent contract data or same contract data along with one more line item.
    Kinldy share your thoughts how to go ahead. I want to know how mapping should be done for that partcular idoc segment like E1EDK01[54] where 54 is value form RFC lookup
    Thnx
    Subbu

    Hi,
      I could not understand why you want the next available position to appear with E1EDK01 segment. I think as per your requirment you need to look for a field in IDOC where you can pass the next available position so that while posting the IDOC the Line item is posted at right place.
    Regards,
    Shweta

Maybe you are looking for

  • What happenrd tu our albums and where did a bunch of empty files come from?

    We have recently had problems with iPhoto 4 (See my message there) and tried solving at least some of them by upgrading to '06. The installation seemed to go smoothly and when I received message that a photo library was found and did I want to import

  • Styling items in Site Studio Contributor

    Hello, Similar to the way that contributors can style text by assigning predefined CSS classes through the style drop-down menu in a Site Studio Contributor form, I would also like to give them the ability to style ordered lists and tables (border-ty

  • Saving video as mp4 for use on Web & tablets (including iPad)

    I am looking for clarity in saving my instructional videos to proper the format to be viewed on the web and tablets (including iPads). I save my original recordings on the web as mp4s and link them on the web for viewing. On Premiere the only choices

  • Plant or Storage location ?

    Hello Experts , Here is the scenario, the client i am working with has its material sent to a location in south africa which is basically a 3rd party logistic company ...which distributes the material to different places ...what will be the right way

  • Low Memory (Storage, NOT RAM)

    Since yesterday, my phone (N95) has been erroring at pretty much everything I do, because the onboard memory has run to 0 available. From is, yesterday I had 0 and i deleted some videos totalling 14MB, but this morning those 14MB disappeared, and I'm