You are on page 1of 61

2565lsmw

DATA MIGRATION IN SAP USING LSMW

1DATA MIGRATION SAP USING
IN
LSMW
(Batch Input Recording Method)
17 November 2011

INTRODUCTION
LSMW an abbreviation for Legacy System Migration Workbench is a
tool in SAP which is used to migrate. Legacy data to SAP.
It is a very important tool and easy to learn and master
it.
LSMW has a recording tool which can record the transaction and the
fields to be uploaded.
Thus upload of master data and transaction data is made very simple in
this tool. You can use this tools in almost all modules for upload
of master data and too some extent transaction data also.
Thus, in FI you can upload the following master data through this
tool:
o Vendors, Customers, General Ledger, Asset master, Bank Master. You can
upload Transactional data through this i.e. an FI document.
o In MM, you can upload Material masters, Vendor masters, Info records
and various condition records relevant to pricing and out determination.
o In CO, you can upload the following master data:
o Cost element, Cost center, Profit center, Activity types, Internal orders,
Statistical key figures
o In other modules likewise you can upload other sets of relevant master
data.
INTERNAL USE

2

DATA MIGRATION IN SAP USING LSMW
In this document we cover the creation of a Vendor master data with
accounting view.

INTERNAL USE

INTERNAL USE

2

3

DATA MIGRATION IN SAP USING LSMW

Contents
Create Project, Sub-project & Object...................................................................................................4
1. Maintain Object Attributes...............................................................................................................6
2. Maintain Source Structures............................................................................................................20
3. Maintain Source Fields...................................................................................................................22
4. Maintain Structure Relations..........................................................................................................30
5. Maintain Field Mapping and Conversion Rules.............................................................................31
6. Maintain Fixed Values, Translations, User-Defined Routines........................................................37
7. Specify Files...................................................................................................................................38
8. Assign Files....................................................................................................................................44
9. Read Data.......................................................................................................................................45
10. Display Read data.........................................................................................................................47
11. Convert Data.................................................................................................................................49
12. Display Converted Data...............................................................................................................51
13. Create Batch Input Session...........................................................................................................53
14. Run Batch Input Session..............................................................................................................54

INTERNAL USE

4

Object is just the name of the LSMW that we are creating. Go to SAP Basic screen and type LSMW in the command field. LSMW screen would appear as follows: Click on New icon INTERNAL USE 5 .DATA MIGRATION IN SAP USING LSMW Create Project. Sub-project & Object In order to create a LSMW. we need to create a Project & Sub-project. The significance of creating Project & Sub-project is to create a location where we can save the LSMW. For Eg: If we want to create a LSMW for uploading vendors then we can create a Project as FINANCE and Sub-project as VENDOR UPLOAD.

INTERNAL USE 6 .DATA MIGRATION IN SAP USING LSMW Click OK Click OK Click on execute button.

Click INTERNAL USE 7 . Maintain Object Attributes There are the various steps for making a LSMW. Batch Input recording Method.DATA MIGRATION IN SAP USING LSMW 1. 1 For Eg: Direct data input method. etc Now. These steps vary according to the method which we select in the step no.

DATA MIGRATION IN SAP USING LSMW Click on Batch Input recording radio button as we need to record the transaction for vendor upload. Click on INTERNAL USE 8 .

Here for creating vendor master data. the transaction code is FK01 so we have entered that.DATA MIGRATION IN SAP USING LSMW Below mentioned screen would appear: We need to create a new recording for vendor upload (FK01). 9 INTERNAL USE . Click enter Enter the transaction code for which we want to create a recording. Click on button which would bring the following screen. The name & description of the recording is mandatory.

Enter the necessary details and click enter. Enter the relevant details that are necessary. INTERNAL USE 10 .DATA MIGRATION IN SAP USING LSMW Click enter . Click Enter. These parameters may vary upon the organisation.

INTERNAL USE 11 .DATA MIGRATION IN SAP USING LSMW Click enter.

DATA MIGRATION IN SAP USING LSMW Click enter Click enter INTERNAL USE 12 .

DATA MIGRATION IN SAP USING LSMW Click enter INTERNAL USE 13 .

DATA MIGRATION IN SAP USING LSMW Click enter INTERNAL USE 14 .

DATA MIGRATION IN SAP USING LSMW Click enter INTERNAL USE 15 .

INTERNAL USE 16 .DATA MIGRATION IN SAP USING LSMW Click Enter Click Yes.

The details that we have entered have been arranged in a structured format according to the screens.DATA MIGRATION IN SAP USING LSMW These are the details that we have entered while executing the T-Code FK01. INTERNAL USE 16 . For Eg: ‘SAPMF02K 0100’ is the first screen & so on. Click on Default All button.

Click on Save INTERNAL USE 17 . These are nothing but the English names of the corresponding fields. For Eg: LFA1-NAME1. the highlighted information would appear automatically. For Eg: BUKRS. The data that is visible corresponding to the technical names in the white fields is just the actual data that we have entered during the recording.‘Company code’.‘test’.DATA MIGRATION IN SAP USING LSMW By clicking on .

