Mapping Items in XML string to multiple IDOC segments

I would like to map an XML tag  <Text>Line1Line2Line3Line4</Text>
to an IDOC segment E1ED1TEXT . Defined as occurring 0 to 999999.
I would like to map each item separated by a tilde into a separate occurence of the IDOC text segment. Is ther anyway to repeat the mapping without duplicating the subtree.
E1ED1TEXT
Text_Id - "ZTXT"
Text_Line = Line1
E1ED1TEXT
Text_Id - "ZTXT"
Text_Line = Line2
E1ED1TEXT
Text_Id - "ZTXT"
Text_Line = Line3

Hello,
This is only possible using UDF
mapping is like this:
Text -> UDF -> splitByValue:eachValue -> Text_Id
UDF is of context type
argument is input
String temp[] = input[0].split("~");
for(int a=0;a<temp.length;a++){
result.addValue(temp[a]);
Hope this helps,
Mark

Similar Messages

  • Generate multiple Idoc segments

    Hi all,
    I have a Flat file to Idoc Scenario.
    I need to generate no. of multiple Idoc Segments based on the source field value.
    For Eg: if Field1 starts with 5 or 6 then E1 segment should be created 5 times,
    similarly if Field1 starts with 4 then E1 segment is created 6 times
    And as many times E1 is created that many times the corresponding other E2,E3 segments are created
    i.e E2 E3 has 1-1 relationship with E1
    Can this be done graphically ?
    Working on PI 7.0 Environment
    I would appreciate your Inputs.
    Regards,
    Varun
    Edited by: Varun Reddy on Oct 5, 2010 8:21 AM

    Im pretty sure that if you duplicate the target segment the max number of times (6) but you only map to 4 of them, only 4 will be created in the target structure. Let the Mapping/Data drive how many segments actually get created in your target structure.
    I could be wrong but Im pretty sure thats how Ive handled repeating segments before.

  • Mapping issue: Split a string to multiple strings in an idoc

    Hi,
    I need to split a string with an undefined length into strings of 132 chars. The problem is, how to map from the source field to the target field,
    which belong to an idoc segment. The segment has the occurence 1 to unbounded, and the field 0 to 1. Simplifying, i need to map one source field split it in 132
    chars block and put the resultant blocks into an idoc field (maxLength = 132).
    IDoc
    Segment X
    Segment (occurence 1..unbounded)
    Field X
    Source field SourceA (undefined length)----->-----Field TargetA (occurence 0..1) (maxLength = 132)
    Segment Y

    Ok...here is one way of achiving what u want - hope ur comfortable with working with context mapping...
    Raise the context of ur source field one level higher and write  a UDF funtionto do this -
    Declare an array list
    Read the source string and append it to the arraylist.
    Then when u map ur target IDOC text...read from this array list and created ...By maintaining the context...there will be as many segments in the idocas there are in the arraylist..
    regards,
    arvind R

  • Concatenating texts from multiple IDoc segments

    Hi everybody!
    I have to concatenate log texts supplied via IDoc segments into one string. There can be zero or more segments, each with one line of the long text. The result should be one single string field filled with all the lines concatenated.
    What's the easiest way to achieve this result? Do I need a user-defined function or can I code this using standard built-in funtions (this solution would be preferred)?
    Regards,
    Joerg

    Use the UDF with the following logic.
    Take the input type as Queue of the Segments
    Concatenate the temp = temp + a<i> in the loop
    return the temp.
    <b>UDF as follows:</b>
    String temp = " ";
    for(int i=0; i< a.lenght; i++)
    temp = temp + a<i>
    return temp;
    Your probelm will solve with the above UDF.
    Warm Regards,
    Vijay

  • How to extract a clob xml string with multiple row of table tag. in 10g

    i have a xml value like:
    <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
    i want to insert each of <c> value in a table with respective columns according c1,c2,c3,c4
    pls suggest me what to do
    I use extract(xml, '/table) tab but it just read first one line & return error for other

    Can you plz explain to me thisIt is because you did not provide us with a valid xml structure so I used 11g's xmlparse function to create a xmltype even with the xml not being valid (no root tag).
    With a valid xml structure I could use the xmltype constructor instead and go on the same way as before:
    SQL> select *
      from xmltable (
             'table'
             passing xmltype ('
                            <root>
                            <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
                            </root>').extract ('root/table')
             columns c1 number path 'c1', c2 varchar2 (4) path 'c2', c3 varchar2 (6) path 'c3', c4 varchar2 (6) path 'c4')
            C1 C2     C3        C4      
             0 Mr     abc       Sharma  
             0 Mrs    abcd      Sharma  
             0 Mr     sabc      Sharma  
             0 Mrs    sdabc     Sharma  
             0 Mr     dabc      Sharma  
             0 Mr     adbc      Sharma  
    6 rows selected.

  • Multiple idoc segment values to field fixed length FCC

    Friends,
    I need help to resolve a mapping issue. here is the brief about the scenario.
    Scenario: IDoc to Flat file Fixed length fields
    Issue: Idocs has values in multiple segments. i need to check condition for each segment occurrence if value exists then pass value if not then pass constant (i have to pass constant so that i can get the actual column width after FCC)
    Iam using the following logic.
    If condition then value1 -> remove contexts -> split by value -> target
    My scenario works fine for the above mapping however when i try introduction a constant in "if then else" then all my contexts in the target structure messes up.
    Thanks for your help.
    Regards,
    Pavan

    Did you tried MapWithDefault before Remove Contexts? To give more perfect solution , we would like to see a sample structure.
    raj.

  • Multiple idoc segments from single flat file

    hi,
    I want to upload data throught LSMW,   in a single row i have many item. can anyone give me idea, how to proceed.
    2.  i have to show a custom error report linked to lsmw.. how to do it..
    waiting for your reply
    Thanks & Regards
    Dinesh

    What object do you need to load?
    What exactly is in the file (what kind of data) ?
    If it is a simple file with few fields, then i think a recording is the fastest methods. It does give you a detailed error log.
    But all this depends on the file you have

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • How to pass item payment term through Idoc segment E1EDP18

    We use ORDERS idoc to create sales orders and our customers want to replace the default payment term at item level. I found segment E1EDP18 for this purpose but I don't exactly know how to use it, like where to put the payment term key. Can any one expain with the help of a clear  example how to indicate the payment term there ?
    Below is a exerpt of the incoming idoc file I used for testing. In this test I put the paymentt term 0010 in but the information sent in idoc segment is just ignored.
    E1EDP01                     10         625.00
        E1EDP05                        ZD64
        E1EDP05                        ZD66
        E1EDP19                     00269020000
        E1EDP18                     0020010
    Many thanks

    Hi,
             SAP program IDOC_INPUT_ORDERS is not using the item level payment terms sent in IDOC segment P18 to fill the sales order so you need user exit to do this. The program is moving the item level information to an internal table xe1edp18 when the data is parsed from IDOC so you can use this to populate the screen information in the user exit 'CALL CUSTOMER-FUNCTION '002' (IDOC_INPUT_ORDERS).
    Let me explain the process from EDI to SAP.
    1) EDI 850 will have ITD segment at item level (Example ITD013  *2     *        *10 *        *30 *          *        *) you can ask your EDI team to map them to P18 segment as it has the number of days and also the percentage for cash discount. P18 has 3 qualifiers so you can map 3 different temrs (For example the above sample is 1 Term is 2% in 10 days and Term 2 is net 30 days)
    2) During IDOC parsing the program is already filling internal table xe1edp18.
    3) In the user exit CUSTOMER-FUNCTION '002' you need to search for the SAP payment terms with the number of days and percentage (This is available in the table T052). Once you find the SAP terms key, you need to populate it for each item. You need to do this after the program filled the item billing data.
    Dynpro item business data billin details -
        PERFORM VA01_DYNPRO_POSITION_PDE3 USING XVBAP-POSNR.
    *-Zusätzliche Daten für Dynpros vorsehen (Kundenerweiterungen)----
    *-additional data's for new dynpro fields (customer exit)----
        SY-SUBRC = 0.
        PERFORM CUSTOMER_FUNCTION_DYNPRO.  -- THis is the user exit call
    Hope this is useful.
    Ram

  • Mapping from File to IDoc with multiple Idocs and multiple line items?

    Hi All,
    Need some help with mapping, requirement as below: I have a flat file with multiple records, need to create multiple idocs per each separate order in flat file with as many line items.
    Order_1 field-1 field-2 field-3 field-4
    Order_1 field-1 field-2 field-3 field-4
    Order_2 field-1 field-2 field-3 field-4
    Order_2 field-1 field-2 field-3 field-4
    Order_3 field-1 field-2 field-3 field-4
    Order_3 field-1 field-2 field-3 field-4
    I have imported IDoc changed to 1:Unbounded, able to create multiple Idocs based on separate order from flat file.
    Order_No - removeContexts - splitByValue(ValueChanged) - collapseContexts - exists - creatIf - IDOC
    Now I am having hard time creating a line item segment E1EDP01. I want to have Idoc created below way:
    IDoc-1 (Order_1)
    E1EDP01
    E1EDP01
    IDoc-2 (Order_2)
    E1EDP01
    E1EDP01
    IDoc-3 (Order_3)
    E1EDP01
    E1EDP01
    I am getting multiple IDocs created. Please help me to create mutlieple line items under each Idoc. Please be speficic about the node funtions to be used, because I tried many times with different combinations, didn't work.
    Regards,
    N@v!n

    Hi Navin,
    Create your source structure like below
    <Order>1 to unbounded
        <Order_No>
        <field1>
        <field2>
        <field3>
        <field4>
    </oder>
    to create mutiple IDocs based on order number,use below logic
    Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)--->collapsecontext-->Idoc
    use below logic for E1EDPO1,
    Order----->removecontexts------>
                                                                                    formatByexample------>E1EDP01
    Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)-------->
    try above logic and let me know if you any issues.
    Regards,
    Raj

  • Merging multiple idocs into 1 XML output

    Hi Gurus,
      I've got a scenario whereby i will need to send payment documents via idocs to XI and XI will output them into an XML file.
    At the moment, when i perform a payment run for multiple vendors and send the idocs out, i realised that multiple idocs are being sent out and XI will output multiple XML docs.
    Is there any way i can merged these idocs into a single XML document? The idocs are all from the same system.
    Thanks in advance.

    HI,
    I think this is possible using PACKAGING.
    Check this note 814393 on Service Market Place.
    You want to create or process an XI message with multiple instances of an IDoc (of the same IDoc or extension type) in the mapping.
    Please refer below link to follow the steps to Merge IDOCs under single XML,
    SAP Network Blog: Collecting IDocs without using BPM
    Collecting IDocs without using BPM
    IDoc packaging
    Reason and Prerequisites
    The relevant IDoc is imported into the Integration Repository.
    Solution
    1) Log on to the Integration Repository.
    2) Open the relevant IDoc in the object editor.
    3) Select the "Export XSD" menu option in the "Tools" menu.
    4) In the subsequent dialog box, assign a file name and save the data to the hard disk of your local PC.
    5) Open the file that you have saved in step 4 in an adequate editor (for example, Notepad) for editing.
    6) Locate the first entry: <xsd:element name="IDOC" type="<
    Idocname>"> and add the following expression, maxOccurs="unbounded", between the value of the type attribute and the closing angular bracket.
    Example:
    <xsd:element name="IDOC" type="ADR2MAS.ADR2MAS02"
    maxOccurs="unbounded">
    7) Save the modified file to the hard disk of your local PC.
    8) In the message mapping, use the file saved in step 7 instead of the imported IDoc by using the "Import XML or XSD" function in the mapping tool to select the source or target messages.
    Thnaks
    swarup

  • Creating multiple idocs in ABAP mapping

    Hi,
    my scenario is source message (JDBC) to target message (idoc).
    There can be multiple idocs (unbounded).
    I am using ABAP mapping to create the Idoc XML structure. For this i use function module IDX_IDOC_TO_XML.
    The idoc is getting created but the problem occurs in case of generating multiple idoc instances.
    I changed the idoc occurence to unbounded & used the new idoc external definition in the interface mapping.
    I also call the IDX_IDOC_TO_XML & create the output stream factory in a loop (per idoc ).
    However only 1 idoc gets generated every time.
    Can someone suggest how to create the multiple idocs.
    Regards
    Prasenjit

    Hi Prasenjit,
    In order to generate multiple idoc first of all you need to change the target structure with multiple occurence...that you have already done...
    Now while generating XML in abap mapping you have to make sure you have element idoc(with its content) repeating for your "N" number of idocs...
    can you please copy paste your final xml generated...
    Nilesh

  • Splitting multiple IDoc XML files into single IDoc messages for R/3

    Hi all. I have a problem splitting IDoc XML files coming in to XI. I currently have an interface that takes in single store sale IDoc transactions (type WPUBON01) in an IDoc XML file. I then have some complex graphical mapping on the IDoc before sending to R/3 via the IDoc adapter. This works fine. However, we now wish to include multiple sales in one file i.e. many WPUBON01 IDocs. I could use message splitting to do this BUT the mapping is so complex, I do not wish to have to change it to enable the processing of many IDocs in one file instead of just one.
    What I want to do: have one mapping splitting a multiple IDoc XML file into single IDoc messages and then another taking these single messages as before and performing the mapping. I cannot find a way to do this in one interface; the main problem I'm having is getting XI to split the multiple IDocs into many single IDoc messages within XI itself. I'd be very grateful for any advice on the best way to do this.
    Thankyou.
    Stuart Richards (Halfords, UK)

    Bhavesh,
    Thanks again for a clear explanation... I'm moving forwards but still struggling. I've been on this all afternoon today (after a break on other things) and just cannot get my message to split properly (though the SOAP adapter problem I had earlier is now fixed!). If my initial IDoc XML file contains this format:
    <WPUBON01><IDOC>....</IDOC>
                          <IDOC>....</IDOC>
                          <IDOC>....</IDOC></WPUBON01>
    .. I'm not sure what the cardinaility on the first message mapping and interface mapping should be. I'd have thought the source interface would be 1 and the target would be 0..unbounded but this isn't working. I'm trying different things but I get different errors each time. Currently, I have the above cardinality in my first interface and I'm passing in the following data:
    <WPUBON01><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832292</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160633</VORGZEIT><BONNUMMER>1001</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1001</ZUONR></E1WPB06></E1WPB01></IDOC><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832293</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160634</VORGZEIT><BONNUMMER>1002</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1002</ZUONR></E1WPB06></E1WPB01></IDOC><IDOC><EDI_DC40><TABNAM>EDI_DC40</TABNAM><MANDT /><DOCNUM /><DOCREL>620</DOCREL><DIRECT>2</DIRECT><IDOCTYP>WPUBON01</IDOCTYP><MESTYP>WPUBON</MESTYP><MESCOD>ST6</MESCOD><SNDPOR>WPUX</SNDPOR><SNDPRT>KU</SNDPRT><SNDPRN>0518</SNDPRN><RCVPOR /><RCVPRT>KU</RCVPRT><RCVPRN>0518</RCVPRN><REFINT>00000003832294</REFINT></EDI_DC40><E1WPB01 SEGMENT="1"><POSKREIS>0518</POSKREIS><KASSID>29</KASSID><VORGDATUM>20071029</VORGDATUM><VORGZEIT>160634</VORGZEIT><BONNUMMER>1003</BONNUMMER><KASSIERER>100</KASSIERER><CSHNAME> </CSHNAME><BELEGWAERS>GBP</BELEGWAERS><E1WPB02 SEGMENT="2"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="3"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="4"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="5"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="6"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="7"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="8"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="9"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="10"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="11"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="12"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="13"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB02 SEGMENT="14"><VORGANGART /><QUALARTNR>ARTN</QUALARTNR><ARTNR>000000065601301390</ARTNR><VORZEICHEN>-</VORZEICHEN><MENGE>1</MENGE><AKTIONSNR>0000000000</AKTIONSNR><REFBONNR> </REFBONNR><E1WPB03 SEGMENT="15"><VORZEICHEN /><KONDITION>PN10</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03><E1WPB03 SEGMENT="16"><VORZEICHEN></VORZEICHEN><KONDITION>ZPN1</KONDITION><KONDVALUE>1.00</KONDVALUE><CONDID /><QUALCONDID /></E1WPB03></E1WPB02><E1WPB06 SEGMENT="17"><VORZEICHEN></VORZEICHEN><ZAHLART>PTCS</ZAHLART><SUMME> </SUMME><KARTENNR /><ZUONR>1003</ZUONR></E1WPB06></E1WPB01></IDOC></WPUBON01>
    In the message monitor, I get a chequered flag. Great. However, I get the dreaded error 500 in the SOAP receiver comm channel:
    SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error
    Exception caught by adapter framework: SOAP Error
    Delivery of the message to the application using connection AFW failed, due to: SOAP Error.
    Any ideas as to what this might be?! I'm getting there.... if I get a solution out of this, I promise to write the blog myself!
    Cheers
    Stuart

  • Create multiple idoc with multiple receivers based on value mapping table

    Hi,
    Scenario: 
    Step1 : sender sends a finance doc iin the form of an idoc. This idoc will have multiple line items based on profit center. Do determine the value of receiving comp code(header field) n receiving system(logical sys name) value mapping table has to be used.
    Solution so far: I can put an rfc lookup for fetching receiving comp code from mapping table with i/p paraameter as profit center . And split the incoming idoc based on comp code value by using split by value. Now I need your advise 2 take this further.
    Issue 1 : say the incoming idoc has 4  line seg wid 4 diff profit center
    Profit center.       Rec comp code.   Recv sys
    P1.                       C1.                        R1
    P2.                       C2.                        R1
    PS.                       C2.                        R1
    P3.                       C3.                        R2
    Nw using this info, I want 3 diff idocs to be created for each unique comp code.
    Idoc 1 : for C1 wid one line item + 1 for reconsilation ( to be generated additionally)
    Idoc2 : for C2 wid 2 line items + 1 for reconsilation
    Idoc 3: for C3 wid 1 line item + 1 for reconsilation
    Idoc 1 and idoc 2 shud be sent to R1.
    Idoc 3 shud be sent to R2.
    Kindly advise on this

    Hi experts,
    U all r pretty close, but let me put this more clearly.
    Step1: create multiple idocs based on unique comp code - I'm able to do this using rfc lookup n split by value. So I get 3 idocs each for c1, c2 n c3.
    Nw as per the values from value mapping table.
    Idoc for c1 contains 1 line seg.
    Idoc for c2 contains 2 line segs.
    N idoc for c3 contains 1 line seg.
    steps2 n 3,  where I do not have a confirmed solution yet n need ur advise.
    Step 2 : for each idoc generated I need 2 create n additional segment, mapping 4 which will be based on the values in the original segments for that idoc.
    In d above scenario, idoc for c1 contains 1 line seg, nw I want 2 add one more seg to it. The amount and pisting key values in this segment wud be calculated based on the values of the amount and posting key belonging to the original segment in this idoc.
    Similarly for idoc for c2 there are 2 segs, nw I need one more, means 3 in allm
    Hence for idoc for c3, 1 orig already present + 1 more. = total 2.
    Nw I need ur advise on how 2 generate this additional seg in each idocm
    Step 3: when all dese 3 idocs are generated, ( in this case itz 3, in real time it can be n), I need to find their respective receivers using rfc lookup n then based on the receiver send 2 resp recvng systm
    Nw how do I do this?
    Please explain with examples if possible 4 bettr understanding.
    u2020ђąu03B7kўu03C3u03C5 in advance.

  • Splitting XML string as separate fields in message mapping

    Hi Experts,
    I am getting XML string in one field from source message, i need to separate those fields and map it to target fields.
    Sorce message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:test_source xmlns:ns0="urn:gp:prototype">
       <Document>
          <store>3021</store>
          <date>2011-03-24</date>
          <type>3002</type>
          <till>32</till>
          <transaction>1478</transaction>
          <data><![CDATA[<buy><merchantID>006001007031992</merchantID><laneID>29</laneID><referenceID>PP0323095107</referenceID><localDate>2011-03-2302:00</localDate><localTime>09:51:0702:00</localTime></buy>]]></data>
       </Document>
    </ns0:test_source>
    Target Message:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:test_target xmlns:ns0="urn:gp:prototype">
       <item>
          <storeID>3021</storeID>
          <businessdate>2011-03-24</businessdate>
          <Typecode>3002</Typecode>
          <workstation>32</workstation>
          <SeqNum>1478</SeqNum>
          <XX>006001007031992</XX>
          <YY>29</YY>
          <PP>PP0323095107</PP>
          <QQ>2011-03-23+02:00</QQ>
          <RR>09:51:07+02:00</RR>
       </item>
    </ns0:test_target>
    Can anyone please suggest me how can we do this???

    You can easily do both using standard function or simple udf
    Use indexOf  and substring to achieve this...
    Simple UDF
    String var1="><![CDATA<buy><merchantID>006001007031992</merchantID><laneID>29</laneID><referenceID>PP0323095107</referenceID><localDate>2011-03-23+02:00</localDate><localTime>09:51:07+02:00</localTime></buy>]>";
    String search = "<merchantID>";
    if(var1.indexOf(search) != -1){
    int pointer = var1.indexOf(search);
    return var1.substring(pointer+12, pointer+27);
    }else{
    return "";
    similarly for laneid
    search ="<laneID>";
    if(var1.indexOf(search)!= -1){
       int pointer = var1.indexOf(search);
        return var1.substring(pointer+8,pointer+10);
    }else{
       return "";                         
    Same way you can do for all the elements creating seperate method for each element or just use standard function to achieve this.
    Edited by: Baskar Gopal on Mar 24, 2011 10:13 AM

Maybe you are looking for

  • ComponentListener works in Java 1.5, not in Java 1.6

    Hi there, I'm having an odd problem. I have a GUI application that has a JFrame with a JDesktopPane as its content pane, with several sub-windows (JInternalFrames). The master JFrame listens for when a JInternalFrame closes and performs an action. Ea

  • Broadband Slow 24/7

    Hi guys, im hopeing someone can shed some light on this. i got this BT broadband unlimited package with unlimited calls and broadband. it was fine for the first 8 days or so and then suddenly at the weekend on saturday, bamm!, super slow speeds and i

  • IPad mini bluetooth range

    Hi guys, I'm having a really annoying problem with my iPad mini (1st gen). I have a bluetooth receiver for my speakers at my place, and my iPad is having issues connecting to the amp. At a range of about 10 feet the audio keeps breaking up and the mu

  • Packaging a third party jar

    Hi, I need to package a third party jar and export as a jar File using eclipse 3.1? Can you please explain step by step in brief. Thanks,

  • Click in address bar to highlight

    Hi, Is there a setting in Safari to make it so that when i click in the address bar the URL is already highlighted/selected? Also when closing is there an option for it to ask me to open the current tabs next time the browser launches?