cancel
Showing results for 
Search instead for 
Did you mean: 

PO creation using LSMW through batch input method

Former Member
0 Kudos

Hi, I am new to working with LSMW and i have completed a project for creating purchase orders using the direct data input method. I need to do the same using batch input method, however in the maintain structure relationship step, it is only allowing me to assign one structure to the recording that i have done, however in po creation we need separate (nested) structure for header and line item, could anybody help me past this please?

Accepted Solutions (1)

Accepted Solutions (1)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Rudra!

Transaction ME21 is little bit old and transaction ME21N (because of enjoy technic) can't be handled correctly by batch input. What did you record?

To your question: you have a fixed number of positions in your recording, that's what you can fill currently. If you want to have a dynamical number of positions, you need to have a dynamical creation of the necessary lines of the batch -> use the standard direct input or the BAPI method.

Regards,

Christian

Former Member
0 Kudos

Hi Christian,

I used ME21 for the recording, and of course i have done the same with direct input, was just trying to figure out if it was possible to create transaction data in LSMW like purchase orders or sales orders using batch input, i have used batch input method to create master data like material master and customer master.

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Rudra!

OK, now you just know, why you have only one line, not multiple PO item lines. To get a dynamic number of items, you need a complex program - just like standard direct input.

If you need a field, which is not part of this program, don't try to write your own program for batch input - it's just to much work before you have a good result.

You can use Bapi method instead with BAPI_PO_CREATE1. This can handle a lot of fields and there is some documentation available how to fill the Bapi.

If this looks to complicated in the first moment, think about creation of POs via direct input and a small batch recording to change your additional field(s) afterwards. (You can select EKPO table to generate list of 'wrong' migrated orders for input in LSMW.) Use field 'Item' in the bottom of ME22 to position your desired line in first screen line, just change one PO-line after one other (every time a 'save' -> no problem with different number of lines / PO).

Regards,

Christian

Answers (1)

Answers (1)

Former Member
0 Kudos

hi, in my opinion the best solution is using BAPI way in your LSMW project.

But if you really need to keep using Batch Input, it also can be achieved.

List the main steps as following:

1. Record the BDC script

2. Create <b>two</b> source structure. Let assume SRC1 & SRC2

3. assign one source structure to the BDC target strutcture E.G. SRC1 to TAR1.

4. in the data mapping setting, add code for the item level field like this:

read table SRC2 (index , with key)

TAR1-XXX = SRC2-XXXX.

Then your requirements can be achieved.

Please aware that LSMW will fill the source structure like a internal table in the mapping process. So you can use a READ TABLE action to read the proper record, even you haven't assign this source struct to Target Structure, you still can use it.

Hope this reply will give you some sense.

thanks

Former Member
0 Kudos

hi, thanks for the response, i will definitely try this out and let you know.