cancel
Showing results for 
Search instead for 
Did you mean: 

file to multiple idoc

Former Member
0 Kudos

Scenario is Fileu2013TOu2013Idoc. We have a requirement where we need to produce multiple idocs from one file.

The input file is 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 MULTIPLE IDOC's in SAP.

In PI, Integration directory, under "File Content Conversion" added 2 lines as below:

Recordset Structure=DETAIL,1

Recordset per Message=1000

This splits the FILE to many messages (each 1000 DETAIL) in PI (SXMB_MONI) and creates many IDOC (only if FILE has DETAIL records).

However this works only if the FILE has all DETAIL records (no HEADER, no TRAILER).

Can someone suggest how to use "Recordset per Message" if there are more NODEs in the input FILE?

Thank you very much.

Accepted Solutions (1)

Accepted Solutions (1)

GabrielSagaya
Active Contributor
0 Kudos

Hi

Please use the Recordset structure.

Recordset Structure=Header,1,DETAIL,*,Trailer,1

Also please use keyfield for this which is mandatory

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

Answers (4)

Answers (4)

Former Member
0 Kudos

FILE to IDOC

I'm trying to see if there is a solutin without BPM.

In FILE Sender CC, will it be possible to call a OS script to split the input file (nameA.txt) into multiple files (nameA_1.txt, nameA_2.txt, Note: The OS script will delete the original file nameA.txt)?

I'm not sure if the OS script will be called first before processing the original input file!! Please help if this approach would work. Thanks.

former_member187339
Active Contributor
0 Kudos

Hi,

You can try doing this:

1. Read the complete file and do a FCC.

2. Write splitting logic (per 1000) in udf

3. Use multimapping and enhanced interface determination

4. Also make sure you have changed the occurrence of idoc to 1 ot unbounded (for this download the XDSD of idoc and edit manually then import it as a external definition)

Regards

Suraj

former_member185881
Active Participant
0 Kudos

Hi Ravi

  • You can create root node by using UseOneAsMany node function.

No need of BPM if you use UseOneAsMany.

  • Use multimapping and enhanced interface determination

Regards

Dheeraj Kumar

Edited by: Dheeraj Kumar on Jul 31, 2009 5:00 PM

Former Member
0 Kudos

Suraj

Thanks.

I got your point. I also read Enhanced (Mapping-Based) Interface Determination http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/content.htm.

It appears target IDOC message splits are not supported since the IDOC adapter is not part of the AE. /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

So I will use your approach in two steps. Please let me know if my understanding is correct.

Step 1:

FILE to FILE

1. Read the source file and do a FCC.

2. Write splitting logic (per 1000) in udf

3. Use multimapping and enhanced interface determination

4. Write source file to multiple target files. FILE1,2..N

Step 2:

FILE1,2,3..N to IDOC

1. Normal mapping. (Note: no change of IDOC occurrence of idoc to 1 ot unbounded is needed as original message is split to multiple files in step 1)

Appreciate the input.

Former Member
0 Kudos

I used two step process as detailed in prior note and this issue is resolved.

Thanks.

Former Member
0 Kudos

Hey

Please use Multimapping with BPM to solve your problem.

Write a UDF which will keep a counter of nodes and creates a new root node for every 1000 record.

Thanks

Aamir

Former Member
0 Kudos

Thanks.

It was helpful. Awarded points.

Former Member
0 Kudos

Ravi,

Recordset per message will not work in your case. But you can do with a BPM.

Regards,

---Satish