Anda di halaman 1dari 58

INTERFACE PROGRAMS

BDC AND LSMW


BY : DEVU SUNIL
SHIKHA GULIA
SONAM RANA
PUNEET BISEN

INTRODUCTION

Two methods of transferring data from legacy system to


R/3 systems or between two R/3 systems:
BDC
LSMW

Batch Interface Technique


It is a data transfer technique that
allows you to transfer datasets
automatically to screens belonging to
transactions and thus to an SAP
system.

WHAT IS BDC?

TYPICALLY USED FOR


UPLOADING LARGE
VOLUMES OF DATA
FROM LEGACY SYSTEMS
TO SAP SYSTEMS.

WHY DO WE USE BDC?


To update data from a file in OS to DB Tables , it can be done only through a T
Code .But this requires a lot of effort if BULK DATA has to be updated as the data
needs to be entered one by one. In this case we use BDC.
Example:A Legacy system that is to be replaced by SAP has say 1000
Customers , 2000 vendors and 3000 materials. All this data needs to be
transferred to SAP . In such cases , We can use BDC.
If the old system is replaced by SAP, such a transfer is calledConversion.
If the old system runs along with SAP, in that case the transfer is called
anInterface

WHAT ARE THE ADVANTAGES OF


BDC?
BDC programs execute the transaction automatically
No manual intervention
Batch input ensures data integrity. Batch input enters data into the SAP
System using the same transactions that interactive users do. Batch input
data is therefore submitted to all of the checks and controls that apply to data
entered by normal interactive means
Suitable for entering large amount of data
at the time of installing SAP system

OR

for periodic transfer of data captured by non-SAP system to SAP system

METHODS OF BDC ?

CLASSICAL BATCH INPUT


CALL TRANSACTION
CALL DIALOG (OBSOLETE)

ADVANTAGES:

It uses predefined function modules :


BDC_OPEN_GROUP
BDC_INSERT
BDC_CLOSE_GROUP
It generates a session whenever this
method is used . The session can be
viewed from SM35.

CLASSICAL BATCH
INPUT

1.Can Execute
multiple
transactions
2.Session can be
executed to the
usesrs
convenience eg:
when the server if
free
3.Status of the
session can be
viewed
4.Errors can be
traced

It does not generate a session. It


is executed immediately as soon
as the program is executed .
Only one transaction can be
executed at once
No Batch Input processing log is
generated .

CALL TRANSACTION

ADVANTAGES:
1. Faster
processing of
data

METHODS OF BDC

HOW TO WRITE AN INTERFACE


PROGRAM
STRUCTURE OF FILE : Create an internal table based on the
structure of the file to be uploaded
STRUCUTURE OF T CODE : Create an internal table based on the
structure of BDCDATA.

HOW TO WRITE AN INTERFACE


PROGRAM
GET DATA FROM FILE : Using GUI_UPLOAD Function. The file
path can be provided in the program or it can be taken as an
input from the user.
FILL UP THE STRUCUTURE OF T CODE : using the 2
SUBROUTINES.

HOW TO WRITE AN INTERFACE


PROGRAM
USE ANY OF THE TWO METHODS : Call Transaction / Classical
Batch Input.
NOTE : Call the transaction inside the loop at internal table of file
structure.
Refresh BDCDATA before coming out of the loop.

USING METHOD CALL TRANSACTION

Call transaction <tcode> using <BDCTAB>


Mode <A/N/E>
Update <S/A>
Messages into <MSGTAB>.

ERROR HANDLING IN CALL


TRANSACTION
Call transaction <tr.code> using <Bdctab>
Mode <A/N/E>
Update <S/A>
Messages <BDCMSG>.
Perform check.
Form check.
IF sy-subrc <> 0.
Call function Format_message.
(This function is called to store the message
given by system and to display it along with
record)
ENDIF.

USING METHOD CLASSICAL BATCH


INPUT
BDC_OPEN_GROUP : it will create a session by the name
specified in GROUP.

USING METHOD CLASSICAL BATCH


INPUT

BDC_CLOSE_GROUP : No parameter to be specified .


BDC_INSERT

A SAMPLE BDC PROGRAM


WHAT WE AIM TO DO ?
Upload customer bulk data eg: 10
records from a .txt file to the database table KNA1 .
CREATE A FILE IN NOTEPAD .

STEP1: RECORD THE TCODE


STRUCTURE
A T CODE CONTAINS A NO.
OF SCREENS , EACH
SCREEN CONTAINS A LOT
OF FIELDS .
TO KNOW THE STRUCTURE
OF TCODE SIMPLY USE THE
TCODE ' SHDB' AND
CREATE A RECORDING FOR
THE DESIRED
TRANSACTION EG : XD01

STEP1: RECORD THE TCODE


STRUCTURE

ONCE THE RECORDING IS


CREATED , SAVE IT AND CLICK
ON CREATE A PROGRAM AND
CHOOSE RADIOBUTTON
TRANSAFER FROM RECORDING.

STEP2: CREATE PROGRAM

STEP2: CREATE PROGRAM

STEP2: CREATE PROGRAM

STEP2: CREATE PROGRAM

STEP2: CREATE PROGRAM

STEP2: CREATE PROGRAM

LSMW
LEGACY SYSTEM MIGRATION
WORKBENCH

