Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question