Skip to Content

File to IDOC 1:N Mapping segment creation

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Aug 08, 2017 at 07:17 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 04:23 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 08, 2017 at 03:13 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 03:18 PM

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

    Add comment
    10|10000 characters needed characters exceeded