WHAT IS LSM WORKBENCH?

LSMW (Legacy System Migration Workbench) is a tool based on SAP


software that supports single or periodic data transfer from non-SAP
to SAP systems (and with restriction from SAP to SAP system).
LSMW is a cross platform component of SAP system.

As of SAP web application server release 6.20 , LSMW is


integrated in SAP system.
Only for releases lower than 6.20 , we have to install the stand
alone LSMW as add on.

FEATURES OF LSMW ?
User guidance
Provides different techniques for migration
Data consistency
Migration customization
Platform independent
Free of cost

Importing legacy data from PC spreadsheet


tables or sequential files
Converting data from its original (legacy
system) format to the target (SAP)
format
Importing the data using the standard
interfaces of SAP (IDoc inbound
processing, Batch Input, Direct Input)

PHASES OF LSMW

HOW DOES IT WORK ??

WHICH DATA CAN BE TRANSFRRED?


LSMW is used to transfer data from legacy Non-SAP systems into SAP
systems. However, with a few restrictions, it is also possible to migrate
from SAP system to SAP system.
A wide range of master data and transaction data can be transferred .

DISADVANTAGES OF LSMW

LSMW does not include any functions for monitoring of permanent


interface.

LSMW does not support any data export interfaces

COMPARISON BETWEEN LSMW


AND BDC
LSMW is an encapsulated data transfer tool. It can provide the same functionality as
BDC infact much more but when coming to technical perspective most the
parameters are encapsulated. To list out some of the differences :
LSMW is basically designed for a functional consultant who do not do much coding
but need to explore the functionality while BDC is designed for a technical
consultant.
LSMW offers different technique for migrating data: Direct input ,BAPI, IDoc, Batch
input recording. While BDC basically uses recording.
LSMW mapping is done by SAP while in BDC we have to do it explicitly .
LSMW is basically for standard SAP application while BDC basically for customized
application.
Coding can be done flexibly in BDC when compared to LSMW

TRANSACTION CODE-LSMW

DEFINE OBJECT

NEXT

NEXT

STEP 1- MAINTAIN OBJECT


ATTRIBUTES.

NEXT
There are four Modes of Data Transfer :
Standard/ Batch Input : Standard upload Programs
Batch Input Recording : Here you can create a recording of your own and use it to upload /
change data
BAPIs : Standard BAPIs are used to upload Data
IDOCs : Any Inbound IDOC function modules can be used to process the data
Based on the requirement we try to find a suitable method to be processed. If it is a standard
Master we can find it in the first method, Otherwise we try to use BAPIs or Idocs. If the
requirement is a very custom one we use a recording to process the data.

STEP 2 MAINTAIN SOURCE


STRUCTURE

STEP 3 MAINTAIN SOURCE


FIELD
In this screen, the Fields which
will be uploaded from the text
file can be maintained here. The
fields with identical names are
taken as the Key

STEP 4 MAINTAIN STRUCTURE


RELATIONSHIP
The Structures which are
needed for the processing of the
data need to be assigned here.
The Object may contain many
structures and many source
structures. The Mapping
between the source and the
target structures should be
done after careful checking.

STEP 5- MAINTAIN FIELD MAPPING


AND CONVERSION RULES
In this step, you assign source
fields to target fields and define
how the field contents will be
converted.

STEP 6- MAINTAIN FIXED


VALUES,TRANSLATIONS AND USERWRITTEN ROUTINES
Here the 3 reusable functions are maintained :
Fixed Values : Fixed values are values which are fixed across the project eg :
Company Code. We can assign a fixed value to BUKRS and this fixed value can be
used in all the objects in this project. So if the value changes we can only change
at one place i.e. in the fixed values instead of changing in each and every object.
Translations : Here you can maintain the fixed translation for any legacy field and
the translation can be assigned to the filed in Field Mapping and Conversion Rules.
Translation can be 1:1 or many : 1 etc.
User Defined Routines : These are user defined subroutines that are used in the
object for processing the data.
All the Three functions mentioned above are reusable Rules which are valid for all
objects in one Project.

NEXT

STEP 7- SPECIFY FILES


Here we define the Files that we
use to upload the data. The File
can be on the Front end or in
the application server

STEP 8- ASSIGN FILES


Assigning the data from the file gives
us an option to read only a few
records and not the entire chunk in
order to enable testing of first few
records.
This also provides the user defined
selection parameter which can be
used to restrict the read data based on
the condition specified.

STEP 9- READ DATA


Reading the data from the file
gives us an option to read only a
few records and not the entire
chunk in order to enable testing
of first few records. This also
provides the user defined
selection parameter which can
be used to restrict the read data
based on the condition specified.

STEP 10- DISPLAY READ DATA


In this step, you can display all or a part of the read data in table
form. Clicking on a line displays all information for this line in a clear
way. The same happens when you click on Field contents.
Change display allows to select either a one-line or multi-line view.
Display color palette displays the colors for the individual hierarchy
levels.

STEP 11- CONVERT DATA


Converting the data is the
transfer of data from source to
target structures based on the
conversion routines written in
maintain Field Mapping and
conversion routines.

STEP 11- CREATE SESSION

SM35

FETCHING RECORDS

RESULT

THANK YOU

Anda mungkin juga menyukai