Complex mapping scenerio.

Hi Experts,
                        in my scenerio, in the Interface mapping, data from source reaches target through 3 stages. 2 XSL mapping, and then a graphical mapping.
In my scenerio, file is picked from FTP and posted to SAP through RFC .
   In the sender File Adapter, I have to go for the FILE CONTENT Conversion. But In the interface mapping,  data first enters the two  XSL mappimgs and then the graphical mapping.
  Now I dont understand hw to maintain the CONTENT CONVERSION mandatory parameters, becasue if I do so on the basis of the Graphical mapping source fields, that wont be correct, as data firsts passes through the 2 XSLT mappings, and then reaches the Graphical mapping.
I got the following errors in the communication channel.
Conversion initialization failed: java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'ROOT.fieldFixedLengths' or 'ROOT.fieldSeparator' is missing Mandatory parameter 'ROOT.fieldNames': no value found.
I donno hw to handle this.
Also , mine is a .DAT file, I dont understand how can i send it for drytesting and see hw is the load reacting to the FIRST XSL mapping, I mean is there any way i can check this??
Pls comment.
Regards,
Arnab.

Hi, did as u instructed, used the standard templete : GMTLogSenderFileChannelTemplate. The Interface Mappig used here is: GMTLog2POSDM.
Now I am getting the following error:
15:33:27 Start of test
Call XSLT processor with stylsheet GMTLog2IXRetailPOSLog.xsl.
TransfromerException during XSLT processing:
javax.xml.transform.TransformerException: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1429 at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:255) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150) at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81) at com.sap.aii.ibrep.server.mapping.ibrun.RepSequenceMapping.execute(RepSequenceMapping.java:54) at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80) at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127) at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.transform(MapServiceRemoteObjectImpl0_0.java:167) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:104) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:215) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1429 at com.sap.engine.lib.xsl.xpath.DTM.getAttributeAndNSNodes(DTM.java:406) at com.sap.engine.lib.xsl.xslt.XSLCopyOf.copyElementNode(XSLCopyOf.java:70) at com.sap.engine.lib.xsl.xslt.XSLCopyOf.copyNode(XSLCopyOf.java:151) at com.sap.engine.lib.xsl.xslt.XSLCopyOf.process(XSLCopyOf.java:214) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLForEach.process(XSLForEach.java:116) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLForEach.process(XSLForEach.java:116) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:281) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.callTemplate(XSLStylesheet.java:1355) at com.sap.engine.lib.xsl.xslt.XSLCallTemplate.process(XSLCallTemplate.java:111) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:281) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.callTemplate(XSLStylesheet.java:1355) at com.sap.engine.lib.xsl.xslt.XSLCallTemplate.process(XSLCallTemplate.java:111) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLIf.process(XSLIf.java:32) at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296) at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:281) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:469) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:437) at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:412) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:244) ... 19 more
15:33:28 End of test
Pls comment.
Regards,
Arnab.

