Message Mapping RFC structure to deep XML structure

Hello,
I have a message mapping I am struggling with. The outbound interface is an RFC with structure like this:
RFC_send_material
-material (1..unbounded)
--matnr
--meins
--brgew
-description (1..unbounded)
--matnr
--vkorg
--text
The inbound interface should look like this:
Materials_from_SAP
-material (1..unbounded)
--matnr
--meins
--brgew
--description (0..unbounded)
---vkorg
---text
My problem is to get all the description connected to the matnr together.
Examples with data:
Outbound rfc:
<RFC_send_material>
   <material>
      <matnr>100</matnr>
      <meins>c1</code1>
      <brgew>c2</code2>
   </material>
   <material>
      <matnr>101</matnr>
      <meins>c1a</code1>
      <brgew>c2a</code2>
   </material>
   <material>
      <matnr>102</matnr>
      <meins>bv102</code1>
      <brgew>addd102</code2>
   </material>
   <description>
      <matnr>100</matnr>
      <vkorg>NO10</sales_org>
      <text>testing100</text>
   </description>
   <description>
      <matnr>102</matnr>
      <vkorg>SE10</sales_org>
      <text>testing102</text>
   </description>
   <description>
      <matnr>102</matnr>
      <vkorg>DK10</sales_org>
      <text>testing103</text>
   </description>
</RFC_send_material>
The inbound file structure should then look like this:
<Materials_from_SAP>
   <material>
      <matnr>100</matnr>
      <meins>c1</meins>
      <brgew>c2</brgew>
      <description>
         <vkorg>NO10</vkorg>
         <text>testing100</text>
      </description>
   </material>
   <material>
      <matnr>101</matnr>
      <meins>c1a</meins>
      <brgew>c2a</brgew>
   </material>
   <material>
      <matnr>102</matnr>
      <meins>bv102</meins>
      <brgew>addd102</brgew>
      <description>
         <vkorg>SE10</vkorg>
         <text>testing102</text>
      </description>
      <description>
         <vkorg>DK10</sales_org>
         <text>testing103</text>
      </description>
   </material>
</Materials_from_SAP>
So as you see, my problem is to get the correct description belonging to the material. Hope anybody can help with doing this in Message Mapping.
Regards,
Per

Hi PRW,
As Michal said correctly, it is hard to describe in words, so here are some pictures which I think is the solution of your problem.
Description mapping  : http://www.flickr.com/photos/23639237@N02/3220030016/sizes/o/
VKORG mapping      : http://www.flickr.com/photos/23639237@N02/3219181675/sizes/o/
Text  mapping           : http://www.flickr.com/photos/23639237@N02/3219182919/sizes/o/
UDF  CODE             : http://www.flickr.com/photos/23639237@N02/3219184005/sizes/o/
And the Final Reslut : http://www.flickr.com/photos/23639237@N02/3220035356/sizes/o/
Regards,
Sarvesh

