cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping - Multiple occurances in a record to multiple segments

Former Member
0 Kudos

Need help to map multiple occurances of fields in a single record of a file to multiple segments of IDOC.

Example: I get one record in a file which will have header information and a max of 10 items (group os Material and Quantity occurring 10 times).

I need to map the record data to create a DESADV message where the header data should go to E1EDL20 segment and should be followed by as many E1EDL24 segments (for items) as the number of occurances of Material_Quantity Groups existing in the record (max of 10).

I would appreciate if someone could propose a solution.

Thanks

B

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can accomplish it like this in the message mapping:

1. Map the material field to E1EDL24

2. Now Map material to E1EDL24/material using splitbyvalue function (node functions)

(i.e.) material -> SplitByValue -> E1EDL24/material

3. Do the same thing as step 2 for quantity.

This should create as many E1EDL24 segments as the number of material/quantity groups.

Hope that helps,

Suresh.

Former Member
0 Kudos

Sorry but it looks like my question is not clear. Let me explain with a scenario.

<b>Flat file format</b>

1. Field1 Delivery Type 2 Characters

2. FieldGroup MAterial+Qty 22 Characters Occurs(10)

Material-1 18 Chs

Qty-1 2 Chs

Material-2 18 chs

Qty-2 2 Chs

.................................

.................................

Material-10 18 chs

Qty-10 2 Chs

Sample File (with 2 occurances of items only)

EL000000000000000123 5000000000000000456 4

Now in the header I will move 'EL' and should create two segments of E1EDL24 with

Segment-1 000000000000000123 5

Segment-2 000000000000000456 4

Thus if more ocuurances are present I need to create more E1EDL24 segments. Ofcourse to a max of 10 segments since the flat file can have a max of 10 material+qty groups.

Hope I am clear.

I did this using Seeburger for mapping. So I am assuming that XI will also have some mechanism to handle this requirement.

Thanks

Former Member
0 Kudos

How are you reading the flat file? Using the file adapter? If so, sender file adapter has 'File content conversion' that lets you convert the records in the incoming file into an equivalent xml structure.

http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm

A related but useful sdn thread could be:

You could convert the records in the file into an xml structure - this xml could then be mapped to idoc xml using message mapping.

If I am still not addressing the problem, I may need little more explanation of the scenario - as to how u are reading the file, what you are doing with the contents and what adapters you are using etc.

Regards,

Suresh.

Former Member
0 Kudos

Right click on target field that you need to map to, choose duplicate sub-tree to how many you need to write out.

If there is no set amount simply change your data type for E1EDL24 to be unbounded.

To get into the loop itself you may have to assign an empty constant to both super nodes.

Andrew

Former Member
0 Kudos

The issue is that the input record may have only one or three etc ...to a max of 10 combinations of Material+qty

So I cannot create say 6 empty E1EDL20 segments, if I have 4 materials data.