LSMW – tips and tricks 1

You need to update thousands of objects (material, vendor, equipment, BOM, … ), but you are not sure if some field should be updated or not. So, my tip is: leave the decision to your source file.

(if you don´t know how to use LSMW, please check the post LSMW – tutorial)

There is a checkbox in SAP LSMW program that can be useful in this situation: it allows the LSMW to choose to update the field if the source field is not empty (or “initial”, according to ABAP syntax).

Please check it at: LSMW > Maintain Field Mapping and Conversion Rules.

Select a field and click on “Rule” button:

2015-04-16 10_41_58-LSM Workbench_ Change Field Mapping and Conversion Rules

Choose “Transfer (MOVE)” and flag “Only if Source Field Not Initial”:

2015-04-16 10_49_04-LSM Workbench_ Change Field Mapping and Conversion Rules

LSMW will create an ABAP code for you:

2015-04-16 10_51_52-LSM Workbench_ Change Field Mapping and Conversion Rules

Now, when you run the LSWM to update your objects, this field will be updated only if the field in your Excel file (or text file) is not blank.

Again: now who “controls” the LSWM is the Excel (source) file:

2015-04-16 11_02_44-Microsoft Excel - PRS.xlsx

Tip #2:

You can change the ABAP code suggested by the LSMW:

2015-04-16 11_02_45-Microsoft Excel - PRS.xlsx

In the given example, the LSMW program would:

  • If the source field has some content, it will update the SAP field
  • If the source field is empty, it will update the SAP field with “blank”
  • If the source field has “DONTUPDATE”, then LSMW will not update the SAP field.


This entry was posted in LSMW, SAP - General use and tagged , , , , , , , . Bookmark the permalink.

3 Responses to LSMW – tips and tricks 1

  1. aagnasoft says:

    Great information. Thank you so much
    sap fico online training in usa


  2. Cesar Salazar says:

    Great information, but for example I need to populate one field (requisitioner field) in a list of orders that already exist in SAP (2,000 orders) but we don’t know which of this have that field empty, is there a way using that SAP skip all the orders that already have data in that field and just update the ones that are empty?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s