65
DATA MIGRATION IN SAP USING LSMW (Batch Input Recording Method) 17 November 2011 CA Swapnil Chavda [email protected] SAP- Shared Services Gandhinagar

LSMW Training Document

Embed Size (px)

Citation preview

DATA MIGRATION IN SAP USING LSMW (Batch Input Recording Method)

17 November 2011

CA Swapnil [email protected] Shared ServicesGandhinagar

DATA MIGRATION IN SAP USING LSMW

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.

In this document we cover the creation of a Vendor master data with accounting view.

INTERNAL USE 2

DATA MIGRATION IN SAP USING LSMW

Contents

Create Project, Sub-project & Object...........................................................................41. Maintain Object Attributes.......................................................................................62. Maintain Source Structures....................................................................................203. Maintain Source Fields...........................................................................................224. Maintain Structure Relations.................................................................................305. Maintain Field Mapping and Conversion Rules.....................................................316. Maintain Fixed Values, Translations, User-Defined Routines.................................377. Specify Files...........................................................................................................388. Assign Files............................................................................................................449. Read Data.............................................................................................................4510. Display Read data.................................................................................................4711. Convert Data........................................................................................................4912. Display Converted Data........................................................................................5113. Create Batch Input Session...................................................................................5314. Run Batch Input Session.......................................................................................54

INTERNAL USE 3

DATA MIGRATION IN SAP USING LSMW

Create Project, Sub-project & ObjectIn 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.

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 4

DATA MIGRATION IN SAP USING LSMW

Click OK

Click OK

Click on execute button.

INTERNAL USE 5

DATA MIGRATION IN SAP USING LSMW

1. Maintain Object Attributes

There are the various steps for making a LSMW.

These steps vary according to the method which we select in the step no. 1

For Eg: Direct data input method, Batch Input recording Method, etc

Now, Click

INTERNAL USE 6

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 7

DATA MIGRATION IN SAP USING LSMW

Below mentioned screen would appear:

We need to create a new recording for vendor upload (FK01).

Click on button which would bring the following screen.

The name & description of the recording is mandatory.

Click enter

Enter the transaction code for which we want to create a recording.

Here for creating vendor master data, the transaction code is FK01 so we have entered that.

INTERNAL USE 8

DATA MIGRATION IN SAP USING LSMW

Click enter .

Enter the relevant details that are necessary. These parameters may vary upon the organisation.

Click Enter.

Enter the necessary details and click enter.

INTERNAL USE 9

DATA MIGRATION IN SAP USING LSMW

Click enter.

INTERNAL USE 10

DATA MIGRATION IN SAP USING LSMW

Click enter

Click enter

INTERNAL USE 11

DATA MIGRATION IN SAP USING LSMW

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

Click Yes.

INTERNAL USE 15

DATA MIGRATION IN SAP USING LSMW

Click on Default All button.

The details that we have entered have been arranged in a structured format according to the screens.

For Eg: ‘SAPMF02K 0100’ is the first screen & so on.

INTERNAL USE 16

These are the details that we have entered while executing the T-Code FK01.

DATA MIGRATION IN SAP USING LSMW

By clicking on , the highlighted information would appear automatically.

These are nothing but the English names of the corresponding fields.

For Eg: BUKRS- ‘Company code’.

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.

For Eg: LFA1-NAME1- ‘test’.

Click on Save

INTERNAL USE 17

DATA MIGRATION IN SAP USING LSMW

Click on

Click on Batch input recording radio button and assign the created recording.

For Eg: We have made a recording named Vendor upload so we just need to select the recording and assign to the recording.

INTERNAL USE 18

DATA MIGRATION IN SAP USING LSMW

Click on and then

INTERNAL USE 19

DATA MIGRATION IN SAP USING LSMW

2. Maintain Source Structures

Maintain source structure would automatically be selected. We can see the radio button has come to the next step.

Now click on

We need to define a source structure. The significance of creating source structure is to create a hierarchy level.

Click on and then on .

INTERNAL USE 20

DATA MIGRATION IN SAP USING LSMW

The source structure ‘Vendors’ is created.

Click on

INTERNAL USE 21

DATA MIGRATION IN SAP USING LSMW

3. Maintain Source Fields

The third step is regarding creating the source fields.

Source fields are generally created by us. In other words, source fields are nothing but the column names of our excel file.

Click on execute .

Click on and then click on

INTERNAL USE 22

DATA MIGRATION IN SAP USING LSMW

There are four columns in the above table.

FIELD NAME

The first column is about the field name. In this field we need to enter the technical name of the data that we need to maintain. There is one restriction to this column. We can’t maintain any data with spaces.

It’s recommended to maintain technical names as it makes easy to map the source fields in the next step.

Even though, the technical names are not maintained, there won’t be any problem in creating LSMW

TYPE

Second column is type.

Here we can decide whether the field is number, character, date, etc.

LENGTH

Third column is about the length of the source field. Here you can give the appropriate length to the source fields. For Eg: Company code- length would be 4 characters.

FIELD DESCRIPTION

Fourth Column is about the description.

This column is for our reference. We just need to give a description of the field names.

Spaces are allowed in this colum.

INTERNAL USE 23

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, the below mentioned procedure proves out to be very helpful.

Click on object overview tab.

Click on table button.

INTERNAL USE 24

DATA MIGRATION IN SAP USING LSMW

Here we can get the readymade table along with the technical names as well as all the details that we require for creating the source fields.

Now just select the above details and copy & paste it to excel sheet as follows.

For copying the data, you need to start from the company code ie BUKRS.

Table name and Tcode are not relevant for creating the source fields so you just need to leave those two fields.

INTERNAL USE 25

DATA MIGRATION IN SAP USING LSMW

Now we need to modify this table according to the requirement of the SAP.

So for this, we need to shift the columns B, C & D.

We need to interchange the columns and make it as A, C, D & B instead of A, B, C & D.

INTERNAL USE 26

DATA MIGRATION IN SAP USING LSMW

We can see that the columns have been re arranged according to the format of SAP.

Now one more change that needs to be incorporated in column B.

The source fields are to be assigned a specific character type.

In this table, the type is maintained as CHAR that means it includes number, special characters, alphabets, symbols, etc.

If we want to restrict the specific character type we can assign C, N, DDMM, etc.

Generally, C is maintained in all the source fields which cover all character type.

So instead of CHAR, C is to be maintained as CHAR is not accepted in the SAP.

INTERNAL USE 27

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 28

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

The table which we had maintained has been converted into a structured format.

Click on and .

INTERNAL USE 29

DATA MIGRATION IN SAP USING LSMW

4. 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.

Click on

Click on and then on . Here we can see that VENDORS have been assigned to the VEN_UPLOAD.

Click on

INTERNAL USE 30

DATA MIGRATION IN SAP USING LSMW

5. Maintain Field Mapping and Conversion Rules

Click on execute

INTERNAL USE 31

DATA MIGRATION IN SAP USING LSMW

The above are the fields which we have to map with our source fields.

So for that, click on and then put the cursor on the first field and then click on

.

INTERNAL USE 32

DATA MIGRATION IN SAP USING LSMW

The following screen would appear when clicked on source field.

Now, we need to map the source fields with the fields that are already there in SAP.

The first field was company code so we need to map company code (Source field) to the Company code (SAP field).

So for that, double click on company code.

INTERNAL USE 33

DATA MIGRATION IN SAP USING LSMW

We can see the company code have been mapped with the source field BUKRS.

We need to repeat the procedure for all the fields ie Vendor account group, Title, Name, etc.

So after mapping all the fields with the respective source fields, following screen would appear.

INTERNAL USE 34

DATA MIGRATION IN SAP USING LSMW

We can see that all fields are mapped with the relevant source fields.

NOTE: This method is cumbersome.

In order to make it simple, you can use auto fields mapping also.

For that you need to go to Extras>> Auto field Mapping.

INTERNAL USE 35

DATA MIGRATION IN SAP USING LSMW

