cancel
Showing results for 
Search instead for 
Did you mean: 

LSMW With multiple files

Former Member
0 Kudos

Hi All,

I am trying to see if it is possible to use two files in one LSMW session.

I have a file with two columns:

Legacy code and Amount

I have another fie which is a lookup table and have two columns

Legacy code and SAp wage type

Is there way so that I can use these two files to upload the SAP wage type and deduction amount to PA0014 in one step.

Basically is there a way that first file will do a look up for the SAP WAGE Type from the second file?

I hope this is not confusing

Thanks,

~Mark

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

IN the step "Maintain field mapping and conversion rules" you can write code..

In "global data definitions and declarations" declare the internal table ..

In "Before processing the data" upload the data from the look up file and store it in an internal table..

In "BEGIN_OF_TRANSACTION" read the internal table and assign to correct field..

Thanks,

Naren

Former Member
0 Kudos

Hi Naren,

Thanks for your reply. where are these steps

In "global data definitions and declarations" declare the internal table ..

In "Before processing the data" upload the data from the look up file and store it in an internal table..

In "BEGIN_OF_TRANSACTION" read the internal table and assign to correct field..

Thanks,

~Mark

Answers (3)

Answers (3)

Former Member
0 Kudos

I am sorry... I am not sure about file hierarchy..

Thanks,

Naren

Former Member
0 Kudos

no problem Naren.

I am starting another thread with this question....

Former Member
0 Kudos

Hi,

When you get there double click on the line which says..

Coding: * __GLOBAL_DATA__

Then you will get a editor..

You can write code to declare the internal table..

DATA: BEGIN OF ITAB OCCURS 0,

        • Your file structure...

END OF ITAB.

In the

  • __BEGIN_OF_PROCESSING__

Use the function module GUI_UPLOAD to load the file and move it to an internal table ITAB..

Thanks,

Naren

Former Member
0 Kudos

Hi,

One last question. I read in some forums that LSMW supports files heirarchy. If so, then if I have two files with same column names then shouldn't LSMW allow me to do the lookup from the 2nd file without any ABAP codes?

~Mark

Former Member
0 Kudos

Hi,

In LSMW in the step.."Maintain field mapping and conversion rules" you can write code...

If you are not getting the

__GLOBAL_DATA__

__BEGIN_OF_PROCESSING__ in this step...Then do the following..

In the initial screen of your project (where all the steps are shown)..In the menu..choose EXTRAS -> PERSONAL MENU..you will get a popup..In that Check the checkbox against the text "Maintain field mapping and conversion rules"...Then press enter..

Now go to the step "Maintain field mapping and conversion rules"...You will all the events..

Hope this helps..

Thanks,

Naren

Former Member
0 Kudos

Thanks Naren,

GLOBAL_DATA__

__BEGIN_OF_PROCESSING__

now in the Maintain field mapping and conversion rules". Now how do I declare the internal table and read the file in the internal table?

~Mark