You are on page 1of 4

Data Uploading in SAP

Much of the data being uploaded into SAP already exists in a digital format such as Microsoft Excel
spreadsheets or Microsoft Access databases. Moving data out of these spreadsheets and databases
requires either manual data entry or ABAP development resources.

There are two ways to load the legacy data into the SAP system:

i. BDC (Batch data Communication)


ii. LSMW(Legacy System Migration Workbench)

Batch Data Communication :

Batch Data Communication or BDC is a batch interfacing technique that SAP


developed. It is mainly used for uploading data into the SAP R/3 system. BDC works
by simulating the user input from transactional screen via an ABAP program.
The data input file will come in the form of a flat file which the user save as file type
txt file or prn file from the Microsoft Excel program. An Abaper will create a program
to read the text file and upload into the SAP system.
Normally, the tcode SHDB will be used to record the transaction code that user wants
to record. After the simulation, the Abaper can generate a sample program and modify
from there. It makes the programming easier and faster.
For a BDC upload you need to write a program which creates BDC sessions.
Steps:
1. Work out the transaction you would use to create the data manually.
2. Use transaction SHDB to record the creation of one record for particular
transaction.
Click the New recording button or the Menu - Recording - Create
3. Save the recording, and then go back a screen and go to the overview.
4. Select the recording and click on Edit - Create Program. Give the program a Z
name, and select transfer from recording.
5. Edit the program. You will see that all the data you entered is hard-coded into the
program. You need to make the following changes:
5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file
needs to be saved as TAB separated).
5.2 After the open-group, Loop on the uploaded data. For each line, perform
validation checks on the data, then modify the perform bdc_field commands to use
the file data.
5.3. After performing bdc_transaction, add the endloop.
Execute the program. It will have options to create a batch session or to process
directly.

Legacy System Migration Workbench

LSMW – is a best tool and functional-consultant-friendly. It has capability to work equivalent to BDC.
The tool supports conversion of data of the legacy system in a convenient way. The data can then be
imported into the R/3 system via batch input, direct input, BAPIs or IDocs.

Furthermore, the LSM Workbench provides a recording function that allows to generate a "data
migration object" in an entry or change transaction
To start working with the LSM Workbench, use transaction LSMW:

Click on the create button to create new project, sub project and the object.
On the initial screen, you can create a new project, corresponding sub projects and objects via Edit ->
Create new entry.
 Project: An ID with a maximum of 10 characters to name your data transfer project. If you
want to transfer data from several legacy systems, you may create a project e.g. for every
legacy system.
 Sub project: An ID with a maximum of 10 characters that is used as further structuring
attribute.
 Object: An ID with a maximum of 10 characters to name the business object.

Click on the execute button once the project, sub project and the object are created.

Now record using Batch Input Recording Data Migration - Step by Step via Batch
Input Recording

Step 1: Maintain Object attributes


Click on create to record the transaction. Enter the fields required for recoding a
transaction successfully
Note that the fields are populated with default values. The values you entered when
you recorded the transaction are set by default.
*Double-click on the field and enter the name and the description and remove the
default. Repeat this step for all fields.
Step 2. Maintain Source Structures
Click on CREATE to create a source structure. Give a name and a description to the
source structure. Save the source structure and go to the main screen.

Step 3. Maintain Source Fields

In this step, you need to list what fields are present in the source structure. The easiest
way is to click on 'Table Maintenance' icon to enter Field name, Type and Length for
each field
Step 4: Maintain Structure Relations
The relationship is defaulted automatically. Save while coming back to the main
screen.
Step 5: Maintain field mapping and conversion rules
Keep cursor on field and click on 'Assign Source field' icon to choose source field
from structure. Repeat this for every field.
Step 6: Maintain fixed values, translations, user-defined routines
You can also maintain re-usable translations and user-defined routines, which can be
used across conversion tasks.
Step 7: Specify files
In this step, we define how the layout of the input file is. The input file is a [Tab]
delimited with the first row as field names and it has to be present on local drive.
Double Click on the legacy data.
** Create an Excel with your data and save it as a Tab-delimited text file on your
local drive
Step 8: Assign files
Execute step 'Assign Files' and the system automatically defaults the file name to the
source structure.Save while going to main screen.
Step 9: Read data
In this step, LSMW reads the data from the source file (from your PC's local drive).
You have the option to read only selected rows and convert data values to internal
format.
Step 10: Display read data
This step is optional. If required, you can review the field contents for the rows of
data read.
Step 11: Convert data
This is the step that actually converts the source data (in source format) to a target
format. Based on the conversion rules defined, source fields are mapped to target
fields.
Step 12: Display Converted data
Again this is an optional step to view how the source data is converted to internal SAP
format.
Step 13: Create batch input session
Once the source data is converted in an internal format, you can create a batch session
to process updates. Click EXECUTE button to execute a batch input session.
Step 14: Run Batch Input Session
You can execute the BDC session by Run Batch input session. Executing a batch
input session is a standard SM35 transaction for managing BDC sessions. Once you
have successfully executed the batch input session, the records are updated in the
system. You can confirm this by viewing the record using the particular transaction.

You might also like