Académique Documents
Professionnel Documents
Culture Documents
DAY-5 CONTENTS
¾ BDC functions:
¾ BDC methods
¾ EXERCISE
call transaction method
call by session method
¾ BDC RECORDING
¾ LSMW
The Batch Input is a SAP technique that allows automating the input in transactions from
the NON-SAP environment to SAP environment. It lies on a BDC (Batch Data
commands) scenario.
BDC functions:
It runs the program RSBDCSUB in order to launch automatically the session. The session
management is done through the transaction code SM35.
BDC methods:
2) Building a session and a set of BDC scenarios and keeping the session
available in SM35,
3) Building a session and launching the transaction right after closing the
session.
EXERCISE
Fill in the ATTRIBUTES screen with the TITLE, TYPE & STATUS.
Declare the tables being used in the program. Here the ZKA_EMP.
Then declare the internal table.
Now call the function ‘UPLOAD’ which can upload the data from the non-sap
environment to the SAP environment. For that, Click on the PATTERN button and enter
the function name to be UPLOAD and click CONTINUE.
Lets take the notepad to the NON-SAP environment and so create the data in the
Notepad.
Summary:
REPORT ZKA_BDC .
TABLES: ZKA_EMP.
LOOP AT ITAB.
WRITE:/ ITAB.
ENDLOOP.
LOOP AT ITAB.
SPLIT ITAB AT ',' INTO
ITAB_COMMA-EMPNO
ITAB_COMMA-EMPNAME
ITAB_COMMA-EMPPHONE
ITAB_COMMA-EMPID.
APPEND ITAB_COMMA.
CLEAR ITAB_COMMA.
ENDLOOP.
LOOP AT ITAB_COMMA.
BDCITAB-PROGRAM = 'ZKA_SCREENPAINTER'.
BDCITAB-DYNPRO = '0001'.
BDCITAB-DYNBEGIN = 'X'.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPNO'.
BDCITAB-FVAL = ITAB_COMMA-EMPNO.
Kavitha .A.S
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPNAME'.
BDCITAB-FVAL = ITAB_COMMA-EMPNAME.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPPHONE'.
BDCITAB-FVAL = ITAB_COMMA-EMPPHONE.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPID'.
BDCITAB-FVAL = ITAB_COMMA-EMPID.
APPEND BDCITAB.
CLEAR BDCITAB.
ENDLOOP.
Double click on the transaction code which will guide to the transaction code builder
Kavitha .A.S
Thus the BDC-CALL TRANSACTION METHOD which is used to transfer the data
from the non-sap environment to the sap Environment.
Kavitha .A.S
Fill in the ATTRIBUTES screen with the TITLE, TYPE & STATUS.
Kavitha .A.S
Declare the tables being used in the program. Here the ZKA_EMP.
Now call the function ‘UPLOAD’ which can upload the data from the non-sap
environment to the SAP environment.
For that, Click on the PATTERN button and enter the function name to be UPLOAD
and click CONTINUE.
Kavitha .A.S
Summary:
REPORT ZKA_BDC .
TABLES: ZKA_EMP.
ENDIF.
LOOP AT ITAB.
WRITE:/ ITAB.
ENDLOOP.
LOOP AT ITAB.
SPLIT ITAB AT ',' INTO
ITAB_COMMA-EMPNO
ITAB_COMMA-EMPNAME
ITAB_COMMA-EMPPHONE
ITAB_COMMA-EMPID.
APPEND ITAB_COMMA.
CLEAR ITAB_COMMA.
ENDLOOP.
LOOP AT ITAB_COMMA.
BDCITAB-PROGRAM = 'ZKA_SCREENPAINTER'.
BDCITAB-DYNPRO = '0001'.
BDCITAB-DYNBEGIN = 'X'.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPNO'.
BDCITAB-FVAL = ITAB_COMMA-EMPNO.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPNAME'.
BDCITAB-FVAL = ITAB_COMMA-EMPNAME.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPPHONE'.
BDCITAB-FVAL = ITAB_COMMA-EMPPHONE.
APPEND BDCITAB.
CLEAR BDCITAB.
BDCITAB-FNAM = 'ZKA_EMP-EMPID'.
BDCITAB-FVAL = ITAB_COMMA-EMPID.
APPEND BDCITAB.
CLEAR BDCITAB.
ENDLOOP.
In order to view the session, go to the transaction code SM35 ( Batch Input session
overview). Select the session name and click on PROCESS button.
Kavitha .A.S
The process starts and the data in the NON-SAP environment is uploaded to the SAP
environment.
Kavitha .A.S
If the session processes without any errors, then the session overview is completed and it
shows the status to be processed.
Kavitha .A.S
BDC RECORDING
Click on the RECORDING button in the SM35 ( BATCH INPUT SESSION
OVERVIEW) transaction or can directly put in the transaction code SHDB.
Click on the NEW RECORDING button and enter the recording name and the
transaction code and click on the START RECORDING button.
Kavitha .A.S
Give the field value and perform some operations and u can find each and every click on
the screen and the no. of screens processed with the date and the time.
LSMW
The LSM (Legacy System Migration) Workbench is an R/3-based tool that supports You when transferring
1
data from non-SAP systems ("Legacy Systems") to SAP systems once or periodically.
The tool supports conversion of data of the legacy system in a convenient way. The data can then be
imported into the SAP 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.
The Legacy System Migration Workbench (LSMW) is a tool recommended by SAP that you can use to
transfer data once only or periodically from legacy systems into an R/3 System.
More and more medium-sized firms are implementing SAP solutions, and many of them have their legacy
data in desktop programs. In this case, the data is exported in a format that can be read by PC spreadsheet
systems. As a result, the data transfer is mere child's play: Simply enter the field names in the first line of the
table, and the LSM Workbench's import routine automatically generates the input file for your conversion
program.
The LSM Workbench lets you check the data for migration against the current settings of your customizing.
The check is performed after the data migration, but before the update in your database.
So although it was designed for uploading of legacy data it is not restricted to this use.
We use it for mass changes, i.e. uploading new/replacement data and it is great, but there are limits on its
functionality, depending on the complexity of the transaction you are trying to replicate.
For those with the older SAP version (4.7 and below), the data migration programs might not have been pre-
loaded.
EXERCISE
The main screen of LSMW provides wizard-like step-by-step tasks,. To complete your
data conversion, you need to execute these steps in sequence. Once a step is executed, the
cursor is automatically positioned to the next step.
Kavitha .A.S
Enter the Recording name with the short description and click on the OK button.
Kavitha .A.S
Now click on the OK button and the recording starts. Start Recording and finally click on
the EXIT button.
Kavitha .A.S
Once the transaction is completed, R/3 records the flow of screens and fields and saves the information.
Note that the fields are populated with default values. The values you entered when you recorded the
transaction are set by default.
Note that if you have more fields in the recording than needed, you can remove them by
Observe that the transaction-recording process stores field names in a technical format.
By pressing the F1 key on individual screen fields and then pressing the F9 key, the
system displays technical names.
Save your changes. When you go back to the initial screen, you will see that the initial
screen steps have changed. Since you want to import data via the BDC method, the
Direct Input and IDoc-related steps are hidden, as they are not relevant.
Kavitha .A.S
.Once after entering all the details u can fid the below screen.
If ypur fields in the source and the target are same then choose “MATCH FIELDAS WITH
IDENTICAL NAMES’ else CHOOSE ‘MATCH FIELDS WITH SIMILAR NAMES”.
Once all the fields are mapped, you should have an overview screen
Kavitha .A.S
The input file is a [Tab] delimited with the first row as field names. It is present on my
PC (local drive) as C:/BDC-EMP wherein the delimiter is ‘comma’.
Kavitha .A.S
Kavitha .A.S
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 customer master records are updated in the system. You can confirm this by viewing the
customer master records (XD03).
In order to view the session, go to the transaction code SM35 ( Batch Input session
overview). Select the session name and click on PROCESS button.
Kavitha .A.S
The process starts and the data in the NON-SAP environment is uploaded to the SAP
environment.
Kavitha .A.S
If the session processes without any errors, then the session overview is completed and it
shows the status to be processed.
Kavitha .A.S
Of all the methods used for data migration like BDC, LSMW , Call Transaction
which one is used most of the time?
How is the decision made which method should be followed? What is the procedure
followed for this analysis?
All the 3 methods are used to migrate data. Selection of these methods depends on the scenario, amount of
data need to transfer. LSMW is a ready tool provided by SAP and you have to follow some 17 steps to
migrate master data. While in BDCs Session method is the better choice because of some advantages over
call transaction. But call transaction is also very useful to do immediate updation of small amout of data. (In
call transaction developer has to handle errors).
SO Bottom line is make choice of these methods based of real time requirements.
These methods are chosen completely based on situation you are in. Direct input method is not available for
all scenario, else, they are the simplest ones. In batch input method ,you need to do recording for the
transaction concerned. Similarly, IDoc, and BAPI are there, and use of these need to be decided based on
the requirement.
Try to go through the some material on these four methods, and implement them. You will then have a fair
idea about when to use which.