cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC Split

former_member10771
Active Participant
0 Kudos

Hi ,

I would need to do a scenario where in the IDOC has to be split in mapping at 999 line items.

Suppose if there are 2000 line items then at 999 first split must happen followed by the remaining ones.

I have gone thru the blogs and could see that one way would be to define the recordset to 999 in file adapter

Second would be to do a multi mapping File to IDOC and then IDOC to IDOC.

Can you please suggest me with any other feasible solution. Also I guess we could do a single mapping and limit the same in UDF.

Is there any link to the same.

Please revert with your inputs.

Amit

Accepted Solutions (0)

Answers (3)

Answers (3)

Bhavani_Baisani
Participant
0 Kudos
Dimitri
Active Contributor
0 Kudos

Hi Amit,

Make sure you do a multimapping and write a UDF. You can use this code:

int contextCount = 0;

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

  result.addValue(var1[i]);

  contextCount++;

  if(contextCount == count && i < var1.length-1){

  result.addContextChange();

  contextCount = 0;

  }

}

Please define count as a parameter, type int

This parameter can be used to specify a value on which a new idoc must be created.

Kind regards,

Dimitri

Former Member
0 Kudos

Hi Amit

Tell me about your scenario. Is it File to Idoc or Idoc to file or Idoc to Idoc??

former_member10771
Active Participant
0 Kudos

Hi Indrajit,

It is File to IDOC scenario.

gagandeep_batra
Active Contributor
0 Kudos

Hi Amit,

first change the occurance of idoc with the help of following blog:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/12/04/xi-idoc-bundling--the-trick-with-...

Then  you can go for creation of IDOC's  based on udf by Dimitri

and handle the idoc context in mapping

Regards

Gagan