I have a big structure to map from EDI (855) to IDOC (ORDERS05). It is quite strait forward. Except that the REF segment of the EDI should produce two IDOC segments of the same type ?!?
So I have an array of REF that should produce an array of IDOC segments. But for that IDOC array, each REF should produce TWO IDOC segments. Quite hard to explain. The REF segment contains a lot of info that needs to be split into two docs in the same array of documents with different values. Something like this:
1.EDI PO-----------------------------------------IDOC PO
2.—EDI line item--------------ARRAY---------------IDOC Line item
3.------REF (Part number + Price)-------ARRAY----------IDOC (REF) P/N
3.----------------------------- ------------------------IDOC (REF) Price
So in my loop I out-array on the IDOC REF to obtain my ARRAY of documents but I need two documents per REF EDI segment. Since I loop on the EDI REF, trying to map twice inside the loop is always overwriting the values of the first mapping and creating a one-to-one documents ratio.
I need a loop with a one-to-two document where the values in the two are different. Say two REF segments in EDI under one PO line item will produce four REF segments under the PO Line item of the IDOC. And of course they need be be in sequence.