cancel
Showing results for 
Search instead for 
Did you mean: 

Sort and create node for IDoc, for blank values create individual IDoc

Former Member
0 Kudos

Hi,

Below is scenario

AccNo Name1 Bank

100     John     BANK1

101     Kelly     BANK1

100     John     BANK2

100     John     BANK3

101     Kelly     BANK2

----      Harry    BANK3

----      Edd      BANK2

Output:

IDoc : ZCREMAS05

In this case 4 IDocs should be created

IDoc 1:

E1LFA1M

100

John

     E1LFBKM

          BANK1

     E1LFBKM

          BANK2

     E1LFBKM

          BANK3

IDoc 2:

E1LFA1M

101

Kelly

     E1LFBKM

          BANK1

     E1LFBKM

          BANK2

IDoc 3:

E1LFA1M

----

Harry

     E1LFBKM

          BANK3

IDoc 3:

E1LFA1M

----

Edd

     E1LFBKM

          BANK2

I am using Sort+Split by Value change+Collapse context

But this will work only when AccNo has some value. Now, I need to create IDocs also when AccNo is blank in the file.

Please let me know if this can be handled by graphical mapping or we need UDF.

Thanks,

Vertika

Accepted Solutions (0)

Answers (2)

Answers (2)

apu_das2
Active Contributor
0 Kudos

Hi Vertika,

If you do an FormatByExample of Bank based on Name , I think that should work for you.

If you face issue to map this with your target IDOC, then I will request you to create to middle structure as per your convenient and from there you can map with your target IDOC.

Thanks,

Apu

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vertika,

Have you tried using mapWithDefault after AccNo?

Regards,

Mark

Former Member
0 Kudos

That will not work here. Because suppose there are two records with blank account number then I have to create two IDocs and sorting and split by value change will combine the blanks together which we dont want.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vertika,

In that case, create a queue type UDF that will introduce an index. For example:

Result

Regards,

Mark

Former Member
0 Kudos

Thanks Mark.

I used this in mapping to add index and handled the sub segment accordingly.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vertika,

If the problem has been solved, please mark the thread as answered

Regards,

Mark