Recursive structure - complex mapping issue

I have a recursive structure involved mapping requirement. here is the issue simplified...
Source is a details about person which has a element called father which itself is of the type person. Target is just a list or person with n father attribute. Target has to have all the persons, father and father's father with no limitation. Below are the XSDs and XML for source and target. I know I can do this in java or abap mapping or even xslt, but is it possible to achieve this in the mapping too? Any help will be appreciated and rewarded.
No where in the forum or blog I could find a sample mapping.
<b>Sorry for the long post</b>
Thanks
<b>Source XML</b>
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PersonsMT xmlns:ns0="http://xyz.com/scratchpad">
   <Persons>
      <Person>
         <Name>Smith</Name>
         <Height>22</Height>
         <Father>
            <Name>Paul</Name>
            <Height>23</Height>
            <Father>
                   <Name>Sr Paul</Name>
                   <Height>23</Height>
            <Father/>
         </Father>
         </Father>
      </Person>
      <Person>
         <Name>Brad</Name>
         <Height>22</Height>
         <Father>
            <Name>Luke</Name>
            <Height>23</Height>
            <Father/>
         </Father>
      </Person>
   </Persons>
</ns0:PersonsMT>
<b>Expected output:</b>
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PersonsListOutputMT xmlns:ns0="http://xyz.com/scratchpad">
<Persons>
     <Person>
          <Name>Smith</Name>
          <Height>22</Height>
     </Person>
     <Person>
          <Name>Paul</Name>
          <Height>23</Height>
     </Person>
     <Person>
          <Name>Sr Paul</Name>
          <Height>23</Height>
     </Person>
     <Person>
          <Name>Brad</Name>
          <Height>22</Height>
     </Person>
     <Person>
          <Name>Luke</Name>
          <Height>23</Height>
     </Person>
</Persons>
</ns0:PersonsListOutputMT>
<b>Source Schema:</b>
<i>Message Type: PersonsMT</i>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xyz.com/scratchpad" targetNamespace="http://xyz.com/scratchpad">
     <xsd:element name="PersonsMT" type="PersonsDT" />
     <xsd:complexType name="PersonDT">
          <xsd:annotation>
               <xsd:appinfo source="http://sap.com/xi/TextID">
               34bfd3107ba111dcc4e600188b447e47
               </xsd:appinfo>
          </xsd:annotation>
          <xsd:sequence>
               <xsd:element name="Name" type="xsd:string">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         56bf53607b7d11dca285000f1ffb32b9
                         </xsd:appinfo>
                    </xsd:annotation>
               </xsd:element>
               <xsd:element name="Height" type="xsd:string">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         56bf53617b7d11dcc38a000f1ffb32b9
                         </xsd:appinfo>
                    </xsd:annotation>
               </xsd:element>
               <xsd:element name="Father" type="PersonDT">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         56bf53627b7d11dccc3d000f1ffb32b9
                         </xsd:appinfo>
                    </xsd:annotation>
               </xsd:element>
          </xsd:sequence>
     </xsd:complexType>
     <xsd:complexType name="PersonsDT">
          <xsd:annotation>
               <xsd:appinfo source="http://sap.com/xi/TextID">
               34bd89227ba111dcc2fa00188b447e47
               </xsd:appinfo>
          </xsd:annotation>
          <xsd:sequence>
               <xsd:element name="Persons" maxOccurs="unbounded">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         9915e6707b7d11dcadc7000f1ffb32b9
                         </xsd:appinfo>
                    </xsd:annotation>
                    <xsd:complexType>
                         <xsd:sequence>
                              <xsd:element name="Person" type="PersonDT">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        9915e6717b7d11dc8f84000f1ffb32b9
                                        </xsd:appinfo>
                                   </xsd:annotation>
                              </xsd:element>
                         </xsd:sequence>
                    </xsd:complexType>
               </xsd:element>
          </xsd:sequence>
     </xsd:complexType>
</xsd:schema>
<b>Target Schema:</b>
<i>Message Type: PersonsListOutputMT</i>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xyz.com/scratchpad" targetNamespace="http://xyz.com/scratchpad">
     <xsd:element name="PersonsListOutputMT" type="PersonListOutputDT" />
     <xsd:complexType name="PersonListOutputDT">
          <xsd:annotation>
               <xsd:appinfo source="http://sap.com/xi/TextID">
               380defd37ba511dcb27400188b447e47
               </xsd:appinfo>
          </xsd:annotation>
          <xsd:sequence>
               <xsd:element name="Persons" maxOccurs="unbounded">
                    <xsd:annotation>
                         <xsd:appinfo source="http://sap.com/xi/TextID">
                         edfc5ae07b9e11dca41b001422795f21
                         </xsd:appinfo>
                    </xsd:annotation>
                    <xsd:complexType>
                         <xsd:sequence>
                              <xsd:element name="Person">
                                   <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">
                                        edfc5ae17b9e11dcb186001422795f21
                                        </xsd:appinfo>
                                   </xsd:annotation>
                                   <xsd:complexType>
                                        <xsd:sequence>
                                             <xsd:element name="Name">
                                                  <xsd:annotation>
                                                       <xsd:appinfo source="http://sap.com/xi/TextID">
                                                       edfc5ae27b9e11dc9e93001422795f21
                                                       </xsd:appinfo>
                                                  </xsd:annotation>
                                             </xsd:element>
                                             <xsd:element name="Height">
                                                  <xsd:annotation>
                                                       <xsd:appinfo source="http://sap.com/xi/TextID">
                                                       edfc5ae37b9e11dcb5e1001422795f21
                                                       </xsd:appinfo>
                                                  </xsd:annotation>
                                             </xsd:element>
                                        </xsd:sequence>
                                   </xsd:complexType>
                              </xsd:element>
                         </xsd:sequence>
                    </xsd:complexType>
               </xsd:element>
          </xsd:sequence>
     </xsd:complexType>
