Idoc to jdbc mapping duplicate source node to target structure

Dear all,
I am working on PI 7.1
My sceniro
IDOC to JDBC  [sap to mssql ]  where the target is a table structure shown below: I execute a stored procedure to insert the below message type into sql table.
<ns0:MT_SP_LFBK xmlns:ns0="http://test.com">
- <Statement_Name>
- <storedProcedureName action="EXECUTE">
  <table>spr_test</table>
  <BANKS type="Char">BOA</BANKS>
  <BANKL type="char">122207</BANKL>
  <BANKN type="char">4555--0</BANKN>
  <LIFNR type="char">1100000218</LIFNR>
  <KOINH type="char">varchar</KOINH>
  <BKONT type="char">01</BKONT>
  <BANKA type="varchar">S.A.</BANKA>
  </storedProcedureName>
  </Statement_Name>
  </ns0:MT_SP_LFBK>
The mapping is between source CREMAS02 and the above target structure. Everything works fine.
The problem is when the  vendor has more than one bank account number the IDOC CREMAS02 replicates the below segment E1LFBKM for each BANK account information. Since target and source are mapped one to one how can i map the second bank account information to the same target structure or genereate a new target Message type for the second bank account  information and send it to sql ?
<E1LFBKM SEGMENT="1">
  <MSGFN>005</MSGFN>
  <LIFNR>110000021</LIFNR>
  <BANKS>BOA</BANKS>
  <BANKL>122207</BANKL>
  <BANKN>4555-0</BANKN>
  <BKONT>02</BKONT>
  <BANKA>S.A.</BANKA>
  <BNKLZ>3000000</BNKLZ>
  </E1LFBKM>
Thank you ,
Teresa

Hi Teresa,
which segment have you mapped with <storedProcedureName action="EXECUTE"> ?
Because according to me , if you send <E1LFBKM> to <storedProcedureName action="EXECUTE">
, you will be able to use your stored procedure several times, in fact each times that you have a <E1LFBKM>.
Reminds: inside <Statement_Name> you can do several SQL actions like execute one or several stored procedures (could be different).
Of course, after that your table should accept to have several bank account for a same customer.
So to have something like that:
<Statement_Name>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
<storedProcedureName action="EXECUTE">
</storedProcedureName>
</Statement_Name>
regards
mickael

