Skip to Content
0

File to IDOC 1:N Mapping segment creation

Aug 08, 2017 at 12:38 PM

90

avatar image
Former Member

I am working on File to IDOC which is 1:N.
I have a requirement that i need to create an IDOC based on source field value.

Ex: Let us say there are 15 Records, has a field DocLine value as below.
001
002
001
002
003
001
002
001
002
003
004
001
002
001
002
for every 001 an IDOC need to be created and the corresponding E!BPACGL09 segments need to be created.
Total 6 IDOC's need to be created and
1st IDOC 2 GL09 segments.
2nd IDOC 3 GL09 Segments.
3rd IDOC 2 GL09 segments.
similarly based on lines we need to created segment.
kindly help on this issue.

displayqueue.jpg (46.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Manoj K Aug 08, 2017 at 07:17 PM
0

Hi,

Try this :

Have not tested thoroughly!

I would not suggest to chnage IDOC occurnece via External Definition as there are chnaces of getting "NullPointerException" in IDOC_AAE channel. You can change the occurence directly via Signature tab

Udf : Execution Type : All value of Queue

for(int i=0;i<var1.length;i++){
if(i==0)
{
result.addValue(var1[i]);
}
else{
if((var1[i].equals("001")))
{
result.addContextChange();
result.addValue(var1[i]);
}
else
{
result.addValue(var1[i]);
}}}

Br,

Manoj


mm1.png (7.7 kB)
mm.png (38.3 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Awesome its working fine.....
Really thank you so much for this.

0

Good to hear! please close the thread.

0
Evgeniy Kolmakov Aug 08, 2017 at 04:23 PM
1

Hi!

I would turn to XSL transformation for that requirement. Using XSLT you're able to create as many IDocs as you need.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 08, 2017 at 03:13 PM
0

Easiest if you export the IDoc definition from the ESR, change the max occurence of the IDoc to n and import it as an external definition.

That way you can create an 1:1 mapping against your input file and still separate IDocs would be created in ECC.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 08, 2017 at 03:18 PM
0

I had done all these changes, at mapping level i am finding it difficult to create.

Share
10 |10000 characters needed characters left characters exceeded