cancel
Showing results for 
Search instead for 
Did you mean: 

file to idoc scenario (split message)

Former Member
0 Kudos

hello everybody

i have a file (xml) -> XI -> Idoc scenario

sometimes idoc message is so much big and i have problem to process it.

so i would like split message in more idoc but i need decide a cut-point

example in file i have 200 row and i don't want create 200 idocs but example 4.

So i need cut file every 50 rows.

It's possible?

thanks

Alex

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

i solved myself . no solution found

Former Member
0 Kudos

Hi,

How did u solve this problem.

Please tell us.

Regards,

Manisha

RKothari
Contributor
0 Kudos

Hi,

Write a UDF, which will use source as Row field value and target as Idoc.

The below mentioned code can be used to split up the file with 200 row into 4 Idocs. But with this logic, you need to check the child node mapping, if they are getting affected or not.

// split the value if more than 50 segments are found.

int i,j;

for(i= 1;i<=(a.length) ;i++)

{

if( (i % 50 ) == 0)

{

result.addValue(a[0]);

result.addContextChange();

}

else {

if((i == (a.length) ))

{

result.addValue(a[0]);

result.addContextChange();

}

else {

result.addValue(a[0]);

}

}

}

BR,

Rahul

former_member192295
Active Contributor
0 Kudos

Hi,

I think the problem is due to IDOC segment occurrence. Better to increase segment occurrence, the problem will be sort out easily. In standard PI i think we don't have option to cut file.

Find below mentioned link help you.

/people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover

/people/alessandro.guarneri/blog/2006/03/05/managing-bulky-flat-messages-with-sap-xi-tunneling-once-again--updated

Former Member
0 Kudos

i already increased IDOC occurence on 1-unbounded

now i want understand how i can cut the message!!!

shweta_walaskar2
Contributor
0 Kudos

Hi Alessandro ,

We had the same problem in HR implementation where we used to get data for thousands of employees in a single file.

As Idoc was not able to hold this much of data,data used to be truncated.

Then we had taken a field (employee number) as a criteria to generate IDocs,and now we have an IDoc generated for each employee record.

This was helpful as for a single employee,there were a number of change records.

The logic used was:

Employeecode -> splitByValue(value changed) -> collapseContexts -> IDoc.

Does it suit your requirement as well?I mean,may be you can find such field for splitting IDocs.

Kindly let us know.

Thanks.

Regards,

Shweta

Former Member
0 Kudos

Hi Alessandro,

You can use the statistic functions viz., count and index to cut the file after a number of rows. The index can you give a specified record occurence. You can fix this occurence and cut the file to create another idoc.

Regards,

Akshay

Former Member
0 Kudos

Hi,

I guess u can use any of the field from xml file to create multiple IDOC.

Say employess details are there with company name.

then u can generate multiple IDocs depends on company name.

but in this case u won't be able to cut file in equal size.

this is just one suggestion.

Regards,

Manisha

udo_martens
Active Contributor
0 Kudos

Hi Alex,

use parameter "Recordsets per Message" to split the message in the sender adapter.

[Converting File Content in a Sender Adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm]

Regards,

Udo

Former Member
0 Kudos

Udo,

i cannot use parameter "Recordsets per Message" because i'm not reading flat file.

I'm using XML file.