cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple idocs from one file.

Former Member
0 Kudos

Hello,

We have a PlainFile–TO–Idoc SAP XI Scenario. We have configured everything and it is working fine. However, we have a new requirement where we need to produce multiple idocs from one file. I mean, in the text file we can have something similar to this:

HEADER;XYZ;123;123456
DETAIL;XYZ;123;123456
DETAIL;XYZ;123;123456
DETAIL;XYZ;123;123456
DETAIL;XYZ;123;123456
..
..
..
..
TRAILER;XYZ;123;456

Now for every 1000 "detail" records from the above structure it should create another idoc.

So can you tell us how to solve this problem? Is there anything we can do to configure SAP XI so we can send 1 File to multiple IDOCS.

Looking forward for your help on this..!!
Thanks in advance.

Purna

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi ,

>>for every 1000 "detail" records from the above structure it should create another idoc

Use the below udf in mapping

int count =1 ;

for(int i=0;i<DETAIL.length;i++)

{

IDOC.addValue("");

for(int j=0;J<1000;j++)

{

++count;

open the respective segment and pass the values in it

TarSeg.addValue("");

f1.addValue(inp1[i]);f2.addValue(inp2[i]);....

}

count = 0;

}

Regards

Venkat

Former Member
0 Kudos

Hello,

BTW, for creation of idoc node after 1000 records u can refer UDF (adjust the count from 15 to 1000) which i have shared in below thread:

Thanks

Amit Srivastava

former_member191435
Contributor
0 Kudos

Hi Purna,

Please follow below link..

File to Multiple IDOC Splitting without BPM - Process Integration - SCN Wiki

You have to change the occurence in IDOC..

For this you have to export idoc struture in your desktop and modify that occurence as shown in the link and import into the PI...

Map that IDOC segment to row of your source struture..

Remaining  mappping will be as per the rules givin by you...

Thanks,

Sreenivas

Former Member
0 Kudos

Hello,

check below wiki which shows how to create multiple idocs, so u can refer the same but to split idocs at every 1000 detail record u have to use a UDF which will create new idoc node when the occ of details is >= 1000

http://wiki.scn.sap.com/wiki/display/XI/File+to+Multiple+IDOC+Splitting+without+BPM

Thanks

Amit Srivastava