For Eg: We have made a recording named Vendor upload so we just need to select the recording and assign to the recording.DATA MIGRATION IN SAP USING LSMW Click on Click on Batch input recording radio button and assign the created recording. INTERNAL USE 18 .

DATA MIGRATION IN SAP USING LSMW Click on and then INTERNAL USE 19 .

The significance of creating source structure is to create a hierarchy level. Now click on We need to define a source structure. INTERNAL USE 20 . We can see the radio button has come to the next step. Click on and then on . Maintain Source Structures Maintain source structure would automatically be selected.DATA MIGRATION IN SAP USING LSMW 2.

DATA MIGRATION IN SAP USING LSMW The source structure ‘Vendors’ is created. Click on INTERNAL USE 21 .

In other words. and then click on INTERNAL USE 22 . Source fields are generally created by us.DATA MIGRATION IN SAP USING LSMW 3. source fields are nothing but the column names of our excel file. Maintain Source Fields The third step is regarding creating the source fields. Click on execute Click on .

It’s recommended to maintain technical names as it makes easy to map the source fields in the next step. there won’t be any problem in creating LSMW TYPE Second column is type. FIELD NAME The first column is about the field name.DATA MIGRATION IN SAP USING LSMW There are four columns in the above table. For Eg: Company code. etc. FIELD DESCRIPTION Fourth Column is about the description. INTERNAL USE 23 . LENGTH Third column is about the length of the source field. Spaces are allowed in this colum. Here you can give the appropriate length to the source fields. We just need to give a description of the field names.length would be 4 characters. In this field we need to enter the technical name of the data that we need to maintain. date. This column is for our reference. We can’t maintain any data with spaces. character. the technical names are not maintained. Even though. Here we can decide whether the field is number. There is one restriction to this column.

the below mentioned procedure proves out to be very helpful. Click on object overview tab. Click on table button.DATA MIGRATION IN SAP USING LSMW Creating source fields and maintaining the technical names of each source field is a very clumsy process. In order to overcome that problem. INTERNAL USE 24 .

Page no 25 DATA MIGRATION IN SAP USING LSMW INTERNAL USE 25 .

DATA MIGRATION IN SAP USING LSMW Select Generate The original file would be The above has to be formatted like below INTERNAL USE 26 .

So save as new file like below After saving this and change the format like this INTERNAL USE 27 .DATA MIGRATION IN SAP USING LSMW While saving the above format is not supported.

C is to be maintained as CHAR is not accepted in the SAP. Generally. The source fields are to be assigned a specific character type. So instead of CHAR. special characters. N. the type is maintained as CHAR that means it includes number. C is maintained in all the source fields which cover all character type.DATA MIGRATION IN SAP USING LSMW We can see that the columns have been re arranged according to the format of SAP. In this table. symbols. alphabets. etc. Now one more change that needs to be incorporated in column B. etc. DDMM. INTERNAL USE 28 . If we want to restrict the specific character type we can assign C.

DATA MIGRATION IN SAP USING LSMW INTERNAL USE 29 .