Similar Messages

  • 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

  • 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

  • Explain a complex mapping in informatica(interview question)

    Hi Deepak, Complex mapping examples I can give you here SCD type 2 can be called as a complex mapping.Doing a mapping through indirect method can be a complex mapping. It depends on your experience. How much experience you are having. Regards,DJ

    explain a complex mapping in informatica(interview question)can any one explan with a complex example  thank you all in advance

  • Help Required COMPLEX  MAPPING !!!!! POINTS WILL BE GIVEN !!

    Hii I am doing a file sender config and my message is something like this
    C1TN4028260000PP345700210 2620582 005 0000000000000072020061802 000000000000000000
    C2TN402826000000001037331742557076 0000071641086338975600000110230000394007
    C3TN4028260000000010000071641086338975600097BP 0005 00000000030000000000
    here the C1, C2, C3 are unbounded it is explained below
    This is only a part of the Payload............
    my Datatype format is
    OCCURANCES
    <Data_DT>
    <Record> 1
    <Header> 0..1
    There are many fields....
    </Header>
    <Control_1> 0...unbounded, this is the C1 record
    There are many fields....
    </Control_1>
    <Control_2> 0...unbounded, this is the C2 record
    There are many fields....
    </Control_2>
    <Control_3> 0...unbounded, this is the C3 record
    There are many fields....
    </Control_3>
    <Line> 0..1
    There are many fields....
    </Line>
    </Record>
    Only write E1EDL37 segment if subsequent "C3" record contains C3_Data(This is one of the fields in Segment Control_3) > 0.  If C2_Num = C3_Num, then only one E1EDL37 segment needs to be written for this "C2" record.  If C2_NUM <> C3_NUM, then one E1EDL37 segment has to be written for the C2 record and one has to be written for the C3_NUM for the C3 record.  In this case one E1EDL44 segment must be written with each unique C2_NUM.
    This is a standard Idoc,
    Part of the structure,
    E1EDL37   unbounded
           E1EDL44   unbounded, its in item level of E1EDL37

    Hai,
      <b>Only write E1EDL37 segment if subsequent "C3" record contains C3_Data(This is one of the fields in Segment Control_3) > 0.</b>
      In message mapping  choose <u><b>arithematic options</b></u> like if-else and compare ur data record with the condition and do mapping accordingly.
    <b>If C2_Num = C3_Num, then only one E1EDL37 segment needs to be written for this "C2" record.</b>
      Take if-else operator in  Graphical mapping and compare both C2_NUM and C3_NUM and if true map C2_Num to E1EDL37.
    <b> If C2_NUM <> C3_NUM, then one E1EDL37 segment has to be written for the C2 record and one has to be written for the C3_NUM for the C3 record. In this case one E1EDL44 segment must be written with each unique C2_NUM.</b>
      check for condition C2_NUM <> C3_NUM using if-else operator and if true map corresponding C2 record to E1EDL37  and if false map corresponding C3_NUM to required segment.
      To write E1EDL44 segment for unique C2_NUM....check the flds of C2 record with each other for uniqueness and map the corresponding unique C2_NUM to each E1EDL44.
    I hope this will help u to get through ur mapping.
    Cheers,
    Prasanthi.

  • Complex Mapping :-Help Required

    Hi All,
    I have a scenario XI--IDoc.
    Sender structure is having one field as Description which will carry some informatiom.I have to read the Summary Field and if I get XAA1:686,XAA2:767 or XAA3:876 like this  inside this  inside this field than I have substring  and take those value individually than we have to map it accordingly.
    You can consider all these value will come separated by ,(comma) and based of the sbustring we have to map it.
    Thanks,
    Rakhi

    1) Pattern p = Pattern.compile("\\b([X][A-Z]{2}[0-9][:][0-9]{3})\\b");
    we made a regular expression here and compiled it and then we make a object of class Matcher to match this compiled regex with our string
    Matcher m = p.matcher(str);
    //then we traverse through the results given to us my this matcher in an array form that is a array constituted by the different values that match this regex.....we traverse this array (m.find()) until this condition is true.....
    then we add the result into the display queue.
    while (m.find())
        String s = m.group(1);
        result.addValue(s);
    (\\b is actually \b to include this \(escape character) i had used two \\
    this is the real regex
    \b([X][A-Z]{2}[0-9][:][0-9]{3})\b
    \b means a seprator between words it can be anything tab or whitespace or new line
    () we use these brackets to mark a word or a unit here this XAA8:456 is a unit so we put the reg ex for this inside braces
    [X] single value mentioned means that it searches for only the single X character
    the very next [A-Z]{2} means that it searches for any character in range A-Z and this rule searches for combination of two letters that follow this rule it means that it searches for two characters together following this i.e adjacent like DF, GY if you think that you want to further drill down your pattern and you will always have AA you can replace this [A-Z]{2} by [A]{2} so it searches for XAA
    now the next thing should be a digit  so we have 0-9 if you dont specify {3} or any number in curly braces it assumes that you are searching for a single character
    then [0-9]{3} digits in the end.....
    use this site if you want to learn regex you can test your regex here
    http://regexr.com/#
    working on your next req

  • Complex mapping in xi 3.0

    Hello all,
    I have some difficulty to make a mapping from the IDoc DESDAV.DELVRY03 to a standard structure for EDI.
    My structure of Idoc is :
    E1EDL37
       vhart
       exidv
       E1EDL44
           exidv
    E1EDL37-VHART allow us to know if it's a pallet or an item
    E1EDL44-EXIDV  allow us to know the item number we have to match with E1EDL37-EXIDV
    My output standart structure is :
    Seg1 (shipment)
    Seg2 (Order)
    Seg3 (Pallet)
    Seg4 (Item)
    My problem is that Seg3 and Seg4 are at same hierarchical level ! So it gives for me :
    Seg1
    Seg2
    Seg3
        Pallet 1
        Pallet 2
    Seg4
        Item 1
        Item 2
        Item 3
    also that my client  wants the structure like this:
    Seg1
    Seg2
    Seg3
       Pallet1
    Seg4
       Item 1
    Seg3
       Pallet2
    Seg4
       Item 2
       Item 3
    he doesn't want to modify the standard output so how can i have this result ??? Is it possible in graphical mapping ?
    The goal is to have the pallet with their own item in the output structure.
    Thanks by advance
    Edited by: Jean-Philippe PAIN on Jul 5, 2008 10:49 PM
    Edited by: Jean-Philippe PAIN on Jul 5, 2008 10:54 PM
    Edited by: Jean-Philippe PAIN on Jul 5, 2008 10:54 PM

    Down by java mapping

  • Challenge with a quite complex mapping

    I have the following 3 different situations
    1-
    <idoc>
    <header>
    <E1ED24 >
                        <POSNR>000001</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
                        <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                          <QTY>200</QTY>
                      </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    2 -
    <idoc>
    <header>
    <E1ED24 >
                        <POSNR>000001</POSNR>
              <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
              <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                  <QTY>100</QTY>     
                      </E1EDL44>
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                         <QTY>200</QTY>
                     </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    3-
    <idoc>
    <header>
    <E1ED24 >
                        <POSNR>000001</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
                       <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                         <QTY>50</QTY>
                      </E1EDL44>
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                          <QTY>50</QTY>
                     </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                         <QTY>100</QTY>
                     </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    whenever the <E1EDL37 > <E1EDL44 ><POSNR> is equal  to  <E1ED24 ><POSNR>, then all the segments <E1EDL37 > should follow the idoc with the same PONR of  the segment <E1ED24 > in this case it is 45. it can be more than one PONR and the belonging positions  in each file .
    in the the last situation 2 segment <E1EDL37 > should be created with 2 position each.
    How can write one mapping program that reflects  each situation.
    and help is highly appreciated.
    Thanks.

    Hi Amit
    Thanks for the answer
    I will try to explain as good as I can
    As mentioned I have the following 3 different situations
    This is an Idoc to Idoc scenario
    1 situation -
    <idoc>
    <header>
    <E1ED24 >
    <POSNR>000001</POSNR>
    <QTY>100</QTY>
    <E1EDL41>
    <PONR>45</PONR>
    </E1EDL41>
    </E1EDL24>
    <E1ED24 >
    <POSNR>000002</POSNR>
    <QTY>200</QTY>
    <E1EDL41>
    <PONR>45</PONR>
    </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
    <E1EDL44 >
    <POSNR>000001</POSNR>
    <QTY>100</QTY>
    </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
    <E1EDL44 >
    <POSNR>000002</POSNR>
    <QTY>200</QTY>
    </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    I should have one Idoc for <PONR>45</PONR>
    <idoc>
    <header>
    <E1ED24 >
                        <POSNR>000001</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
                        <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                          <QTY>200</QTY>
                      </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    And one Idoc for  <PONR>46</PONR>
    <idoc>
    <header>
    <E1ED24 >
                        <POSNR>000003</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>46</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
                        <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>46</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000004</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000004</POSNR>
                          <QTY>200</QTY>
                      </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    2  siatuation -
    <idoc>
    <header>
      <E1ED24 >
                        <POSNR>000001</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000002</POSNR>
                        <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>45</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                        <POSNR>000003</POSNR>
                        <QTY>100</QTY>
                         <E1EDL41>
                         <PONR>46</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1ED24 >
                       <POSNR>000004</POSNR>
                        <QTY>200</QTY>
                         <E1EDL41>
                         <PONR>46</PONR>
                          </E1EDL41>
    </E1EDL24>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000001</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000002</POSNR>
                          <QTY>200</QTY>
                      </E1EDL44>
    </E1EDL37>
    <E1EDL37 >
                      <E1EDL44 >
                          <POSNR>000003</POSNR>
                          <QTY>100</QTY>
                      </E1EDL44>
                      <E1EDL44 >
                          <POSNR>000004</POSNR>
                          <QTY>200</QTY>
                      </E1EDL44>
    </E1EDL37>
    </header>
    </idoc>
    I should have one Idoc for <PONR>45</PONR> with 2 <E1EDL37 > and 2 positions
    And one Idoc for  <PONR>46</PONR> with only 1 segment <E1EDL37 >  and 2 positions like this
    <E1ED24 >
    <POSNR>000003</POSNR>
    <PONR>46</PONR>
    </E1EDL24>
    <E1ED24 >
    <POSNR>000002</POSNR>
    <PONR>46</PONR>
    </E1EDL24>
    <E1EDL37 >
    <E1EDL44 >
    POSNR>000004</POSNR>
    </E1EDL44>
    <E1EDL44 >
    <POSNR>000004</POSNR>
    </E1EDL44>
    </E1EDL37>
    That is based on PONR ,  a new Idoc should be created  for each new value.
    this part is done by split by value for PONR
    Sorry I will continue with other message

  • 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

  • Complex mapping & database

    Hello
    I need to make a make a map that responds to database values e.g.
    IN B20 I'd have something like =IF(B2=2),(C2),("") then id need the same value in B21 so that is the value was 2 then it would give me C2's value.
    But!! if the value of B2 was less or greater than 2 i'd get an incorrect value.
    Picture shows what it would physically look like in numbers without any values:
    [img]http://www.upload2world.com/pic106/upload2world_1b633.png[/img]
    then if the value of B2 and B3 changes i want it do to this:
    [img]http://www.upload2world.com/pic106/upload2world_1ef6b.png[/img]
    If anyone has any ideas then please reply!!
    would be a massive help as im trying to this on a large scale!
    cheers.

    I apologize but I am unable to understand the logic behind the two screenshots.
    Your shots are here for easier use.
    Yvan KOENIG (from FRANCE jeudi 11 décembre 2008 16:27:00)

  • Complex mapping question (aggregate)

    Hello all,
    For example, i have a xml structure in input :
    <XML Input Structure>
    <Line1>
    <Country> Fr </country>
    <Currency> EUR <Currency>
    <Town> Paris </Town>
    <MT> 10 </MT>
    </Line1>
    <Line2>
    <Country> Fr </country>
    <Currency> EUR <Currency>
    <Town> Paris </Town>
    <MT> 10 </MT>
    </Line2>
    <Line3>
    <Country> USA</country>
    <Currency> DOL <Currency>
    <Town> Chicago </Town>
    <MT> 20 </MT>
    </Line3>
    <Line4>
    <Country> USA</country>
    <Currency> DOL <Currency>
    <Town> Detroit </Town>
    <MT> 20</MT>
    </Line4>
    </XML Input Structure>
    In output, i want to aggregate the field "MT" only  when fields "Country, Currency and Town" are the same in order to have something like that :
    <XML Output Structure>
    <Line1>
    <Country> Fr </country>
    <Currency> EUR <Currency>
    <Town> Paris </Town>
    <MT> 20 </MT>
    </Line1>
    <Line2>
    <Country> USA</country>
    <Currency> DOL <Currency>
    <Town> Chicago </Town>
    <MT> 20 </MT>
    </Line2>
    <Line3>
    <Country> USA</country>
    <Currency> DOL <Currency>
    <Town> Detroit </Town>
    <MT> 20 </MT>
    </Line3>
    </XML Output Structure>
    I am not a specialist in java so i would like to knowi if it's possible to do it with node standard functions ? if not, what is the best solution : XSLT, Java mapping, UDF ?
    Thanks by advance,
    JP
    Edited by: Jean-Philippe PAIN on Dec 16, 2008 12:14 PM

    hi,
    with standard it would be pretty hard
    but with a simple UDF (with 4 inputs) you can aggregate
    and output it quite easily
    try with a udf if you don't want to go for java mapping
    Regards,
    Michal Krawczyk
    http://mypigenie.com XI/PI FAQ

  • Complex Mapping Question

    Hi,
    i have a xml structur like that:
    <root>
         <header>
              <nr>00010</nr>
         </header>
         <header>
              <nr>00102</nr>
         </header>
         <item>
              <nr>00010</nr>
              <value>20</value>
              <wight>60</wight>
         </item>
         <item>
              <nr>00102</nr>
              <value>30</value>
              <wight>30</wight>
         </item>
         <desc>
              <nr>00010</nr>
              <name>Meet</name>
         </desc>
         <desc>
              <nr>00102</nr>
              <name>Apple</name>
         </desc>
    </root>
    and want that it looks like that:
    <root>
         <item>
              <nr>00010</nr>
              <name>Meet</name>
              <value>20</value>
              <wight>60</wight>
         </item>
         <item>
              <nr>00102</nr>
              <name>Apple</name>
              <value>30</value>
              <wight>30</wight>
         </item>
    </root>
    for each header tag in source message it must be a item tag in target message.
    can i handle this with a XSLT Mapping ?
    any Idea?
    for me its looks very difficult to do that in a mapping.
    Regards,
    Robin

    I think you have your source xml wrong. Try getting your source xml structure to be something like below, the reason being you cannot do a loop (for-each) otherwise.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
    <data>
    <header>
    <nr>00010</nr>
    </header>
    <item>
    <nr>00010</nr>
    <value>20</value>
    <wight>60</wight>
    </item>
    <desc>
    <nr>00010</nr>
    <name>Meet</name>
    </desc>
    </data>
    <data>
    <header>
    <nr>00102</nr>
    </header>
    <item>
    <nr>00102</nr>
    <value>30</value>
    <wight>30</wight>
    </item>
    <desc>
    <nr>00102</nr>
    <name>Apple</name>
    </desc>
    </data>
    <data>
    <header>
    <nr>00102</nr>
    </header>
    <item>
    <nr>00102</nr>
    <value>30</value>
    <wight>40</wight>
    </item>
    <desc>
    <nr>00102</nr>
    <name>Apple</name>
    </desc>
    </data>
    </root>
    Now if understood your requirement correctly, you need to club all nr together, and also aggregate (sum) their respective values and wight.
    The XSLT to achieve that is as follows,
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:key name="nr" match="root/data" use="header/nr"/>
    <xsl:template match="/">
    <root>
    <!-- iterate on each group -->
    <xsl:for-each select="root/data[generate-id(.) = generate-id(key('nr', header/nr)[1]) ]">
    <xsl:variable name="group" select="key('nr', header/nr)"/>
    <xsl:variable name="nr">
    <xsl:value-of select="header/nr"/>
    </xsl:variable>
    <xsl:variable name="name">
    <xsl:value-of select="desc/name"/>
    </xsl:variable>
    <xsl:variable name="value">
    <xsl:value-of select="sum($group/item/value)"/>
    </xsl:variable>
    <xsl:variable name="wight">
    <xsl:value-of select="sum($group/item/wight)"/>
    </xsl:variable>
    <!-- Generate the final XML file -->
    <item>
    <nr>
    <xsl:value-of select="$nr"/>
    </nr>
    <name>
    <xsl:value-of select="$name"/>
    </name>
    <value>
    <xsl:value-of select="$value"/>
    </value>
    <wight>
    <xsl:value-of select="$wight"/>
    </wight>
    </item>
    </xsl:for-each>
    </root>
    </xsl:template>
    </xsl:stylesheet>
    Please have a look at my code sample that i have submitted, which speaks of how to handle such a scenario.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/generic xslt mapping in sap xi, part i.pdf
    cheers
    Sameer

  • Complex Mapping - Reset context

    Hi everybody,
    I have to transform one scenary RFC to FILE, but I had many problems becouse the contexts level of each structures is very different.
    In my RFC I have two tables, T_HEADER and T_ITEM like:
    1- RFC
       1.1- T_HEADER
       1.2-T_ITEM
    and in my FILE I have:
    1-FILE
       1.1-Recordset (occor 1 to many)
          1.1.1-T_HEADER (occor 1 to 1)
          1.1.2-T_ITEM (occor 1 to many)
    For each T_HEADER (on RFC) I need one other Recordset (on FILE). And for each T_ITEM (on RFC) I need one other T_ITEM (on FILE) comparing the key field on T_HEADER. In other words I need to group the recordsets by the key founded in both structures, using the header structure as the main structure.
    I need samething like this:
    RFC-T_HEADER
         Key = 1, 2 and 3.
    RFC-T_ITEM
         Key = 1, 2, 1, 3, 3
    Result:
    FILE-Recordset
    FILE-Recordset-T_HEADER
       Key = 1
    FILE-Recordset-T_ITEM
      Key = 1, 1
    FILE-Recordset
    FILE-Recordset-T_HEADER
       Key = 3
    FILE-Recordset-T_ITEM
      Key = 3, 3
    FILE-Recordset
    FILE-Recordset-T_HEADER
       Key = 2
    FILE-Recordset-T_ITEM
      Key = 2
    Do you have many ideas to help me?

    Hi everybody, I found the solution.
    I need use an UDF that I call "changeQueue".
    If anyone will have the same problem, you can use this UDF:
    ->Vnode - String (Context item with the values to check the key and add in diferent queue)
    ->Knode - String (Context header with the key values used to define the queue where the item will be add)
    ->Nnode - String (Context item with the key values to check and add into queue of context header)
    <-result - ResultList (Vnode context into the diferent queue)
    for(int i=0; i < Knode.length; i++){
         if(Knode<i>.equals(ResultList.CC))
              result.addContextChange();
         else{
              for(int j=0; j < Nnode.length; j++){
                   if(Nnode[j] == Knode<i>){
                        result.addValue(Vnode[j]);

  • Complex Mapping

    Hi,
    I've unique requirement. It's a ECC - Idoc to R/2 Idoc scenarion.
    The requirements are :
    At source side I've two fields Vendor_Amt and VAT. At target side Idoc has fixed no of line Items (251)
    Now if Vendor_Amt has more than 7 digits (Including decimals ) then divide them by 2 and check the resulting amount. If the resulting amout is again  >7 digits then divide by 3 and check again..and so on.
    Once this is complete, divide the VAT with the same u201Cdividing factoru201D  used for Vendor_amt.
    same time at target side I have to check If the total no of line items at source side is increased more than 251 then I've to split it into another Idoc structure.
    Please follow this link for the example.
    http://www.freeimagehosting.net/image.php?217543f548.jpg
    Any suggestion appreciated.
    Regards,
    Chintan.
    Edited by: chintan patel on Sep 6, 2008 12:08 AM

    for no. of digit validation you can use UDF.
    and for validation of detail line item  > 251 and break it further either you have to use BPM or put the logic at source system prog.

  • Complex Message Mapping for a Lookup in PI  7.1

    Hi
    I am having difficulty with a complex mapping in PI that I was wondering if someone could help me with.
    The issue is that I am doing a Stock Lookup where you enter an item code and retrun an xml with all the stock for Warehouses, Local regions and Other regions.
    The problem is with the Other Regions. I have done a mapping that produces a new Other Regions node for each store returned...
    <?xml version="1.0" encoding="UTF-8"?>
    <StockLookupResponse><Header><SessionID>Constant</SessionID></Header>
    <OtherRegions><Region>Dunedin</Region><Stores><Branch>5115</Branch><Description>222 Waterloo Road</Description><StockLevel><AllocatedStock>2</AllocatedStock></StockLevel></Stores></OtherRegions>
    <OtherRegions><Region>Dunedin</Region><Stores><Branch>5117</Branch><Description>1 Waterloo Road Dunedin</Description><StockLevel><AllocatedStock>26</AllocatedStock</StockLevel></Stores></OtherRegions>
    <OtherRegions><Region>Christchurch</Region><Stores><Branch>5222</Branch><StockLevel><AllocatedStock>27</AllocatedStock></StockLevel></Stores></OtherRegions>
    </StockLookupResponse>
    What I need to do is create a single OtherRegions node for each region and then show the stores within this region like this
    <?xml version="1.0" encoding="UTF-8"?>
    <StockLookupResponse><Header><SessionID>Constant</SessionID></Header>
    <OtherRegions><Region>Dunedin</Region>
    <Stores><Branch>5115</Branch><Description>222 Waterloo Road Dunedin</Description><StockLevel><AllocatedStock>2</AllocatedStock></StockLevel></Stores>
    <Stores><Branch>5117</Branch><Description>1 Waterloo Road Dunedin</Description><StockLevel><AllocatedStock>26</AllocatedStock</StockLevel></Stores>
    </OtherRegions>
    <OtherRegions><Region>Christchurch</Region><Stores><Branch>5222</Branch><StockLevel><AllocatedStock>27</AllocatedStock></StockLevel></Stores></OtherRegions>
    </StockLookupResponse>
    I have successfully created the OtherRegions node for each region but I only ever get one store return for each region. No matter what I do I cannot seem to get the full list of stores.
    The sample XML coming in is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:StockLookup_JDBC_response xmlns:ns0="urn:bridgestone:bpcs:logistics">
       <StoredProceedureSelect_response>
          <response_1>
             <row>
                <ITEM_CODE>484855A</ITEM_CODE>
                <RECORD_TYPE>O</RECORD_TYPE>
                <REGION_CODE>2</REGION_CODE>           
                <STORE_ID>5115</STORE_ID>           
                <LOCATION_CODE/>           
                <ON_HAND>555</ON_HAND>           
             </row>
             <row>
                <ITEM_CODE>484855A</ITEM_CODE>
                <RECORD_TYPE>O</RECORD_TYPE>
                <REGION_CODE>2</REGION_CODE>
                <STORE_ID>5117</STORE_ID>
                <WHS_FLAG>0</WHS_FLAG>
                <ON_HAND>6</ON_HAND>
             </row>
             <row>
                <ITEM_CODE>484855A</ITEM_CODE>
                <RECORD_TYPE>O</RECORD_TYPE>
                <REGION_CODE>6</REGION_CODE>
                <STORE_ID>5222</STORE_ID>
                <LOCATION_CODE/>
                <ON_HAND>2</ON_HAND>
             </row>        
          </response_1>
       </StoredProceedureSelect_response>
    </ns0:StockLookup_JDBC_response>
    To get the Other regions to work I passed on the record type and region code into a UDF:
    public void createOtherRegion(String[] recordType, String[] regionCode, ResultList result, Container container) throws StreamTransformationException{
    String prevRegionCode = new String("");
    for (int i = 0; i < recordType.length; i++)
         if (!recordType<i>.equals("O"))
             result.addValue(false);
         else
              if (prevRegionCode.equals(""))
                   result.addValue(true);
                   prevRegionCode = new String (regionCode<i>);
                   else if (prevRegionCode.equals(regionCode<i>))
                        result.addValue(false);
                   else
                        result.addValue(true);
                        prevRegionCode = new String (regionCode<i>);
    This successfully create a new Other region and displays a single store within the region. Unfortunately by trying to map the STORE_ID to the Stores node (1.. unbounded)  only one store is ever returned.
    I have tried changing the context but it will only retrun one store.
    Haas anyone else come across a similar problem? Any help appreciated.

    This problem was resolved by using sort and sortByKey in order to preserve the context. UDF was not helpful in the end.
    I am closing this thread.

Maybe you are looking for

  • Amount of Data

    Hello Friends Can anyone let me know where can I see the amount of data (in bytes) piled up in the PSAs. Thanks Rishi

  • Oracle 10.1.2 app server and toplink 9.0.4.5

    Hi All: I require to migrate from oracle 9041 to oracle 10.1.2. presently I am using toplink 9045 jar file in my application. Do I need to upgrade toplink and jdbc jar files also if I upgrade oracle app server? Please respond. Thanks, Viral

  • Is there a size limit on internal HD? iBook G4 1Ghz

    Recently bought a used 12" iBook G4. Of course no installation discs came with it. When received it had a 30 Gb hard drive, 528 mb RAM, and 10.3.9. I wanted to max out RAM, increase HD size, and move to 10.4.x. (Additional background - I have various

  • SAP ABAP Online Training | Online SAP ABAP Training in usa, uk, Canada, Malaysia, Australia, India, Singapore.

    SAP ABAP (Advanced Business Application Programming) is one of the most sought-after modules of SAP. In accordance with its manifold returns the trend for training of SAP ABAP Online Training  is constantly on a sharp upsurge. In the first phase of t

  • Regarding STO with Delivery

    Hi Experts, I am creating a STO i am getting a shipping tab in the Item Detail but it is showing as SHIPPING IS NOT XXXX ASSIGNED TO SHIPING CONDITION 01 TRANSPORT 0001 AND PLANT xxxx I  MAINTAIND IN CUSTOMISING SHP COND 01 LOADING GRP 0001 PLxxxx BU