Similar Messages

  • How to map a deep xml structure to flat structure

    Hi, I'm trying to map a deep xml structure to a flat file structure. See this:
    <SalesPoint>
             <header>
                  <idTx></idTx>
                  <opCode></opCode>
             </header>
             <body>
              <DataSet>
                   <codOperacion></codOperacion>
                   <codCanalDeVenta></codCanalDeVenta>
                   <cuitDeposito>
                   <docMinorista>
                   <fechaOperacion>
                   <codCC>
                   <Details>
                         <Dato>
                                        <nroSerieEquipo></nroSerieEquipo>
                            <codNMU></codNMU>
                            <codOrigenEquipo></codOrigenEquipo>
                            <codConcepto></codConcepto>
                             <codSegmento></codSegmento>
                            <motivoSiniestro></motivoSiniestro>
                         </Dato>
                   </Details>
              </DataSet>
             </body>
    </SalesPoint>
    to:
    <SalesPoint>
            <idTx></idTx>
            <opCode></opCode>
         <codOperacion></codOperacion>
         <codCanalDeVenta></codCanalDeVenta>
         <cuitDeposito></cuitDeposito>
         <docMinorista></docMinorista>
         <fechaOperacion></fechaOperacion>
         <codCC></codCC>
            <nroSerieEquipo></nroSerieEquipo>
            <codNMU></codNMU>
         <codOrigenEquipo></codOrigenEquipo>
         <codConcepto></codConcepto>
         <codSegmento></codSegmento>
         <motivoSiniestro></motivoSiniestro>
    </SalesPoint>
    Thanks in advance!!!!

    I do not think this is a complex XML structure. All that you need to take care is about the contexts. How ever it is not possible to give u the complete mapping here. If you have tried mapping already and facing some issues.. please put it here.. so that some one can help you.
    VJ

  • Message mapping RFC lookup

    Hi.
    I'm trying to do a RFC inside a message mapping with java code. I have to send a field (id) and return the vendor code (lifnr).
    I'm searching michal Krawczyk's weblog to see how can i do that but the link is broken.
    Does anybody has that document that can send me to [email protected]?
    Regards.
    Inigo.

    hi Inigo,
    please look at the following blogs,
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/michal.krawczyk2/blog/2005/09/15/xi-rfc-mapping-lookups-from-bc-to-xi
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    Regards
    Sreeram.G.Reddy
    Message was edited by:
            Sreeram Reddy

  • Message Mapping: Douplicate Nodes of source XML

    Hi,
    I do some message mapping in the design. I've loaded a test XML into the test tab to actually see what's going on in my mapping. A piece of it looks like the following snippet (the REFERENCE element is also embedded in a whole bunch of other elements and yes, its correct, that AUTHOR and YEAR elements appear nested in themselves):
    <REFERENCE>
      <set>
        <AUTHOR>
          <AUTHOR>Test Author 1</AUTHOR>
        </AUTHOR>
        <YEAR>
          <YEAR>2000</YEAR>
        </YEAR>
      </set>
      <set>
        <AUTHOR>
          <AUTHOR>Test Author 2</AUTHOR>
        </AUTHOR>
        <YEAR>
          <YEAR>2001</YEAR>
        </YEAR>
      </set>
    </REFERENCE>
    I've placed the lowest AUTHOR element in the design pane, I right click it, set the context to "AUTHOR" (the surrounding AUTHOR element obviously), an then click on "Show queue" I get all AUTHOR elements double. I.e. I get "Test Author 1" twice and "Test Author 2" twice.
    Ok, I thought probably something I don't understand concerning contexts, so I added "removeContexts" after the AUTHOR node. Surprise: I get "Test Author 1" once and "Test Author 2" twice when I click on "Show queue" on "removeContexts".
    As this behaviour is getting worse, the more mapping steps I arrange in a chain, the mapping becomes quite useless, until I can resolve this issue...
    Anybody an idea, why my "Test Authors" get listed twice and why "removeContexts" doesn't work as expected?
    Tnx,
    Martin.

    You will see the value in queue twice for AUTHOR because the first one in white is the actual value and the second one in gray is the context change. Similarly when you do remove context and see the queue, you will see TestAuthor1 Test Author2 and again TestAuthor2 which is the context.
    Regards,
    Ravi

  • Message Mapping Help XMLDocument with in XML

    I am trying to pass on some XMLDocument with in XML
    Example
    <Header>
    <Detail><Text1>Text</Text1><Text2>Text</Text2></Detail>
    </Header>
    Message mapping giving error at present. My Message Type has only the following
    <Header>
    <Detail>
    I am trying to include <Text1>Text</Text1><Text2>Text</Text2> with in Detail section. Not sure how to handle this with Message Map. Please explain if there is any possibility to achieve something like this

    Hi,
    You can directly use CDATA in message mapping and can solve this.
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Else you can use xsl mapping as mentioned in this thread:
    Re: CDATA in xml file
    You can also try java mapping as mentioned here:
    XML inside a field in XI
    If you can give complete source payload, source message type and target message type then somebody here can help you out.
    Regards,
    ---Satish

  • Mapping flat xml file to xml Structure

    Hi all,
    i have to map an xml file, wich is incoming via a RFC call in a flat import field, to a xml-Structure. The xml Structure has the same Structure except that it is not flat but even as a xml-Structure in the Repository. Ist ther a way to make a 1:1 - Mapping?
    Regards Mathias

    Hi,
    This can be done very easily using Java Mapping.
    Parse the flat xml String using Dom4j and directly set this as the target structure.
    eg code:
    public void execute(InputStream in, OutputStream out) throws StreamTransformationException{
    String flatXml = "the flat xml string";
    Document doc = DocumentHelper.parseText(flatXml) ;
    out.write(doc.asXML().getBytes());
    Regards,
    P.Venkat

  • Mapping an XML structure into one field

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

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

  • XML structure - mapping one Oracle column to many XML attributes

    Hi,
    I need to insert data into EMP table reading from xml file and this is how the file would look like....
    <?xml version='1.0'?>
    <ROWSET>
    <ROW num="1">
    <EMPLOYEE_ID>7369</EMPLOYEE_ID>
    <LAST_NAME>Smith</LAST_NAME>
    <FIRST_NAME>JOHN</FIRST_NAME>
    <PHONE> 905000123</PHONE>
    <PHONE> 905000456</PHONE>
    <PHONE> 905000789</PHONE> ...... n
    (There could be many phone numbers in the xml file and I need to concatenate all the numbers and insert in the PHONE column of emp table)
    <SALARY>800</SALARY>
    </ROW>
    <!-- additional rows ... -->
    </ROWSET>
    I am new to XML and would to know the set of lines required to read the data from xml and insert into EMP table. All this is for Oracle 10g R2.
    Please let me know solution using XSU if possible.

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

  • Request message mapping giving blank xml message

    I was trying a scenario JDBC-> XI -> RFC for tranporting the db table data from sqlserver to sap r/3.
    At the time of designing the mapping is working correctly.
    But in the pipeline step "Request message mapping" it is generating the inbound message but with any values from outbound source message.
    source message (xml ) structure
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CUST_REQ_MT xmlns:ns0="urn:sqlserver:vendor">
      <row>
        <NAME></NAME>
        <ADDRESS></ADDRESS>
        <AGE></AGE>
        <LOGIN></LOGIN>
        <PASSWORD></PASSWORD>
      </row>
    </ns0:CUST_REQ_MT>
    and target message structure is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ZBAPI_UPDATE_JDBC xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
      <UPDATE>
        <item>
          <NAME></NAME>
          <ADDRESS></ADDRESS>
          <AGE></AGE>
          <LOGIN></LOGIN>
          <PASSWORD></PASSWORD>
        </item>
      </UPDATE>
    </ns0:ZBAPI_UPDATE_JDBC>
    I have used the Graphical mapping tool for mapping these two MT's.
    the payload in the request message mapping step is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:ZBAPI_UPDATE_JDBC xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    - <UPDATE>
      <item />
      </UPDATE>
      </ns0:ZBAPI_UPDATE_JDBC>
    here you can see a blank tag <item/>.
    How can i resolve this issue. I can not see any error anywhere.
    Regards,
    Gopesh

    Hi,
    It is not the issue of the datatype for outbound message for jdbc sender.
    I have done the Graphical mapping and mapped the sourse message type to target message type (which is a rfc xml format request message type).
    But when all the IR and ID objects activated and it comes to Runtime (integration server) then it is unable to execute the mapping in the xi pipeline step "Request Message Mapping" and generating a blank xml element as i have described earlier in my message.
    What should i do or where should i check for the possible reasons and what could be the solution for this issue.
    Regards
    Gopesh

  • Complex swf/xml structure with "donwload updated files" ?

    Hello to all, sorry for my bad english.
    i have a complex structure of swf + xml structure.  something like 200 files..  i was wondering if is it possible to create an air application for install all this package on a client and then check is some file of the structure is updated on the server and then after a user confirmation download and replace those files.
    if is it possible someone could give me guideline for develop this application?
    thank you so much

    AIR doesn't support incremental updates. Any update package is a full install.

  • Message Mapping Issue in PI 7.1

    Hi Experts
    I am working on a Message mapping,  and I have the following structures on the Sender and receiver side
    -->InterfaceHeader
    -->DocumentHeader  (1-Unbounded)
    -->DocumentLineItems (1-Unbounded)
    -->InterfaceTrailer -1
    Same structure on the sender and Receiver, I am sending the data as follows
    -->InterfaceHeader
    -->DocumentHeader1
    -->DocumentlineItems1
    -->DocumentHeader2
    -->DocumentlineItems2
    -->InterfaceTrailer -1
    after mapping I am getting the following results
    -->InterfaceHeader
    -->DocumentHeader1
    -->DocumentHeader2
    -->DocumentlineItems1
    -->DocumentlineItems2
    -->InterfaceTrailer -1
    i.e Header 1 and 2 are coming same and then details are coming, I need the result xml the same way which I have sent.
    find the example payload below, please let me know how can I get the structures in the same order of the sender payload.
    results should be
    -->InterfaceHeader
    -->DocumentHeader1
    -->DocumentlineItems1
    -->DocumentHeader2
    -->DocumentlineItems2
    -->InterfaceTrailer -1
    Thanks
    PR

    Check this blog...you have solution for this
    /people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception

  • UDF for leading zero's in message mapping

    Dear team,
    I need UDF for leading zero's in my message mapping.
    Source and Target both structures contains matnr field.But we have to maintain total 18 chars at target matnr , because RFC in R/3 needed.So I want to add leading zero's when mapping. Can anybody provide the UDF code.
    Matnr[source]--->split by value(eachvalue) ->UDF->Matnr[Target]
    Ex::if source matnr conatains value "9846538" ; I need matnr value at target side like "000000000009846538"[total 18 chars].
    -Drumi

    Hi Ambrish,
    Good day...
    I have enterd what you said and I got below error... and I gave "input" in place of var1, 18 in place of filedlenght in below program...
    =================================
    int len = Integer.parseInt(18);
    int inputLength = input.length();
    try {
    Integer.parseInt(input);
    // If it is an integer, add 0 (len - inputLength) times
    for (int i=0; i< len-inputLength;i++)
        input = "0" + input;
    return input;
    } catch (NumberFormatException numForEx) {
    // return as it is, if alphanumeric
    return input;
    ====================================
    ERROR:
    Source text of object Message Mapping: Lubrisur_SHPMNT_SHPMNT05_TO_WMMBXY_WMMBID02_TransferPosting | urn:bp:xi:dwn:lu:common:Logistics:100 has syntax errors:
    Function LeadingZeros, Line 1:
    cannot find symbol symbol  : method parseInt(int) location: class java.lang.Integer int len = Integer.parseInt(18);                  ^ 1 error
    =======================
    Please suggest

  • PI 7.11: IDoc Message mapping

    Hi there,
    I'm currently working on a graphical message mapping using IDoc HRMD_A06 as source structure (HR master data transferred via PFAL).
    In my result structure I have to fill a field CostCenter with the following logic:
    If field KOSTL (cost center) is filled in node E1P0315, map this field to CostCenter in result structure, otherwise take KOSTL of node E1P0001.
    The end date (ENDDA) has to be '99991231' in each case.
    This is how the result structure looks like:
    <e>                       [1...1]
      <CostCenter>            [1...1]
    </e>
    This is the simplified source structure:
    <E1PLOGI SEGMENT="1">
      <E1PITYP SEGMENT="1">                        [0...n]
         <E1P0001 SEGMENT="1">                     [0...n]
           <INFTY>0001</INFTY>                     [0...1]
           <ENDDA>99991231</ENDDA>                 [0...1]
           <KOSTL>0000012345</KOSTL>               [0...1]
        </E1P0001>
      </E1PITYP>
      <E1PITYP SEGMENT="1">                        [0...n]
        <E1P0315 SEGMENT="1">                      [0...n]
          <INFTY>0315</INFTY>                      [0...1]
          <ENDDA>99991231</ENDDA>                  [0...1]
          <KOSTL>0000024001</KOSTL>                [0...1]
        </E1P0315>
      </E1PITYP>
    </E1PLOGI>
    How can I do the check if field KOSTL of node E1P0315 is null?
    I've tried an existence check for the whole node (E1P0315->exists), but then it fails, because all E1PITYP nodes are processed.
    I hope my problem is clear to you.
    Would it be better to use another mapping type?
    As I'm an ABAP developer, I would of course prefer some lines of code to this graphical drag&drop thing.
    Thanks in advance!

    Cheers, guys!
    I did it now like that:
    http://www.abload.de/image.php?img=mappingflknz.jpg
    Click on the image to enlarge it!
    The logic is as following (ABAP Pseudo-code ):
    IF 0315_KOSTL and 0315_ENDDA are populated.
      IF 0315_ENDDA equals '99991231'.
        map 0315_KOSTL to Cost_Center.
      ENDIF.
    ELSE.
      IF 0001_KOSTL and 0001_ENDDA are populated.
        IF 0001_ENDDA equals '99991231'.
          map 0001_KOSTL to Cost_Center.
        ENDIF.
      ENDIF.
    ENDIF.
    Is that a good way to do that mapping?
    Do I also have to use the removeContexts function or is it ok like that?
    Could I also do that with an ABAP mapping program?
    Thanks in advance!

  • Message Mapping Error : "already dropped from buffer"

    Hi,
    today we have a new strange error in a simple message mapping File2IDoc thats results in SYSFAIL.
    Maybe a buffer or memory error?
    In short:
    +/ARTMAS05/IDOC/E1BPE1MARART[2]/DELN_DATE(suppressed field); root message: Index 2147483647 is already dropped from buffer. Cur offset is 2147483636+
    In detail:
    #2.#2010 08 18 10:49:51:619#+0200#Error#/Applications/ExchangeInfrastructure#
    #BC-XI#com.sap.xi.util.misc#0026557C6A4004B6000000000000120D#229073650000000872#sap.com/com.sap.xi.services#com.sap.aii.ib.server.mapping.execution.JavaMapping#J2EE_GUEST#0#SAP J2EE Engine JTA Transaction : #0A1BAF81AA0111DF82D40026557C6A40#0a1baf81aa0111df82d40026557c6a40#0a1baf81aa0111df82d40026557c6a40#0#output#Java##
    RuntimeException during appliction Java mapping com/sap/xi/tf/_xxxxx_Out_To_ARTMAS_ARTMAS05_A1_
    Thrown:
    com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ARTMAS05/IDOC/E1BPE1MARART[2]/DELN_DATE(suppressed field); root message: Index 2147483647 is already dropped from buffer. Cur offset is 2147483636
    #2.#2010 08 18 10:52:45:149#+0200#Error#/Applications/ExchangeInfrastructure#
    #BC-XI#com.sap.xi.util.misc#0026557C6A4004BA000000000000120D#229073650000000872#sap.com/com.sap.xi.services#com.sap.aii.ib.server.mapping.execution.JavaMapping#J2EE_GUEST#0#SAP J2EE Engine JTA Transaction : #0A1BAF81AA0111DF82D40026557C6A40#0a1baf81aa0111df82d40026557c6a40#0a1baf81aa0111df82d40026557c6a40#0#output#Java##
    RuntimeException during appliction Java mapping com/sap/xi/tf/_xxxxx_Out_To_ARTMAS_ARTMAS05_A1_
    Thrown:
    com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ARTMAS05/IDOC/E1BPE1MARART[2]/DELN_DATE(suppressed field); root message: Index 2147483647 is already dropped from buffer. Cur offset is 2147483636
    Thanks in advance,
    André

    Hi André, did you try to re-create de Message Mapping with the same source/target structures?
    Regards,
    Juan.

  • CreateView (join) question, deep XML PO example

    I'm trying to create a database view that makes the data from the PO example available via SQL. Recall that the PO example has a deep XML structure (header and POLINES) which is parsed into two objects PO and POLINES. PO is a child of PublicObjects, and I've sucessfully created a view on just it. Now I want to have a view that joins the header to the lines. POLINES object is a child of APPLICATIONOBJECT.
    When I try to setup the JoinQualification, I get
    Exception :oracle.ifs.common.IfsException: IFS-22701: PURCHASEORDERLINEITEM is not an alias or className
    oracle.ifs.common.IfsException: IFS-22701: PURCHASEORDERLINEITEM is not an alias or className
    Well gee, I thought it was.
    Help?

    For anyone else trying to do this... I switched to trying to join to the "Rejection" object. The mistake was that I was trying to join PurchaseOrder to Rejection, without including Rejection in the Search:
    scp.addSearchClass("PURCHASEORDERREJECTION");
    null

Maybe you are looking for

  • Its important that all characters display correctly in my pdf.

    When I convert a file to pdf, I always get this error: Cannot extract the embedded font'HWNDJR 83mkhgdligynvro' some characters may not display correctly. What is wrong? Its important that all characters display correctly in my pdf ebook. Please advi

  • Remove the extra space at the end of each page in the report

    Hi, When the RDF report output is seen in notepad, it shows empty lines at the end of each page. Is it possble to avoid these empty lines and display the output without any empty lines. Thanks in advance. Divya

  • The new 600$ mac mini

    I was thinking of buying one for school since it comes with the i5 processor and can use 8GBs of ram think it would be good for running vmware fusion. but I do game lightly on computers I mostly play WOW and portal 1 and 2 would this computer work ok

  • Data transfer from Nokia to iPhone

    How do i copy data from Nokia phone when i move to Iphone4S

  • How to download "purchased" songs that are not in my library

    I pre ordered an album the other day on my Iphone via the itunes store, when it became available to download i was sent an e-mail. Went into the Itunes store to download it, as it had not downloaded automatically (usually does) all the songs in the a