Uploading data using lsmw

2008 August 21
tags: ,
by Tresna

Imagine that you have thousands of material data and you need to change the storage location field on each of them or you have tons and tons of cost center to be allocated. To manually do it one by one is, of course, out of the question. How much time and energy would be needed to accomplish it?

There are a couple of options to take. First, you could make an abap program to upload the data simultaneously through a file, this is of course if there is an abap programmer availabe or you are willing to hire one.

The second option is to use one of SAP functionality called Legacy System Migration Workbench with transaction code lsmw. LSMW is easy to use and you don’t need to have any knowledge on programing, though basic understanding on data structures would be an advantage.


After inserting tcode lsmw you will be presented with a screen containing Project, Sub Project, and Object field. Fill all the fields to create lsmw object.

Next, you will be presented with a series of process, like following:

  1. Mantain object attributes
    In this process a recording of a certain tcode that is usually used to input the data manually is needed. For example, if we want to upload data GL, then we use recording of tcode fs00. Choose Batch Input Recording, then select one of recording available or create a new one.
    The result of the recording are a target structure that contains series of screen to be inputed in the related tcode and screen fields that represent the data that are going to be uploaded. Select only the necessary field and remove the rest.
  2. Maintain source structure
    Create a structure that will represent data to be uploaded using tcode fs00.
  3. Maintain source fields
    In this process we will define fields of data that are going to be uploaded. Each fields must be defined in the same order with fields in uploaded file.
  4. Maintain structure relations
    Define the link of the target structure with source structure.
  5. Maintain field mapping and conversion rules
    Define the source of each field in the target structure. These fields could be linked from source structure fields (meaning the value will be taken from the uploaded file), or could be statistically defined with a fixed value or a function.
  6. Maintain fixed values, translations, user-defined routines
    This step could be skipped if there is none of the above used.
  7. Specify file
    Select the file to be uploaded, in this process you will also define the detail spesification of the file, such as the file type and delimiter used in the file.
  8. Asign file
    Create assignment between the selected file and source structure.
  9. Read data
    Check whether the amount of read and written data is equal with the amount of data in your file.
  10. Display read data
    Check whether all the data read is equal to the data uploaded
  11. Convert data
    Check if all data are succesfully converted to target structure.
  12. Display convert data
    Check if the target fields are correct, some type of data like date and time may result error in data conversion.
  13. Create batch input session
  14. Run batch input session

Repeat step 7 to step 14 to upload another file using the same lsmw object.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS