cancel
Showing results for 
Search instead for 
Did you mean: 

1:N CSV to multiple Idocs

Former Member
0 Kudos

Hi All,

We are working on 1:n mapping of splitting incoming csv file into multiple SAP Sales Order Idocs.

As per initial requirement we have to split order Idocs where ever there is a change in Document Number in file, so we have made our header mapping like:

DocNo-->Split By Value (Value Change)-->Collapse Context-->IDOC after changing IDOC occurance to 1:unbounded.

This mapping was working fine but now an addition has come up that in the above case that if any document in file has material number starting with A then a new sales order for this material should be created and rest of the functionality should be same.

Kindly guide me on how to make additions in the header mapping to accomodate splitting on Document Number + Material No which starts with A.

reg,

NJ

Accepted Solutions (0)

Answers (1)

Answers (1)

anand_shankar10
Active Participant
0 Kudos

Hi Nishu,

One of the solution can be that you add one more IDOC in the target side in Message Mapping and put If condition mentioning if MATNR starts with "A".

This will help to create this IDOC only if condition is satisfied.

Thanks

Anand

Former Member
0 Kudos

Hi Anand,

Thanks for your suggestions but then how to stop this line item from going into 1st idoc?

reg,

nj

anand_shankar10
Active Participant
0 Kudos

Nishu,

You mentioned that you are creating IDOC for every unique DocNum. So do you men to say that the same DocNum can have Material number starting with numeric as well as"A".

In this case also in the first IDOC segment all the IDOCS will be created with unique DocNum and in the 2nd IDOC segment Idocs will be created for MATNAR starting with "A". so whats the problem?

May be you try to simulate this in mapping and share if some issue.

Thanks

Anand

Former Member
0 Kudos

Hi Nishu,

You may write UDF for this:

Pass all document no.s and material no.s to UDF

Loop on all documents no.s

set variable doc no. = current no.

     if material no. starts with A

          add to resultlist

     else if current doc no <> next doc no

              add to resultlist

endloop

Thanks,

Beena

Former Member
0 Kudos

Thanks you all for your replies. We have resolved this using FormatByExample function in Graphical Mapping itself.

Reg,

NJ