sap data migration using lsmw bdc and bapi

Learn sap data migration using lsmw, bdc and bapi

             Data migration is the process of migrating (transferring) of data from one system to another. 

It is a key consideration for any system implementation, upgrade or consolidation.

              Data migration process required in depth planning , about what data to be transfer, the sequence of the data transfer, field mapping, conversion rules etc.


Which types of data are transfer ?

Master Data like material master, vendor master, customer master, bill of material etc.
Transaction Data like open purchase order, sales order, vendor & customer account balance etc.

When Data Migration is use?

       Data migration required when a company doing new sap implementation and they want to transfer all data from there non sap system to sap or if they want to move to  S4HANA from there exiting SAP ECC system

      Data migration technique is also use on periodic data processing , for creating of master data, for which the data is gathered through some campaign, or if a company is using other small scale software's along with sap, in this case mostly data is load in sap from FTP servers    

  Analysis :  Before transferring data do the analysis , whether we want to move all data or some specific data of material , vendor, customer , etc. through which we have done some transaction in past, 2,3 years depending of nature of business.

Extract data : Extract the data from non sap system

Clean the data : Clean the data , by applying some filter criteria like incomplete address of customer , vendor etc., open purchase order , sales order, but no further processing required, it is like short close.

Design :  Prepare a technical design approach , whether we want to upload data as it is which is received from source system and do the required mapping , conversion in sap system or after extracting data from non sap we are making source file as per sap format etc.

Read data into sap : Generally a text file is prefer to read the data into sap.

Data mapping and conversion : The fields and length of read data may not be in the actual sap format or there might be some additional field in the imported data, so as per our design , we have do the field mapping, write the conversion rule, like e, g unit of measure in the source system may be different , then the unit of measure in sap system, the format of mobile number in source may be different, they might have country code field separately and number separate in sap , we have one field for mobile numbers etc, the country id in source can be different , then that is in sap.

Load in to SAP DB :  Load the data into SAP DB.

Reconcile :  After loading data, do the reconciliation , how many records, we have upload and the created one.

Different Tools Use for data migration ?

1.LSMW   - Legacy system migration workbench
2.BDC       - Batch data communication
3.BAPI      - Business application programming interface 


  Those migration methods are common in both SAP ECC and SAP S4HANA

We can also use web service and IDOC , but both are mostly prefer for periodic processing rather than  migration and also for IDOC we required a middleware server.

    In S4 HANA sap has provided new migration tools like LTMC, LTMOM which are known as Legacy transfer migration cockpit and Migration object modeler 


Legacy system migration workbench


              It is a workbench for data migration , first choice for data migration , it can be use by both functional and technical consultant, LSMW provide 4 different methods of migration,  it can be use with any DB , but first the data need to be downloaded into text files and then text files as per sap format are uploaded in sap, it cannot be connect directly to any third party software or DB.

Transaction Code : LSMW

On Initial screen , we have to give id for project, subproject, object.

      It is better to follow proper naming convention , for easy identification.

      MM->Master Data->Material

      MM->Master Data->Vendor


      SD->Pricing->Base Price


There are total 14 steps to be process in LSMW , first 6 steps are designing part, and remaining 8 are execution part.

              For any new process first 6 steps are mandatory, after that for migrating same data , we can use only execution part as the design is already ready.


  Select the Maintain , object attributes and click on execute.

1: Standard Batch / Direct Input :

           In case of standard batch input , sap provides , pre define objects, methods with a program associated with it, we have to map the field of text file to the object structure for processing.

           It is use only for standard transaction like  material master, vendor, Customer etc, for which sap has provided the objects.

           It required basic sap table/structure knowledge, and complete knowledge of transaction code for which we are doing migration, like MM01 for material creation, XD01 for create customer etc. so we will know about the field details

Advantage        : well tested methods, easy to process.

Disadvantage   : Not support to transaction, specially for new enjoy transactions

2: Batch Input Recording : Very popular tool of lsmw workbench is Batch Input Recording method, it can be use for both standard and custom transaction codes if we have module pool programming for custom transaction.

        It does not required any programming knowledge , very basic table and abap structure concept required.

        In this method we actually record the transaction, then after uploading text file, it is like re playing the recording by taking new values from text file.

         Compare to Direct input method, this method little slow, as It calls the screen for each field processing.

Advantage : Can be use for both standard and custom transaction, easy to modify, can be run in foreground as well as background and error mode, no programming knowledge required

3:Business object method (BAPI) : BAPI are well tested function module provided by sap, SAP guarantees the integrity of your database for anything updated using a BAPI.

 Advantage     : Bapi are very fast compare to other method, it is available for most of the enjoy transaction like purchase order creation ME21N, sales order creation VA01, etc.

Disadvantage : BAPI are not available for all the transaction, it required abap knowledge.

4: IDOC (Intermediate Document) :

  IDOC works here as receiver system as, sender if flat File.


  Advantage      : Easy to load, low programming required, we can check data any time in WE02 transaction, error idoc, can be re-process with BD87 or WE19 transaction.

 Disadvantage :  Good knowledge of IDOC configuration required, complete receiver side configuration need to be done. 



1.Flexibility to use different method.
2.Can be use by both technical and functional consultant
3.Migration possible with any DB ,as the final input method is flat file


Disadvantage :

1.Default to debug, cannot be debug as per normal debugging method.

2.Coding not possible to perform validation , putting default values based on conditions .


        BDC stands for Batch Data Communication and is also referred to as Batch Input.

It is use for mass processing of data, mostly in initial data migration and also on periodic basis or to atomized the business process. The steps of creating BDC are as follows

1.Create Recording using SHDB transaction
2.Transferring recording to create the Program
3.Design the program to accept the data from input file .
4.Map the input file fields with the recorded fields

BDC Provides 2 methods

1.Call transaction -    In this method data is loaded one by one from file, immediately when we execute the transaction.

2.Session Method – In this method data is read from the file , and a session is created in SM35, which we can process any point of time, when we required.   

Advantage of BDC :

1.Easy to record any transaction standard as well as custom.
2.Low programing knowledge required if developer know the record concept well.
3.We can add any kind of validation which we required.
4.Can be run in foreground, background and error mode

Disadvantage :

1.Slow processing , as it call screen every time.

2.Not possible for enjoy transaction , were we required to move on multiple tab, multiple table controls.


                Business Application Programming Interface(BAPI),  BAPI are standard remote enable function module, it also enable external application to access and process sap data.

               We can use bapi for data migration, mass processing on periodic basis and to atomized the business process.

Design flow :

1.Search BAPI in Transaction code BAPI
2.Create ABAP program with SE38 .

Execution part

1.Upload the file
2.Perform Validations
3.Call Bapi and update the record

Advantage of BAPI :

1.Very fast processing
2.Can be use for Enjoy transaction and , and other transaction which have lot of table controls.
3.Easy to Debug program.

Disadvantage :

1.BAPI Not available for transaction
2.God programming knowledge required.

Videos Link

Post a Comment


Total Pageviews