cancel
Showing results for 
Search instead for 
Did you mean: 

LSMW - ME21 How to map multiple line items

Former Member
0 Kudos

Hi all,

I am using LSMW tool with batch input recording technique to create POs via ME21. I have defined source structures as HEAD with POSI as its subordianted structure. This settings worked perfectly for one single item line. However, it created a new transaction for each line item in the file. I did some searches in this forum and I noticed that someone suggested to dynamically set the line positon at the processing points. I tried a few times and could not get it work. Anyone knows how to map multiple items in LSMW, please help.

Here is part of my recording:

EKPO-EMATN(01) 000995NM

EKPO-MENGE(01) 1 RM06E-EEIND(01) 2006.04.27 EKPO-NETPR(01) 10 EKPO-WERKS(01) 0001 EKPO-LGORT(01) 0001

My input file looks like this:

H 77777400 NB2006.05.140001001T

L000995NM00000000052006.05.15 1000010001CAON

L000998NM00000000052006.05.15 1000010001CAON

H 77777400 NB2006.05.140001001T

L000995NM00000000052006.05.15 1000010001CAON

Thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member633158
Participant
0 Kudos

Hi

I am also looking for the similar solution where i want to create PO with more than one line item.

Please help with how did you managed to resolve this?

--erpMan--

Former Member
0 Kudos

Hi

I don't know how you have defined the structure of your file:

if you have defined two different structures you should use twi different files;

if you have defined only one structure then you can use a first field as flag indicating the kind of the information (header or item) so you can insert a routine to check the kind of record and transfer the data only if the structure is right.

You can do it by inserting abap code in MAPPING step.

Max

Former Member
0 Kudos

Hi Max,

I have defined one structure and the records are distinguished by a flag (1st char = 'H' or 'L'). How can I map to lines position 2, 3 ... since it seems to always map to line 1 based on my recording as above? What can I put in the ABAP code?

This is what I have for material mapping. Note, 'EMATN_01' is the default for 'EKPO-EMATN(01)'.

ZME21-EMATN_01 = POSI-EMATN.

Thanks.

Former Member
0 Kudos

Hi

If you have used a b.i. recording, all abap code is inserted in std table /SAPDMC/LSGBDC.

The program to generate the B.I. session is automatically created when you run "Create Batch Input Session" step.

What means the numbers of items you can insert depend on the totals of items you have used while creating your b.i. recording:

If you have simulated to insert only one item, you'll be able to insert only one item in your project.

So you should simulate to insert severals items not only one, but I think it should be better you use a std method to create PO by LSMW:

- Std B.I: object 0085, method 0001 (RM06EEI0);

- BAPI : object BUS2012, method CREATEFROMDATA1

Max