</xsd:schema>
Message was edited by:
        xi_ted
Message was edited by:
        xi_ted

Hi,
Can you please cheack your generated source and target WSDL. According to me, you need some modification in that. You can generate xd using xmlspy.
context will be the problem in graphical mapping as well as xslt. So best is to go for java mapping for this.
In graphical mapping you can generate required target provided you know max hirarchy for father. In that case its possible to use graphical mapping.
-Kavita

Similar Messages

  • Expand Recursive Structure .. Error

    Hi
    I am doing Mapping from XSD to the IDOC .. in the XSD they are Repeating the Sturucture .. that forms the Recursive Structure when i imported the XSD in to PI ..
    I have to get the Values the from the Recursive Structure .. when i expand the Recursive Structure and Mapped .. and when i saved the its giving error
    The source structure, target structure, or a function library has been changed or could not be found in the Enterprise Services Repository. The mapping definition contains elements or attributes that do not exist in the changed structure, or functions that were changed in a function library. The relevant entries will be deleted.
    Node with path /QRY/QRY/QRY/ROW/Units not found in source structure..
    any suggestions .

    even if it is repeating structure, make the node's maxoccurance as unbounded... that will take care

  • Complex mapping with deep structure

    Hi all,
    I need to create a complex mapping as follows:
    Source message:
    CreateOrder (0..1)
    -sell-order (0..1)
    --items-sell-order (0..1)
    ---items-sell-request (0..unbounded)
    sell-discount (0..1)
    sell-discount (0..unbounded)
    discount-id (0..1)
    discount-quantity (0..1)
    description (0..1)
    Target message:
    MT_xxxx
    -ORDER_V3 (0..1)
    --TDESC (0..1)
    ---item (0..unbounded)
    ITEM_NUMBER (0..1)
    discount (0..unbounded)
    REASON (0..1)
    VALUE (0..1)
    DESCRIPTION (0..1)
    --TPLUGIN (0..1)
    ---item (0..unbounded)
    ITEM_NUMBER (0..1)
    discount (0..unbounded)
    ID (0..1)
    QUANTITY (0..1)
    The mapping has some rules:
    If sell-order - items-sell-order - items-sell-request - sell-discount - sell-discount - discount-id .length > 0 then the structure TPLUGIN must be filled
    else
      the structure TDESC must be filled
    The problem is: the field ITEM_NUMBER is an index that is unique and must increment each record of node items-sell-request, and it is not mandatory an item to have discounts.
    When I test with n items and all items with discount node, it works perfect. However, if I put for example 10 items in the source array, and for example the records 5 and 6 doesn't have discounts, the association item x discount makes the mapping get lost and mess all the target nodes.
    Could anyone help me?
    Thanks in advance.
    Ricardo.

    Hi Luis,
    An example for source message could be something like:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CreateOrder>
       <ns0:sell-order>
          <ns1:items-sell-order>
             <ns1:items-sell-request>
                <ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>1</ns1:discount-id>
                      <ns1:discount-quantity>10</ns1:discount-quantity>
                      <ns1:description>Description1</ns1:description>
                   </ns1:sell-discount>
                <ns1:sell-discount>
                      <ns1:discount-id>2</ns1:discount-id>
                      <ns1:discount-quantity>20</ns1:discount-quantity>
                      <ns1:description>Description2</ns1:description>
                   </ns1:sell-discount>
                </ns1:sell-discount>
             </ns1:items-sell-request>
          <ns1:items-sell-request>
                    *other fields not mentioned here, without sell-discount node*
             </ns1:items-sell-request>
               <ns1:items-sell-request>
                <ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>A</ns1:discount-id>
                      <ns1:discount-quantity>50</ns1:discount-quantity>
                      <ns1:description>DescriptionA</ns1:description>
                   </ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>B</ns1:discount-id>
                      <ns1:discount-quantity>100</ns1:discount-quantity>
                      <ns1:description>DescriptionB</ns1:description>
                   </ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>C</ns1:discount-id>
                      <ns1:discount-quantity>200</ns1:discount-quantity>
                      <ns1:description>DescriptionC</ns1:description>
                   </ns1:sell-discount>
                </ns1:sell-discount>
             </ns1:items-sell-request>
               <ns1:items-sell-request>
                <ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>I</ns1:discount-id>
                      <ns1:discount-quantity>400</ns1:discount-quantity>
                      <ns1:description>DescriptionI</ns1:description>
                   </ns1:sell-discount>
                   <ns1:sell-discount>
                      <ns1:discount-id>II</ns1:discount-id>
                      <ns1:discount-quantity>500</ns1:discount-quantity>
                      <ns1:description>DescriptionII</ns1:description>
                   </ns1:sell-discount>
                </ns1:sell-discount>
             </ns1:items-sell-request>
          </ns1:items-sell-order>
       </ns0:sell-order>
    </ns0:CreateOrder>
    And an example for target message related to this source is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:MT_xxxx">
    <ORDER_V3>
         <TDESC>
              <item>
                   <ITEM_NUMBER>4</ITEM_NUMBER>
                   <discount>
                        <REASON>I</REASON>
                        <VALUE>400</VALUE>
                        <DESCRIPTION>DescriptionI</DESCRIPTION>
                   </discount>
              </item>
         </TDESC>
         <TPLUGIN>
              <item>
                   <ITEM_NUMBER>1</ITEM_NUMBER>
                   <discount>
                        <ID>1</ID>
                        <QUANTITY>10</QUANTITY>
                   </discount>
                   <discount>
                        <ID>2</ID>
                        <QUANTITY>20</QUANTITY>
                   </discount>
              </item>
              <item>
                   <ITEM_NUMBER>3</ITEM_NUMBER>
                   <discount>
                        <ID>A</ID>
                        <QUANTITY>50</QUANTITY>
                   </discount>
                   <discount>
                        <ID>B</ID>
                        <QUANTITY>100</QUANTITY>
                   </discount>
                   <discount>
                        <ID>C</ID>
                        <QUANTITY>200</QUANTITY>
                   </discount>
              </item>
         </TPLUGIN>
    </ORDER_V3>
    </ns2:MT_GerarOrdVd_req>
    Edited by: Ricardo Guedes on Oct 20, 2011 3:03 AM

  • XSLT mapping issue in parent child relation

    Hi Guys,
    i have one XSLT mapping issue. Mapping scenario is from IDoc to file.
    IDoc structure is as below
    <ZLOIPRO1>
      <E1AFKOL>
         <A></A>
         <B></B>
         <E1RESBL>
             <MATNR>1</MATNR>
             <CHARG>1</CHARG>
             <ZSBL>
                 <MTART>ABC</MTART>
             </ZSB>
         </E1RESBL>
         <E1RESBL>
             <MATNR>2</MATNR>
             <CHARG>2</CHARG>
             <ZSBL>
                 <MTART>ZHA1</MTART>
             </ZSB>
         </E1RESBL>
         <E1RESBL>
             <MATNR>3</MATNR>
             <CHARG>3</CHARG>
             <ZSBL>
                 <MTART>ZHA1</MTART>
             </ZSB>
         </E1RESBL>
      </E1AFKOL>
    </ZLOIPRO1>
    As you can see 'E1RESBL' is repeatative. Now my issue is i need to select 'MATNR' and 'CHARG' from 'E1RESBL' segment when first occurance of 'ZSBL/MTART' with value 'ZHA1' appears. i.e. my output would be MATNR = 2 and CHARG = 2.
    I hope i am clear. Please let me know if any solution for this.

    Hi,
    Try this
    <xsl:if test="./ZSBL/MTART == 'ZHA1'">
    <xsl:for-each select="./E1RESBL">
      <MATNR>
       <xsl:value-of select="./MATNR"/>
      </MATNR>
      <BATCH>
       <xsl:value-of select="./CHARG"/>
      </BATCH>
    </xsl:for-each>
    </xsl:if>
    You might need to do some changes in the above.
    Thanks,
    Prakash

  • Mapping issue in idoc to JDBC scenario

    mapping issue in idoc to JDBC scenario
    source structure
    E1KNB1M
      BUKRS = 1000
    E1KNB1M
      BUKRS=  9000
    E1KNB1M
      BUKRS=  2000
    THE NODE E1KNB1M is repeated many times and the field BUKRS is also repeated with E1KNB1M as above
    TARGET field : ISFRANCHISE
    if any where value of BUKRS =9000 we have to pass Y to the target filed, else N
    if BUKRS = 9000   THEN ISFRANCHISE= Y
                   ELSE
                ISFRANCHISE=N
    I've done the mapping as below
    BUKRS = 9000--> IF THEN Y ELSE N--
    > ISFRANCHISE
    BUT everry time the target value is N only
    pl suggest
    rgds
    mojib

    mapped like this
    BUKRS--->SORT---->
                                                 EQUALS --------IF---THEN    Y
    9000------------------------>                                               ----------------->ISFRANCHISE
                                                                  ELSE   N
    context of BUKRS set to parent node
    its worked
    thanks to all for valuable suggestions
    rgds
    mojib

  • Mapping issue with context again

    I again need help with a mapping issue. I don’t know how to handle the contexts to get this working in the xi graphical mapping tool.  I have previously logged a question regarding this structure but the requirements have now changed. 
    I have a source document that has multiple delivery line items and for each delivery line item, there are multiple handling units. Each handling unit contains the line number of the delivery line item it belongs to. This structure has been simplified below.
    <b><u>Source Sample</u></b>
    <DOCUMENT>
    <DELIVERY_LINEITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </DELIVERY_LINEITEM >
    <DELIVERY_LINEITEM >
    <LINENUMBER>20</LINENUMBER>
    <MATERIAL>mat 2</MATERIAL>
    </DELIVERY_LINEITEM >
    <HANDLING_UNITS>
    <HU_LABEL>123</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>10</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    <HANDLING_UNITS>
    <HU_LABEL>456</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>10</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    <HANDLING_UNITS>
    <HU_LABEL>789</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>20</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    </DOCUMENT>
    <u><b>Source Structure</b></u>
    DOCUMENT 1..1
    DELIVERY_LINEITEM 1..unbounded
    LINENUMBER 1..1
    MATERIAL 1..1
    HANDLING_UNITS 1..unbounded
    HU_LABEL 1..1
    HU_ITEM 1..1
    LINENUMBER 1..1
    In the target structure, I need to output each handling unit along with the corresponding DELIVERY_LINEITEM material.  Target structure has been simplified below:
    <u><b>Target Sample</b></u>
    <DOCUMENT>
    <ROW>
    <PACKAGING>
    <HU_LABEL>123</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    <ROW>
    <PACKAGING>
    <HU_LABEL>456</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    <ROW>
    <PACKAGING>
    <HU_LABEL>789</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>20</LINENUMBER>
    <MATERIAL>mat 2</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    </DOCUMENT>
    <u><b>Target Structure</b></u>
    DOCUMENT 1..1
    ROW 1..unbounded    
    PACKAGING 1...1
    HU_LABEL 1..1
    PACKAGING_ITEM 1..1
    LINENUMBER 1..1
    MATERIAL 1..1
    Note, 1 ROW in the target structure = 1 HANDLING_UNITS from the source structure.
    Can anyone help me to achieve this? I do not know how to map the relevant DELIVERY_LINEITEM\MATERIAL from the source structure to the target structure.

    JM,
    Please find the solution. Reply back if it helps or not
    http://www.flickr.com/photo_zoom.gne?id=1045178998&size=o
    http://www.flickr.com/photo_zoom.gne?id=1045179010&size=o
    http://www.flickr.com/photo_zoom.gne?id=1045179022&size=o
    Results :http://www.flickr.com/photo_zoom.gne?id=1045179134&size=o
    <b>Code used:</b>
    for(int j=0;j<Handling_Linenum.length;j++)
    for(int k=0;k<Delivery_Linenum.length;k++)
    if(Handling_Linenum[j].equals(Delivery_Linenum[k]))
    result.addValue(""Material[k]"");
    result.addContextChange();
    Best regards,
    raj.

  • XI IDoc complex mapping problem - help needed!

    Hi all,
    I am mapping WPUBON IDoc (sent as IDoc XML file) to WPUBON IDoc in R/3. However, I have a complex mapping requirement that I am trying to use the graphical tool for.
    Source segment structure is such that we have:
    E1WPB01 (header) has one or many E1WPB02 (items) and E1WPB05 (coupons).
    E1WPB02 (items) have one or many E1WPB03 (item conditions).
    So for each IDoc, we can have many items (E1WPB02), each item can have many conditions (E1WPB03) and each IDoc can have many coupons (E1WPB05).
    For each E1WPB05 received, we need to take the value and divide it proportionately in order to add an extra E1WPB03 discount condition segment to each E1WPB02 item (we are a retailer and this will allow us to break down customer coupon discounts across each item in the basket). For example, if we have 2 E1WPB02 items with values $2 and $3 and the coupon is worth $1, item 1 needs a new E1WPB03 segment with a value of $0.40 and item 2 needs one with a value of $0.60.
    This process needs to occur for each E1WPB05 segment (customers could have more than one coupon). No E1WPB05 segments are required in the target IDoc.
    I have tried a few things but really am a bit stuck on where to start.... any ideas anyone?
    Thankyou.
    Stuart Richards

    Stefan,
    Here's some sample source XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <WPUBON01>
       <IDOC>
          <EDI_DC40>
             <TABNAM>EDI_DC40</TABNAM>
             <MANDT>104</MANDT>
             <DOCNUM/>
             <DOCREL>620</DOCREL>
             <DIRECT>2</DIRECT>
             <IDOCTYP>WPUBON01</IDOCTYP>
             <MESTYP>WPUBON</MESTYP>
             <MESCOD>ST6</MESCOD>
             <SNDPOR>WPUX</SNDPOR>
             <SNDPRT>KU</SNDPRT>
             <SNDPRN>0799</SNDPRN>
             <RCVPOR>SAPRD1</RCVPOR>
             <RCVPRT>KU</RCVPRT>
             <RCVPRN>0799</RCVPRN>
             <REFINT>00000000000016</REFINT>
          </EDI_DC40>
          <E1WPB01 SEGMENT="1">
             <POSKREIS>0001</POSKREIS>
             <KASSID>1</KASSID>
             <VORGDATUM>20060107</VORGDATUM>
             <VORGZEIT>134512</VORGZEIT>
             <BONNUMMER>120572</BONNUMMER>
             <KASSIERER>4400</KASSIERER>
             <CSHNAME> </CSHNAME>
             <BELEGWAERS>GBP</BELEGWAERS>
             <E1WPB02 SEGMENT="2">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394436881</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="3">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>10.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
             </E1WPB02>
             <E1WPB02 SEGMENT="5">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394471158</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="6">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>20.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
             </E1WPB02>
             <E1WPB02 SEGMENT="8">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394469131</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="9">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>30.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
             </E1WPB02>
             <E1WPB05 SEGMENT="11">
                <VORZEICHEN>+</VORZEICHEN>
                <RABATTART>PTCS</RABATTART>
                <RABVALUE>6.00</RABVALUE>
             </E1WPB05>
             <E1WPB06 SEGMENT="11">
                <VORZEICHEN>+</VORZEICHEN>
                <ZAHLART>PTCS</ZAHLART>
                <SUMME>10.00</SUMME>
                <KARTENNR/>
                <ZUONR>120572</ZUONR>
             </E1WPB06>
          </E1WPB01>
       </IDOC>
    </WPUBON01>
    So we have one coupon worth $6.00. We have 3 items in the basket worth $10, $20 and $30 respectively. The additional E1WPB03 for each will need to contain $1, $2 and $3 respectively to give:
    <?xml version="1.0" encoding="UTF-8"?>
    <WPUBON01>
       <IDOC>
          <EDI_DC40>
             <TABNAM>EDI_DC40</TABNAM>
             <MANDT>104</MANDT>
             <DOCNUM/>
             <DOCREL>620</DOCREL>
             <DIRECT>2</DIRECT>
             <IDOCTYP>WPUBON01</IDOCTYP>
             <MESTYP>WPUBON</MESTYP>
             <MESCOD>ST6</MESCOD>
             <SNDPOR>WPUX</SNDPOR>
             <SNDPRT>KU</SNDPRT>
             <SNDPRN>0799</SNDPRN>
             <RCVPOR>SAPRD1</RCVPOR>
             <RCVPRT>KU</RCVPRT>
             <RCVPRN>0799</RCVPRN>
             <REFINT>00000000000016</REFINT>
          </EDI_DC40>
          <E1WPB01 SEGMENT="1">
             <POSKREIS>0001</POSKREIS>
             <KASSID>1</KASSID>
             <VORGDATUM>20060107</VORGDATUM>
             <VORGZEIT>134512</VORGZEIT>
             <BONNUMMER>120572</BONNUMMER>
             <KASSIERER>4400</KASSIERER>
             <CSHNAME> </CSHNAME>
             <BELEGWAERS>GBP</BELEGWAERS>
             <E1WPB02 SEGMENT="2">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394436881</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="3">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>10.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
    <b>           <E1WPB03 SEGMENT="9">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>1.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03></b>
             </E1WPB02>
             <E1WPB02 SEGMENT="5">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394471158</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="6">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>20.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
    <b>           <E1WPB03 SEGMENT="9">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>2.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03></b>
             </E1WPB02>
             <E1WPB02 SEGMENT="8">
                <VORGANGART/>
                <QUALARTNR>ARTN</QUALARTNR>
                <ARTNR>000005034394469131</ARTNR>
                <VORZEICHEN>-</VORZEICHEN>
                <MENGE>1</MENGE>
                <REFBONNR> </REFBONNR>
                <E1WPB03 SEGMENT="9">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>30.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03>
    <b>           <E1WPB03 SEGMENT="9">
                   <VORZEICHEN/>
                   <KONDITION>PN10</KONDITION>
                   <KONDVALUE>3.00</KONDVALUE>
                   <CONDID/>
                   <QUALCONDID/>
                </E1WPB03></b>
             </E1WPB02>
             <E1WPB06 SEGMENT="11">
                <VORZEICHEN>+</VORZEICHEN>
                <ZAHLART>PTCS</ZAHLART>
                <SUMME>10.00</SUMME>
                <KARTENNR/>
                <ZUONR>120572</ZUONR>
             </E1WPB06>
          </E1WPB01>
       </IDOC>
    </WPUBON01>
    The 3 new segments required are highlighted in bold. Note that coupon segment can be repeating but is not required in the target message.
    Cheers

  • Mapping issue: link related items together based on a key

    Hi guys,
    I have a mapping issue.
    I have a source structure like this:
    <ad>
      <key>
      <value1>
    </ad>
    <ad>
      <key2>
      <value2>
    </ad>
    <bx>
      <key>
      <value3>
    </bx>
    <bx>
      <key2>
      <value4>
    </bx>
    <bx>
      <key2>
      <value5>
    </bx>
    I need to get this:
    <kitem>
      <value1>
      <bx>
        <value3>
      </bx>
    </kitem>
    <kitem>
      <value2>
      <bx>
        <value4>
        <value5>
      </bx>
    </kitem>
    Any idea, how to achieve this?
    Thanks,
    Olian
    Edited by: Olian Saludew on Aug 4, 2009 12:08 PM

    Hi,
    See the following mapping image:
    [http://www.imagenonline.com/img_a162827.gif|http://www.imagenonline.com/img_a162827.gif]
    Regards
    Ivan

  • N:M mapping issue

    Hello, can any1 please help me with following mapping issue?
    Input Msg Type 1 (Items to be grouped)
    Item (0..n)
       X  (0..1)
       Y (0..1)
       Z  (0..1)
       SegmentSub1 (0..n)
          a (0..1)
          b (0..1)
          ChildSegmentWithChilds (0..n)
              a (0..1)
              b (0..1)
              AnotherChildSegmentWithChilds (0..n)
         a (0..1)
         b (0..1)
       SegmentSub2 (0..n)
           a (0..1)
           b (0..1)
    Input Msg Type 2 (GroupingCodes)
    Group (0..n)
        Code (0..1)
    Output Msg Type (Items Grouped by Group codes)
    GroupedItems (0..n)
      Items (0..n)
         X  (0..1)
         Y (0..1)
         Z  (0..1)
         SegmentSub1 (0..n)
            a (0..1)
            b (0..1)
            ChildSegmentWithChilds (0..n)
                a (0..1)
                b (0..1)
                AnotherChildSegmentWithChilds (0..n)
               a (0..1)
           b (0..1)
         SegmentSub2 (0..n)
             a (0..1)
             b (0..1)
    Mapping logic should be as following;
    Item/X = Group/Code. (Items grouping by "X" field for each "Code" value)
    any help greatly appreciated,
    Thanks!

    Okan,
    Did you got the solution for  this mapping, I'm really sorry for the past one week I was trying to figure it out, finally today I got it, yahoo!!!! I think am bit slow <b>:-(</b>
      If you got the solution already no probes, if you haven't kindly follow the below logic.
    <b><i>Source & Target structure</i></b>
    http://www.flickr.com/photos/8764045@N06/545133789/
    <b><i>Mapping logic & UDF - Grouped Items</i></b>
    http://www.flickr.com/photos/8764045@N06/545133791/
    http://www.flickr.com/photos/8764045@N06/545133801/
    <b><i>Mapping logic & UDF - Item</i></b>
    http://www.flickr.com/photos/8764045@N06/545133807/
    http://www.flickr.com/photos/8764045@N06/545133811/
    <b><i>Mapping logic & UDF - x node</i></b>
    http://www.flickr.com/photos/8764045@N06/545138911/
    http://www.flickr.com/photos/8764045@N06/545138913/
    <b><i>Mapping logic & UDF - y node</i></b>
    http://www.flickr.com/photos/8764045@N06/545138915/
    http://www.flickr.com/photos/8764045@N06/545138917/
    <b><i>Mapping logic & UDF - z node</i></b>
    http://www.flickr.com/photos/8764045@N06/545138947/
    http://www.flickr.com/photos/8764045@N06/545138951/
    <b><i>Mapping - Results</i></b>
    http://www.flickr.com/photos/8764045@N06/545005958/
    I hope it helps you!!!!
    Thanks for the patience.
    Best regards,
    raj.

  • Context with counter mapping issue

    I need help with a mapping issue.
    I have a source document that has multiple line items which in turn contains multiple item texts.  This structure has been simplified below.
    Source Sample
    <DOCUMENT>
    ---<LINEITEM>
    <ITEMFIELD>itemfield</ITEMFIELD>
    <ITEMTEXTS>
    <TEXT>text 1</TEXT>
    </ITEMTEXTS>
    <ITEMTEXTS>
    <TEXT>text 2</TEXT>
    </ITEMTEXTS>
    ---</LINEITEM>
    </DOCUMENT>
    Source Structure
    DOCUMENT 1..1
    LINEITEM 0..unbounded
    ITEMFIELD  0..1
    ITEMTEXTS 0..unbounded
    In the target structure, I need to output each line item with a counter to represent the line item number.  Also, I need to output each item text with the line item number it corresponds to:
    Target Sample
    <DOCUMENT>
    ---<LINEITEM>
    <ITEMNUMBER>1</ITEMNUMBER>
    <ITEMFIELD>itemfield</ITEMFIELD>
    ---</LINEITEM>
    ---<ITEMTEXTS>
    <ITEMNUMBER>1</ITEMNUMBER>
    <TEXT>text 1</TEXT>
    ---</ITEMTEXTS>
    ---<ITEMTEXTS>
    <ITEMNUMBER>1</ITEMNUMBER>
    <TEXT>text 2</TEXT>
    ---</ITEMTEXTS>
    </DOCUMENT>
    Target Structure
    DOCUMENT 1..1
    LINEITEM 0..unbounded
    ITEMNUMBER 1...1
    ITEMFIELD 0..1
    ITEMTEXTS 0..unbounded
    ITEMNUMBER 1..1
    TEXT 1..1
    I do not know how to match the ITEMNUMBER in the ITEMTEXTS target structure with the corresponding LINEITEM target structure.  Can anyone help me with this?
    Regards,
    JM

    James,
    I've tried both 1.2 release and 2.0 (v20091121-r5847) but received the same result - empty Map.
    Moreover, for both versions the following string was absent in deployed XML file:
    +<direct-key-field table="PARAM_SESS" name="PARAM_NAME" xsi:type="column"/>+
    Therefore, on application initialization I have got an exception: org.eclipse.persistence.exceptions.DescriptorException with message This descriptor contains a mapping with a DirectMapMapping and no key field set.
    So I was forced to add the line manually.
    This seems buggy to me...
    Regards,
    Alexey

  • Recursive Structure

    Hi,
    I need to generate target recursive structure dynamically. When I right click on recursive node (In message mapping), it gives me option "Expand Recursive Structure". But how to achieve this dynamically (run time)?
    Any help would be appreciated.
    Thanks
    Sagar

    For Ex: A message structure ‘City’ (Type: CityType) again contains a node ‘City’ with type ‘CityType’. So here ‘City’ node is recursive node.
    In the message mapping, XI gives option of Expanding Recursive Structure (at design time). But how to achieve this dynamically?

  • EA4500 – Smart Wi-Fi interface and Windows Network Map issues

    I purchased this Router about 2 weeks ago as a phased upgrade of our Home Network, primarily to enhance media streaming. It has the latest firmware preinstalled from the factory. Prior to the purchase and installation of the EA4500 Router I replaced my old Motorola SurfBoard SB6120 DOCSIS 3.0 Cable Modem with a Motorola SurfBoard SB6141 DOCSIS 3.0 Cable Modem. My old Linksys E2000 Router worked perfectly with the SB6141, with the exception that the E2000 wasn’t IPv6 enabled, but does have 10/100/1000Base-T Ethernet (RJ-45) and Internet ports.
    The EA4500 has been installed for about 10 days and seems to have improved local network speeds and I don’t seem to be having any Internet connectivity issues. However, there are some disturbing issues with the EA4500 and the AE3000 I purchased. There are 11 devices connected through the Router; a Dell Desktop (wireless with the AE3000), a Dell Desktop (Ethernet), a Dell Laptop (wireless), 2 Canon Printers (1 Ethernet and 1 Wireless), 2 Western Digital 1TB MyBookLive Network Drives (both Ethernet), a WD TV Live Streaming Media Player (wireless), an Apple TV media player (wireless), an iPad (wireless), and an Android Smartphone (wireless).
    Issue 1 – The Linksys Smart Wi-Fi interface appears to be unreliable at times!!! I’ve read about this problem here on the Community involving the EA6500, so I don’t know if this is a Linksys Server issue, as suggested in a few responses, or a bug in the Router firmware, or defective hardware. However, when the interface locks up, it can’t be accessed from a wireless or wired connection. Usually, powering down the Router and then powering it back up and restart will allow it to function again. However, at times before the interface completely locks up it shows either just a white screen or the security screen will show no firewall features enabled. This is a little scary, so I’ll do a complete reset and setup; this is becoming a pain in the rear!!!!! Is there any hope for this being fixed, in this Router, not the next generation??????????
    Issue 2 - All of my network devices show up in the Router’s Device List. Except for the Apple devices they also show up, when they are online, in Windows 7 Explorer under Network and when you click on Network they are correctly displayed as Computers, Media Devices, Network Infrastructure, or Storage. However, when you click on “Open Network and Sharing Center” and then click on “See Full Map”; it fails with the response “Windows cannot create the network map. Responses from other devices on the network are delayed or there is an incompatible router on the network”; no device map is shown. When I follow the link for more information, the only thing that stands out is “A device on the network, such as a hub or switch, is not working properly or is not compatible with the Link Layer Topology Discovery (LLTD) protocol, which Windows uses to create the map. To fix this problem, disable the device, turn it off, or remove it from your network”. All of my network devices showed up on the Network Map with the old E2000. This issue is the same on all of my computers, either wired or wireless. Any known solutions for this, or is it as Windows suggests; an incompatible Router????
    Thanks in advance for any insight or solutions. With the issues I’m having with the EA4500 and the AE3000; they are both probably going back to Amazon.

    thebluemamba_24; Thank you for your suggestion; I finally found time yesterday to perform an extensive evaluation before I return the Router. However, rather than trying to add devices manually, my rationale was if the EA4500 can’t process them correctly, automatically, it needs to be returned anyway, so I added devices normally letting the device an Router handle the process.
    In thinking through this issue, all devices on our network are detected and identified by Windows Explorer on Windows 7 computers; except of course the Apple and Android devices (Apple TV, iPad, and Smartphone). So, I wondered if one of those three devices being added to the Router’s device list was somehow causing issues or interfering with Windows 7’s ability to generate a Network Map. Therefore, my approach was to turn off or disable all devices on our network, reset the Router to factory defaults, reestablish the Router to my custom Home Network configuration using a Windows 7 PC that has LAN and Wireless access to the Router, then add one device at a time and check with each addition to see if Windows 7 could still generate a Network Map.
    With the Router reset and reestablishment complete; I began the process of adding one device at a time and checking to see if a Network Map was being generated. What I discovered was when a recent addition to the network, a Western Digital WD TV Live Streaming Media Player, was connected (wirelessly), Windows 7 could no longer generate the Network Map and the failure was consistent. The only way to get the Network Map to work again was to remove power from the WD TV Live, although it remained in the EA4500’s Device List; simply turning it off didn’t help. Since I’d originally witnessed the Windows 7 Network Map working with the Linksys E2000 Router that the EA4500 replaced, I decided to test the WD TV Live with that Router. It worked initially, but it failed consistently after the first success. Interestingly, the failure indication was a little different, but nevertheless generation of the Network Map failed.
    I’ve tried changing a few settings on the EA4500 as well as the WD TV Live, but nothing helped. There was a recent firmware update to the WD TV Live, so I might try rolling back the firmware to see if it makes a difference.
    The Network Map issue might very well be an issue with the WD TV Live, not the Router, but after reading many threads on this Community I have reservations that the problems I’m experiencing with the Smart interface lockup will be fixed. I suspect new emerging replacement products will be the focus and these older products will be abandoned and no more firmware fixes will be forthcoming and I don’t want to spend more money for a new product just to fix old problems and get something that works properly. The Network Map issue is troublesome, but the lockup of the Router’s “Linksys Smart Wi-Fi” interface is a serious matter to me. It appears that once it locks up, the only way to correct it is a power off restart; not practical if you’re traveling and trying to access settings remotely; the selling point for this feature.
    Given the problems I’m experiencing with the EA4500 and AE3000, I guess I’ll return them. Too bad, because otherwise the EA4500 seems like it’s a good Router. I’ve been brand loyal since the Linksys WRT54G came out, but after reading this Community and with my personal experience with the EA4500 and AE3000, now I’ll probably give the NETGEAR N900 equivalents a try.

  • Credit memo and MAP issue

    Hello Guru's
    I have 2 issues, and i am unable to understand the system logic for the same
    Issue 1:-
    We have an Intercomapny scenario
    sequence of transaction is as follows
    1. Create Return purchase order (document type NB) - Intercompany purchase
    2. Post return goods receipts - movement type 161
    3. Post credit memo with respect to return purchase order
    4. Cancel the movement type 161 - using 161 movement type
    System allows me to cancel the document created using 161 movement type
    Step 4 should not be allowed but system is allowing me to do so, please advise how to stop this
    Issue 2:-
    I have a strange MAP issues which is flactuating very drastically
    the scenario is as follows
    Store stock is 10 ea, stock value is 1000, MAP is 100
    DC map is 25
    When we make return STO from store to DC, ths stocks are issued at DC MAP (condition type P101)
    Assume we issue 9 quantity from Store then
    Store stock is 9 ea, stock value is (1000-(25*9)) =  775, MAP is 775/1 = 775
    This transaction is causing major flactuation in store MAP (100 changed to 775)
    Please advise if there is any way we can control this behaviour
    I understand that there is a setting which will in case of major MAP changes will put the amount into PRD account.
    Appreciate if you can guide me to help
    Regards
    Amit

    Hi,
    For your first scenario,
    for a retun po of IC NB type, after creating the PO you  need to deliver the same at VL10G. For the delivery system will allow to create the PGR . Prior to these steps you need to return the goods using 161 at MIGO.Please check this 161 stock posted to stock in transit.After PGR system will clear the stock in transit.
    Now after claring the stock from transit try cancelling the MIGO 161 document.
    For the second query,
    Please review your question' When we make return STO from store to DC, ths stocks are issued at DC MAP (condition type P101)
    Assume we issue 9 quantity from Store then
    Store stock is 9 ea, stock value is (1000-(25*9)) = 775, MAP is 775/1 = 775
    This transaction is causing major flactuation in store MAP (100 changed to 775),
    Please review the third line.
    Regards,

  • Mapping issue - if value matches on of several conditions

    Hi champs,
    I have a mapping in PI 7.1 of an invoice-xml  to a INVOIC02-idoc.
    I am mapping the invoice sums to E1EDS01-segments and just want to map five of several qualifiers. So I have set up a mapping for the qualifier field SUMID that just maps those five qualifiers, and map the SUMME-field from inbound message as it is.
    Now it shows that our vendors send more than those five qualifiers I have in my mapping. Since I don´t have any control of the SUMME-field all seven values get mapped into the Idoc (generating seven E1EDS01-segments), but only the five segments with my mapped SUMID get the SUMID-field. So I get in total seven E1EDS01 segments in which I get only the SUMME in two of them.
    So my question is: Are there any pretty ways to handle this kind of mapping issues besides using a lot of equalS, if and or?
    I would like to be able to say (in as simple a function as possible)  that if qualifier in field A is X, Y or Z then map the value in field B to SUMME. How do I do that? BTW I am not a java-programmer so advanced java-codes are not a good way for me to handle it.
    regards,
    Glenn

    Write an UDF with this code:
    public void <UDFNAME>(String <FieldName>,Container container){
    If (<FieldName> == "X" || <FieldName> == "Y" || <FieldName> == "Z"){
    return <FieldName>;
    Edited by: spantaleoni on Mar 16, 2011 4:04 PM

  • Multi mapping issue

    Hi ,
         I am using a multi mapping(with out bpm) in my scenario. One source structure is mapped to 3 different targets and these 3 different targets are using 3 different adapters.
      There will be a indicator from the source structure which descriminates all the 3 targets.
      How can I restrict the XI to send only to one target based on indicator in the source structure?
    EX: If the indicator in the source structure is 1000 then I want to send this message to only one target specified in the mapping.
    So my problem arises where in, because we are using multimapping 1:n, if I trigger a message in the proxy it will be sending to all the 3 targets. I don't want this.
    Appreciate your help on this.
    Thanks
    bpr

    HI
    You need to have 3 different channels for 3 receivers with receiver agreement for all three.
    Go to Receiver determination and under configured receivers you can specify condition you want.
    If the indicator in the source structure is 1000 then I want to send this message to only one target specified in the mapping.
    select the left operand as indicator field from source type
    = as Op
    right side is 1000
    Against this configure the receiver you want to send data.
    Thanks
    Gaurav

Maybe you are looking for

  • Windows 7 Enterprise to Windows 8.1 upgrade consumer edition

    Hi, It might be a silly question but I'd like to know if it's possible to upgrade from a Windows 7 Enterprise computer to a Windows 8.1 consumer license. I mean the regular not the Pro edition. I am currently running  W7 Enterprise 64Bit and I bought

  • Not able to update the CMS

    Hi Experts, I have been trying to access the CMS and trying to click on the "update CMS" or "Save Domain" buttons. Then i am getting the following error. Please let me know how to rectify this error. SLD (URL http://127.0.0.1:50100) server exception:

  • Smart Forms -  Page Break

    Hi, I have a Created smartforms with 10 PURCHASE ORDER  and  i Want TO PRINT ONLY 5 IN EACH PAGE..    I WANT TO CREATE a page break . how to do it..? , Give me the Sample Code . Regards Vel

  • Working with both aliases and redirection

    Hi, Working with an OS X Server Tiger 10.4.4. Hostname is 'osxserver' in domain 'beicip.fr'. I have a LDAP user named 'gardais'. Mails to this user are redirected to an external mail box. When I send a mail to [email protected], I get the mail in the

  • ICloud support for .pdf file format

    Help mentions iCloud supports .pdf file formats, but then does not show anything about how to get one of these files onto iCloud.  Since the pdf files I have were never created by one of the supported Application how does one place or retrieve a pdf