Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

LSMW & Internal Table

Former Member
0 Likes
1,447

All,

I using LSMW (RMDATIND) to load material masters. IM using GUI upload to read the data into an internal table. The data reads in fine. Prioblem I have is when i map the internal table to the fields within each of the segments i only get the first record. Im using 3 segments in the materia load,

the structure is as follows:

BMM00 Mat1

BMMH1 UOM1

BMMH7 TEXT 1

I''m not sure where i should put the loop or how to force it to the next record

thanks for any help

All,

I using LSMW (RMDATIND) to load material masters. IM using GUI upload to read the data into an internal table. The data reads in fine. Prioblem I have is when i map the internal table to the fields within each of the segments i only get the first record. Im using 3 segments in the materia load,

the structure is as follows:

BMM00 Mat1

BMMH1 UOM1

BMMH7 TEXT 1

I''m not sure where i should put the loop or how to force it to the next record

thanks for any help

7 REPLIES 7
Read only

JL23
Active Contributor
0 Likes
1,077

IM using GUI upload to read the data into an internal table

this does not really sound like you are using LSMW, as this step is not necessary at all as it is included in LSMW step 9 Read data.

Prioblem I have is when i map the internal table to the fields within each of the segments i only get the first record.

Mapping of fields is done in step 5. you first describe your internal table structure in step 2 and 3.

then you assign the structure to the target structure in step 4

and map field of internal structure to target structure in step 5.

Please describe your structure from step 2 and your mapping in step 4.

Read only

Former Member
0 Likes
1,077

hi jurgen

In this case im using the Function GUI upload to read the file into an interna table, The souce data file is selected when the convert data step is ran (via a parameter). I have mapped the structures to a dummy file that contains only 1 field. All of the data i need is in the Internal table now and my intention was to map directly from that internal table. As i mentioned this works but i am only getiing the first record. Alternatively i could create the source fields and map them to the fields but i still need to take the source data into an internal table to remove duplicates.

hope this makes sense?

thanks for your reply

Read only

JL23
Active Contributor
0 Likes
1,077

Even after this long explanation it still is a step that is not needed .

Please answer my questions, otherwise I cannot help you

Read only

JL23
Active Contributor
0 Likes
1,077

I have mapped the structures to a dummy file that contains only 1 field.

How many records are in the dummy file?

The souce data file is selected when the convert data step is ran (via a parameter).

The convert step is after the read step. how many records have you read in step READ DATA? and how many records do you see in DISPLAY READ DATA.

SAP runs the convert data step once for each record per structure level in the .READ file.

Read only

0 Likes
1,077

Jürgen L. is correct the file does not need to be uploaded through GUI_UPLOAD as this is the primary function of the Read Data step.

You said you have 2 files one with records and the other with only 1 (to load the read), why would you not just read the main file with records and process the data within the LSMW? You can also have the LSMW read from multiple files in the Specify Files and Assign Files steps.

Read only

Former Member
0 Likes
1,077

gents

thank you for your responses,

FYI

I have managed to find a resolution to this by using the 'transfer_this_record' stamement. So at the end of the first segement I pass data that would ordinarly be mapped and transfered at the end of each segment. Using a Loop statement this then reads each record one by one.

cheers

Read only

0 Likes
1,077

There are macros in LSMW you can use, I think you need 'skip_record'.