DATA MIGRATION IN SAP USING LSMW Now copy the whole table and paste it to the table in the third step of the LSMW. (Go to third step ie Maintain Source fields >> click on >> Click on INTERNAL USE 30 .

DATA MIGRATION IN SAP USING LSMW Now we can see that the table has been perfectly set in the ‘maintain source fields table’. Click on and . Click on and The table which we had maintained has been converted into a structured format. INTERNAL USE 31 .

Maintain Structure Relations In this step. we need to assign the source fields (which we have created in the third step) to the Source structure. .DATA MIGRATION IN SAP USING LSMW 4. Here we can see that VENDORS have been assigned to the Click on INTERNAL USE 32 . Click on Click on and then on VEN_UPLOAD.

DATA MIGRATION IN SAP USING LSMW 5. Maintain Field Mapping and Conversion Rules Click on execute INTERNAL USE 33 .

INTERNAL USE 34 . So for that. click on and then put the cursor on the first field and then click on .DATA MIGRATION IN SAP USING LSMW The above are the fields which we have to map with our source fields.

So for that.DATA MIGRATION IN SAP USING LSMW The following screen would appear when clicked on source field. double click on company code. we need to map the source fields with the fields that are already there in SAP. INTERNAL USE 35 . The first field was company code so we need to map company code (Source field) to the Company code (SAP field). Now.

So after mapping all the fields with the respective source fields. Name. We need to repeat the procedure for all the fields ie Vendor account group. following screen would appear.DATA MIGRATION IN SAP USING LSMW We can see the company code have been mapped with the source field BUKRS. Title. INTERNAL USE 36 . etc.

INTERNAL USE 37 . For that you need to go to Extras>> Auto field Mapping. NOTE: This method is cumbersome. you can use auto fields mapping also. In order to make it simple.DATA MIGRATION IN SAP USING LSMW We can see that all fields are mapped with the relevant source fields.

By doing this procedure. INTERNAL USE 38 .DATA MIGRATION IN SAP USING LSMW Keep pressing enter until the dialogue box disappears. all the fields are automatically mapped to the relevant source fields. This is just a secondary method to map the source fields.

DATA MIGRATION IN SAP USING LSMW

6. Maintain Fixed Values, Translations, User-Defined Routines

This step is irrelevant. So we can skip this step.

INTERNAL USE

39

DATA MIGRATION IN SAP USING LSMW

7. Specify Files

Click on

For assigning the file, we need to make a file first.
For making a file in a specific format, we need to follow below mentioned steps:
We need the excel sheet which we created previously (at the time of making source field)
INTERNAL USE

40

DATA MIGRATION IN SAP USING LSMW
Below is the excel sheet which we created earlier.

Now select the column D and copy it.
Open a new sheet in excel and do the following.
Right click on any of the cell and click on paste special.

INTERNAL USE

41

Now by this way. we have fed the details of the vendor in the excel file. And select ok. In other words. Now the next step is to convert the excel file into a notepad file. the format of the excel file has been made. INTERNAL USE 42 . Since LSMW doesn’t recognise the excel format. Now. So copy all the data and paste it to the notepad and save it on your local system. in order to upload the vendor master data.DATA MIGRATION IN SAP USING LSMW Click on transpose. we can now maintain the data (which is to be uploaded) in the excel file. it needs to be converted into notepad file. This will paste the content horizontally.

Now go to specify files Click execute Click on INTERNAL USE 43 . But it would not affect the file.DATA MIGRATION IN SAP USING LSMW The data which we have copied would be pasted in a haphazard form.

INTERNAL USE 44 . Here you need to assign the notepad file that we created in the earlier step.DATA MIGRATION IN SAP USING LSMW Now double click on Legacy data on the PC (Front end). The system will fetch the data from the notepad file and will convert it into the technical format.

It will start reading the data from the second row (because first row is nothing but the column headings). the system will not consider the first row in the file. So by ticking this check box. we need to select the TABULOR radio button. Name of the file is also need to be given. Field Names at the start of file is ticked as we have copied the column names along with the master data. in the notepad file. If this check box is not ticked then the system will start reading the data from the first row itself. Click on Click on and INTERNAL USE 45 . Since the file that we have created has been made in excel.DATA MIGRATION IN SAP USING LSMW Here we need to assign the notepad file.

INTERNAL USE 46 .DATA MIGRATION IN SAP USING LSMW 8. Click on and Message would be displayed . Assign Files After specifying the files. we need to assign the file to the structure.

Read Data Click on execute Click on INTERNAL USE 47 .DATA MIGRATION IN SAP USING LSMW 9.

It means that our file contains one row of master data. INTERNAL USE 48 .DATA MIGRATION IN SAP USING LSMW Here we can see one record has been read.

10. Display Read data DATA MIGRATION IN SAP USING LSMW Click on execute Click Click on the line item INTERNAL USE 49 .

When the green colour is highlighted.DATA MIGRATION IN SAP USING LSMW This is the data that is fetched from the notepad file. it shows that the data is fetched correctly. INTERNAL USE 50 .

DATA MIGRATION IN SAP USING LSMW 11. Convert Data Click on execute Click on execute INTERNAL USE 51 .

INTERNAL USE 52 .DATA MIGRATION IN SAP USING LSMW We can see that the records have been read and the data have been successfully converted.

12. Display Converted Data DATA MIGRATION IN SAP USING LSMW Click on execute Click enter Click on any line item INTERNAL USE 53 .

DATA MIGRATION IN SAP USING LSMW The data is successfully converted. INTERNAL USE 54 .

Create Batch Input Session DATA MIGRATION IN SAP USING LSMW Click on execute Click on execute INTERNAL USE 55 .13.

Now select the batch and click on INTERNAL USE 56 . Run Batch Input Session Click on execute One batch has been generated.Click on DATA MIGRATION IN SAP USING LSMW 14.

you can see that the Tcode FK01 has been displayed and the data which we have maintained in the excel sheet have been successfully inputted in the relevant fields in the screen.DATA MIGRATION IN SAP USING LSMW Click on process After executing the batch. Click on enter INTERNAL USE 57 .

DATA MIGRATION IN SAP USING LSMW Click enter INTERNAL USE 58 .

DATA MIGRATION IN SAP USING LSMW Click on enter INTERNAL USE 59 .

DATA MIGRATION IN SAP USING LSMW Click enter INTERNAL USE 60 .

Batch job can also be scheduled in background to avoid manual steps. This is the way by which we can upload the data via LSMW. INTERNAL USE 61 .DATA MIGRATION IN SAP USING LSMW Click execute Click execute Finally. the making of LSMW seems to be a lengthy process but it’s not actually the same. in minutes. Thousands of vendor masters can be uploaded with the help of LSMW. the batch has been successfully executed and the vendor master has been uploaded in the system. No doubt.