Keep pressing enter until the dialogue box disappears.

By doing this procedure, all the fields are automatically mapped to the relevant source fields.

This is just a secondary method to map the source fields.

INTERNAL USE 36

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 37

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 38

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 39

DATA MIGRATION IN SAP USING LSMW

Click on transpose. And select ok.

This will paste the content horizontally.

Now by this way, the format of the excel file has been made. In other words, we can now maintain the data (which is to be uploaded) in the excel file.

Now, in order to upload the vendor master data, we have fed the details of the vendor in the excel file.

Now the next step is to convert the excel file into a notepad file.

Since LSMW doesn’t recognise the excel format, it needs to be converted into notepad file.

So copy all the data and paste it to the notepad and save it on your local system.

INTERNAL USE 40

DATA MIGRATION IN SAP USING LSMW

The data which we have copied would be pasted in a haphazard form. But it would not affect the file.

Now go to specify files

Click execute

Click on

INTERNAL USE 41

DATA MIGRATION IN SAP USING LSMW

Now double click on Legacy data on the PC (Front end).

Here you need to assign the notepad file that we created in the earlier step.

The system will fetch the data from the notepad file and will convert it into the technical format.

INTERNAL USE 42

DATA MIGRATION IN SAP USING LSMW

Here we need to assign the notepad file. Name of the file is also need to be given. Since the file that we have created has been made in excel, we need to select the TABULOR radio button.

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.

So by ticking this check box, the system will not consider the first row in the file. It will start reading the data from the second row (because first row is nothing but the column headings).

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 43

DATA MIGRATION IN SAP USING LSMW

8. Assign Files

After specifying the files, we need to assign the file to the structure.

Click on and

Message would be displayed .

INTERNAL USE 44

DATA MIGRATION IN SAP USING LSMW

9. Read Data

Click on execute

Click on

INTERNAL USE 45

DATA MIGRATION IN SAP USING LSMW

Here we can see one record has been read. It means that our file contains one row of master data.

INTERNAL USE 46

DATA MIGRATION IN SAP USING LSMW

10. Display Read data

Click on execute

Click

INTERNAL USE 47

DATA MIGRATION IN SAP USING LSMW

Click on the line item

This is the data that is fetched from the notepad file.

When the green colour is highlighted, it shows that the data is fetched correctly.

INTERNAL USE 48

DATA MIGRATION IN SAP USING LSMW

11. Convert Data

Click on execute

Click on execute

INTERNAL USE 49

DATA MIGRATION IN SAP USING LSMW

We can see that the records have been read and the data have been successfully converted.

INTERNAL USE 50

DATA MIGRATION IN SAP USING LSMW

12. Display Converted Data

Click on execute

Click enter

Click on any line item

INTERNAL USE 51

DATA MIGRATION IN SAP USING LSMW

The data is successfully converted.

INTERNAL USE 52

DATA MIGRATION IN SAP USING LSMW

13. Create Batch Input Session

Click on execute

Click on execute

Click on

INTERNAL USE 53

DATA MIGRATION IN SAP USING LSMW

14. Run Batch Input Session

Click on execute

One batch has been generated.

Now select the batch and click on

INTERNAL USE 54

DATA MIGRATION IN SAP USING LSMW

Click on process

After executing the batch, 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.

Click on enter

INTERNAL USE 55

DATA MIGRATION IN SAP USING LSMW

Click enter

INTERNAL USE 56

DATA MIGRATION IN SAP USING LSMW

Click on enter

INTERNAL USE 57

DATA MIGRATION IN SAP USING LSMW

Click enter

INTERNAL USE 58

DATA MIGRATION IN SAP USING LSMW

Click execute

Click execute

Finally, the batch has been successfully executed and the vendor master has been uploaded in the system.

This is the way by which we can upload the data via LSMW.

Batch job can also be scheduled in background to avoid manual steps.

Thousands of vendor masters can be uploaded with the help of LSMW, in minutes.

No doubt, the making of LSMW seems to be a lengthy process but it’s not actually the same.

INTERNAL USE 59