Similar Messages

  • Idoc - to - JDBC mapping..

    Can any one help me on  step-by-step   Idoc to JDBC  mapping ..

    Check this link for jdbc receiver adapter. and follow the instructions. If you need more assistance let us know with your requirement
    For configuring JDBC adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm
    For creating jdbc structure on the inbound side
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

  • IDOC to JDBC - mapping test versus actual run

    Hi
    When I test the message mapping for the idoc-to-jdbc sender scneario, where one sales order idoc has multiple line items in segment E1EDP01, the statement => access structures repeat properly for 2 line items. Here I am giving the idoc xml file (data file) in the payload in the test tab of message mapping)
    However in the communication channel log (with sql statement log = true), when I try to process an actual idoc from ECC, in the sql log of the processed message, I can see an insert statement only for the first line item of the sales order.
    Please can somebody guide me as to what must be the problem?
    Statement occ is 1.
    tablename occ is 1.
    Access structure occ is 0...unbounded.
    The segment E1EDP01 is currently mapped to acess node.
    The sales order number is repeated over the 2 line items using below mapping -:
    E1EDP01 (with context as root) => "useasmany" => split by value => Item no.
    Please advise.

    Hello Gary,
    Make the statement 0..unbounded or 1..unbounded then make the access 0..1. One statement is needed per action
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm
    If the statements are so complex, you  can also opt to use SQL_QUERY instead.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm
    Hope this helps,
    Mark

  • Mapping for source node 1 to unbounded & target as 0 to 1

    Hi
    my source is
    attribute   1---unbounded              
           name    ....ABC
            value   ....123
    attribute
          name  -
    XYZ
          value  -
      345
    attribute
           name ---  NYM
           value ---  678
    My requirement is as follows...
    If name is XYZ , then pass the value 345 to target node(0...1).
    But the mapping is checking value only of the first node  and the mapping fails...
    Please suggest
    Regards
    Abhijit

    Abhijit,
    Mapping can not fail if the occurence of Target field is 0...1 unless you have some UDF/ Standard function which are throwing exception due to the input they are getting.
    Use IfWithoutElse and set the property SUPPRESS as false.
    Change the context of source node to the top level.
    Thanks,
    Sunil Singh

  • Multiple STATEMENT nodes in target structure for JDBC adapter

    Hi All,
    I have a file to JDBC scenario . At the receiver side we need to update two tables simultaneously .
    So in the target structure for JDBC , is it possible to have two STATEMENT nodes , so that 2 tables can be updated simultaneously.
    Please help.
    Thanks & Regards,
    Loveena.

    Hi,
    U can do tht..please see below link..
    http://help.sap.com/saphelp_nw04/Helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    Regards,
    Manisha

  • Create a empty node in target structure

    Hi,
      The scenerio is idoc(HRMD_A07) to file
      my target structure is
      <Record>
        <Record1>
          field 1
          field 2
          field 3
       <Record1/>
       <Record2>
          field 5
          field 6
       <Record2/>
        <Record3>
          field 7
       <Record3/>
    <Record/>
    Record is mapped to EP1LOGI ,
    Record1 is mapped to E1P0001 and the fields from this segment are mapped to field 1, 2 and 3
    Record2 is mapped to E1P0002 and the fields from this segment are mapped to field 5 and 6
    Record3 is mapped to E1P0105 and the fields from this segment are mapped to field 7.
    Say in one EP1LOGI i do not have E1P0105 in the source. NOW i would like to get a empty node
    <Record3> <Record3/> in target structure.
    Please advice...
    Regards
    Niladri

    My content conversion is
    Record.fieldFixedLengths         0
    Record.endSeparator              'nl'
    Record1.fieldFixedLengths     8,4,10,2,8
    Record1.endSeparator           ','
    Record2fieldFixedLengths    40,40
    Record2endSeparator           ','
    Record3fieldFixedLengths     241
    Record3endSeparator          'nl'
    My source idoc does not have email id ( field7) for the first employee and has email id for teh second employee.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_ELEARNING_dummy xmlns:ns0="http://TFL.com/E-learning/Kallidus">
       <Record>
          <Record1>
             <PERNR>01221690</PERNR>
             <BUKRS>1010</BUKRS>
             <KOSTL>0000040063</KOSTL>
             <PERSK>35</PERSK>
             <ORGEH>50022222</ORGEH>
          </Record1>
          <Record2>
             <VORNA>Barry</VORNA>
             <NACHN>Tredinnick</NACHN>
          </Record2>
          <Record3/>
       </Record>
       <Record>
          <Record1>
             <PERNR>01221793</PERNR>
             <BUKRS>1010</BUKRS>
             <KOSTL>0000040083</KOSTL>
             <PERSK>35</PERSK>
             <ORGEH>50295392</ORGEH>
          </Record1>
          <Record2>
             <VORNA>David</VORNA>
             <NACHN>Sinclair</NACHN>
          </Record2>
          <Record3>
             <USRID_LONG>email addtress</USRID_LONG>
          </Record3>
       </Record>
    </ns0:MT_ELEARNING_dummy>
    Now i get the file as ---ALL IN one line
    01221690101000000400633550022222' ,'Barry                                   Tredinnick                              ' ,'                                                            ' ,'01221793101000000400833550295392' ,'David                                   Sinclair                                   ' ,' email address
    I cannot figure out why i am getting ',' before the second employee number 01221793...
    I want to get the file as:
    01221690101000000400633550022222' ,'Barry   Tredinnick          ' ,'              
    '01221793101000000400833550295392' ,'David    Sinclair            ' ,'email address
    Kindly help

  • IDOC-XI-JDBC: mapping error

    Hi sap gurus...
            I had a problem in IDOC mapping to JDBC.
    If any body have mapping template or any blog.. related to MATMAS.. please help me..
    I don't know how to map the idoc structure to JDBC structure..
    points will be given immediately..
    Kumar

    Hi sheetal
    My IDOC structure is----
    MY JDBC Struc is
    as................................................................MT_MATMAS_MSSQL(Msg type name)
    This struc...is common----
    STATEMENTNAME(0..1)
    ............................................................................TEST (1..1)
    .................................................................................ACTION ..REQUIRED
    .................................................................................TABLE...(MATMAS TABLE IS CREATED IN MSSQL)
    .................................................................................ACCESS(1..1)
    ......................................................................................BEGIN ...REQUIRED
    ......................................................................................EDI_DC40..1...1
    ......................................................................................E1MARAM...1...9999
    ......................................................................................E1UPSLINK..1...1
    THIS IS MY JDBC STRUCTURE..
    I sent the screen shorts to your company email id..please check it and help me..
    i am able to get the idoc from sap r3 to Xi ,,, now i want to send that idoc to database..
    help me please.
    Kumar..
    [email protected]

  • IDOC to JDBC, problem with the multiple line items structure and mapping

    Hi,
    I have a scenario where the ORDERS data need to update the SQL table. for the idoc which consists one line item its ok but for multiple line item its just updating one line item. In the destination side we have only one table for purchase order which consists of lineitem as a field.(no different tables for Header data and Line item data)
    Can anyone suggest me how to create a structure for target side and how to map them.
    Regards,
    CJ

    Hi Rajan,
    The table structure is
    [PO_DATE]
          ,[VENDOR_NO]      ,[PAYMENT_TERM]      ,[MATERIAL_CODE]      ,ORDERED_QTY]      ,RECEIVED_QTY]                                 
          ,[UOM]       ,[RATE]       ,[CURRENCY]       ,[PO_EXCRATE]       ,[TAX_CODE]       ,[BASE_VALUE]       ,[TAX_VALUE]
          ,[TOTAL_VALUE]       ,[ADVANCE_PAYAMT]       ,[TOTAL_QTY]        ,[SNO]       ,[POLINEITEM]
    Datatype structure:
    PO_XI_MT_ORDERS05 1-1
    STATEMENT   1-UNBOUN
      TABLENAME 1-1
        ACTION   optional
        TABLE    1-1
        ACCESS  1-1
           PO_NO   0-1
           PO_DATE 0-1
    Correct me if im wrong.
    Regards,
    CJ
    Edited by: kuncjy on May 5, 2011 11:32 AM

  • Dynamical mapping of source columns to target columns

    Hi,
    I have a requirement in ODI,
    In source system data having like below
    Case1: Column1 having the account related data.
    case2: Column2 having the account related data.
    But in target area I have only one fixed column called account. Now my aim is to populate the account column with case1 and case2 data with in a single execution that means I need assign above source columns at run time.
    How can I achieve this? Please help me on this.
    Does ODI have any API’s for above type of logic? Please let me know.
    Thanks in advance
    Regards,
    Giri
    Edited by: Mannepalli on Aug 26, 2008 11:08 AM

    Hi,
    I am not sure, if I completely understand your question. Depending on your target technology (e.g. Oracle), you could use something like the following in the target mapping:
    case
    when (case1) then column1
    when (case2) then colunm2
    else column3
    end
    If you set this mapping to be executed on the target, then itshould work.
    HTH,
    HH

  • Dynamic Looping of node in target structure

    In Graphical mapping ,I am using UDF, which is returning rows from 0 to N.
    Following is my Target struct
    <Product>
         <A>
         <B>
    <Control>  0 to Unbound
         <M>
         <N>
    Depeding on the result of UDF ,i need create multiple nodes of <Control> which is 0 to unbound st. Ex: If UDF return 3 rows
    <Product>
         <A>
         <B>
    <Control>
         <M>
         <N>
    <Control>
         <M>
         <N>
    <Control>
         <M>
         <N>
    How to achieve this looping ?

    map the output of the UDF to the product node
    I hope you mean to say the Control node (which needs to be repeated)

  • Duplicate Messages created on target with Multimapping(No BPM)

    Hi
    I am working on PI7.1 .
    My sceniro
    IDOC to JMS using message split
    Receiving IDOC with Header and Items, PI splitting IDOC and sending to Multiple JMS queues, Header segment data to header queue, Item segment data to Item queue
    PI Successfully Posting data to Queues, but duplicate messages creating on target sys(One IDOC with one header and one item date, PI sending 2 header messages , two item messages to target sys) .
    I did following steps
    ESR
    1. Created two target messages
    2. Created Two target inbound interfaces
    3. Created Message mapping using with multiple target messages, changed signature occurrence to 0 : unbounded , and mapped to source node to target nodes
    4. Created operation mapping with one source to two target interfaces
    EB
    1. Created one business components and assigned one sender and two receiver service interfaces
    2. Created Two receiver communication channel
    3. Created One receiver determination
    4. Created One interface determination , added two inbound interfaces with one operation mapping (Multiplicity is blank )
    5. Created two receiver agreement
    Please help .

    Thanks Gouri ,
    My IDOC structure (Source Message Type)
      HEADER_SEG Node (0:9999) -
    > MT_HEADER ( 0:unbounded) (this one of target message type)
                                                                    HEADER_FLDS  (Element - Main hierarchy)
             FLDS----
    >  FLDS
    ITEM_SEG Node (0:9999)  -
    >MT_ITEM(0:unbounded ) (this is another message type)
                                                                    ITEM_FLDS (Element - Main hierarchy)
             FLDS----
    >  FLDS
    I tried with the below mappings
                    HEADER_SEG Node -
    >MT_HEADER
                    HEADER_SEG Node -
    > HEADER_FLDS (element )
                    ITEM_SEG Node -
    >MT_HEADER
                    ITEM_SEG Node -
    > ITEM_FLDS (element )
    2. method
                    HEADER_SEG Node -
    >MT_HEADER
                                                           HEADER_FLDS (element )(not mapped)
                    ITEM_SEG Node -
    >MT_HEADER
                    ITEM_SEG Node   ITEM_FLDS (element )(not mapped)

  • Source of xslt mapping and XSD/ XMT target structures for standard Idocs

    Hi,
    I am working on R/3 - XI - ICH scenario. I need xslt mapping and XSD/ XML target structures for standard IDoc like PROACT01,DELFOR01, DELVRY03. I tried to search it on marketplace but couldn't find it there. As per configuration document, these things are shipped with XI mapping content in live cache CD. But I don't have this CD with me. Can anybody tell me the source for these target structures and mapping program. ( Please share marketplace, site link or send me across the mail [email protected])
    Thank you in advance.
    Anand More.

    Anand the other option is to import the corresponding idocs into your integration repository and then you can view the generated XSD there.
    As regards XSLT mapping, you need to basically first identify as to what form you want to transform your source idoc into.
    For some help on XSLT mapping check the following threads,
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/topusers.jspa%3FforumID%3D44
    https://www.sdn.sap.com/sdn/collaboration.sdn?node=linkFnode1-6&contenttype=url&content=https://Process Integration (PI) & SOA Middleware
    Also have a look at my code samples,
    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
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
    cheers
    Sameer

  • Message mapping with dynamic node

    Hi,
    I am doing message mapping where my source structure is
    <root>
         <EmpCount>2</EmpCount>
         <Emp>
              <item>
                   <code>1</code>
                   <name>ABC</name>
              </item>
                                     <item>
                   <code>2</code>
                   <name>PQR</name>
              </item>
         </Emp>
    <root>
    If EmpCount is having value 2 then Emp node will have only 2 items
    Target structure is flat structure like (something like fix file format)
    <root>
         <EmpData>EmpDetails</EmpData>      occurrences 0...unbounded
    </root>
    With above sources data following is expected target sturcure…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>3PQR</EmpData>
    </root>
    Here my query is how I can create more than one node to target structure with employee details.
    I already tried with following Re: how to create target node a constant number of times
    This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting…
    <root>
         <EmpData>2ABC</EmpData>
         <EmpData>2ABC</EmpData>
    </root>

    Sunil,
    Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for
    I/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">
       <EmpCount>2</EmpCount>
       <Emp>
          <Item>
             <Code>1</Code>
             <Name>A</Name>
          </Item>
          <Item>
             <Code>1</Code>
             <Name>B</Name>
          </Item>
       </Emp>
    </ns0:MT_Check>
    O/P
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">
       <Root>
          <EmpData>2A</EmpData>
          <EmpData>2B</EmpData>
       </Root>
    </ns0:MT_Check_Out>
    Best regards,
    raj.

  • Remove empty nodes in the target structure

    Hi,
    My scenario is IDoc-XI-JDBC.
    For one IDoc I need to update data in 4 tables. But if idoc contains ATWRT node then it should update 4 tables if not only first two tables.
    For the statement 3 and 4, i have done the following mapping.
    [ATWRT][collapseContexts]-[exists]--[if then][statement3]
    but in the target sturcture I am getting blank node as following:
    <statement3/>.
    And because of this blank statement JDBC Adapter is throwing an error.
    Can anyone help me how to remove this blank node from target structure.

    Jwalith,
    I hope you must have kept the Statement node occurrence as 0..xxxx(1 or n), if that's the case you don't need to check anything. Just map the ATWRT directly to Statement 3 and Statement 4.
    By the way what's the occurence of ATWRT node ? I gave the above suggestion, keeping in mind that ATWRT node occurrence is 0..1.
    If the occurrence of  ATWRT is not 0..Unbounded, then you can also use the below simple UDF.
    ATWRT >UDF>Statement3
    ATWRT >UDF>Statement4
    UDF - Advanced(Queue), with one Parameter (
    if( ATWRT.length >0)
    result.addValue("");
    else
    result.addSuppress();
    Thanks,
    raj.

  • Target structure generation using GUI mapping

    Hi Experts,
    I have two nodes in source  and one node in target structure .
    Source
    permanentemployee (0..n)
          name
          dept
    contract employee (0..n)
         name
         dept
    Target
    Employee (0..n)
        name
        dept
    If both nodes (permanentemployee  &  contract employee )are present in source then I should get two occurances of target..
    Please watch that I have same subnodes in permanentemployee  &  contract employee .
    Please let me know your thoughts.

    Hi Vamsi,
    Duplicate the target structure.
    then map
    permanentemployee (0..n) node to Employee (0..n) target node and fields should map to the target side fields [like name --> name and dept --> dept]
    and contract employee (0..n) node to Employee (0..n) target node [this is the duplicated node] and map the corresponding fields to tarhet fields. [like name --> name and dept --> dept]
    Regards
    Ramesh
    Edited by: Venkataramesh Boppana on Oct 8, 2009 12:43 AM

Maybe you are looking for