cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi,

I have problems with queue after reading database table with JDBC. For each detail line I have also the header information repeated. This causes problems when I want to create an IDoc per Header. What do I have to do so that only one IDoc is created per "real" Header information?

For example:

Header Header1 Header2 Header3 Detail1 Detail2 Detail3

8888 abc 1111 1123374 rrr sss bbb

8888 ajc 222 1122334 ttr sss bbb

8888 afc 1441 1126664 rhh sss bbb

8888 ajj 1551 1123348 rnr sss bbb

8888 agj 11661 1123349 rdf sss bbb

9999 agj 11661 1123349 rdf sss bbb

9999 agj 11661 1123349 rdf sss bbb

9999 agj 11661 1123349 rdf sss bbb

9999 agj 11661 1123349 rdf sss bbb

So in the example above I want to create only 2 IDocs. The first one with 5 detail segements and the second one with 4 detail segment.

The first column is the identifier field which when changes from 8888 to 9999 then I need to create a new IDOC.

How do i take care of all the detail segments and make sure they go with the respective Header segment for each IDOC?

Thanks,

Teresa

Edited by: Teresa lytle on Jun 13, 2011 5:32 PM

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Another useful [link |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3194] [original link is broken] [original link is broken] [original link is broken];for formatbyexample node function

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

To create one Idoc per unique header, use the following mapping :

Header --> removeContexts --->sort ---> splitByValue(value change) --> collapseContext.

The detail fields would need to be mapped accordingly.

Regards

Former Member
0 Kudos

Hi Sarkar,

So i would not need to do your logic for the detail segment?

Thanks,

Teresa

Shabarish_Nair
Active Contributor
0 Kudos

Hi Sarkar,

>

> So i would not need to do your logic for the detail segment?

>

> Thanks,

>

> Teresa

based on the logic for IDoc node, you will have to use formatbyexample also for your detail records

Former Member
0 Kudos

Thank you Vijay and Gopal. Can you please provide an example for my scenario on how to use formatbyexample. I looked at the link in help.sap.com .

Teresa

Shabarish_Nair
Active Contributor
0 Kudos

you might want to use the formatbyexample function

http://help.sap.com/saphelp_nw04/helpdata/EN/67/7ca04267deb111e10000000a155106/frameset.htm

this should help you build the required queue for each IDoc