Skip to Content

Regarding LSMW PO upload

Dear SAP world

My query is using BAPI option with IDOC I am creating Purchase order where I have used external number range for PO. in additiion to that PO will contains multiple line item with account assignment P or Q with WBS element per line item also I am having three or multiple condition types and three or multiple condition rates per line item meaning

PO number -4100000000

Pur Org - XXXX you can use your own

Pur Group - XXX you can use your own

Company Code - XXXX you can use your own

your reference

Our reference

line iem 00010

account assignment category P

Material number 13/1001

Qty 1000

UOM EA

Order price unit EA

Price per unit 1

Price 120

Currency INR

Plant - XXXX you can use your own

Storage location - XXXX you can use your own

requisitioner say any number you can use

agreement number - XXXXXXXXXX

Agreement line item number - XXXXX

WBS element - DB- CNB1-13-51-01-01 fourth level WBS from Cj20N

GR receipt yes

GR non valuated - Yes\

Invoice receipt - yes

Tax code - XX you can use your own

condition 1 - surcharge

condition 1 rateor value - 2 %

condition 2 - discount

condition 2 rate or value -3 %

condition 3 - discount

condition 3 rate or value -3%

then line item 20 and line item 30 with same data

I want to upload this much data using BAPI/ IDOC with Po external number range I was able to create PO with multple line item using this LSMW BAPI/IDOC option but the issue here is multiple conditions are not appearing in line item 10 20 30 and price is getting copied incorrectly for line item 20 and 30

in addition to that we wanted to copy deleted items from PO as it is in next system

meaning PO 4100000000 has line 10 20 30 40 out of which line item 40 is deleted now in backend table LOEKZ fields gets updated for line item 40

if we do this manually meaning if we create a PO manually by ME21N with line item 10 20 30 & 40 and at the same time if we put deletion indicator at line item 40 , PO gets created but line item 40 still appears with deleted sign. we wanted to have exactly the same case to be happened through LSMW PO upload.

Right now if I put X in LOEKZ fied in my template LSMW ignores that line item and PO gets created with line item 10 20 & 30 only

Can any one help me please

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 06, 2017 at 12:40 PM

    The BAPI's are developed to support day by day business cases. Migration of data is an extraordinary event.

    LSMW is just a toolbox to describe source and target, to create relations and mapping and finally to generate a load program that makes use of all kind of long existing features like the BAPI.

    It is not at all logical to create a new PO with deleted items. From a logical sequence you have to create something before you can delete it, or you just leave it away as it is not needed.

    see KBA 2006419 - BAPI_PO_CREATE1 does not create items with deletion indicator set (DELETE_IND = 'L')

    Add comment
    10|10000 characters needed characters exceeded

    • Jürgen L Mandar Shashikant Sathe

      Can you (and your decision makers) really afford to search a full month for an answer and potentially hold up a migration project? I did already 200 migrations this year and it is not over yet and the year has just 230 work days, I could not wait a month to hope that someone might have a solution for something that is not possible in SAP standard.

      I can't really imagine what you mean by 2 files and what is so difficult to have them if they are needed.

      From your input so far I imagine that you very much know what items have a deletion indicator.

      So just copy this file, take the original and remove all deletion indicators and load it as if all items were valid.

      Then take the copy and filter just those with the deletion indicator and remove the rest, you can even remove all fields except purchase order number and items number and just create a small simple LSMW to set a deletion indicator to all PO items in SAP that are in this file. I consider this as a 1 hour task for developing the LSMW and to do a test. The final run time may be much longer depending how many thousand POs you have to migrate.