You are on page 1of 16

Index

Introduction
Data Transfer

Direct Input
Call Transaction
Batch Input Session
Direct Input Method
Call Transaction Method
Batch Input Session Method
Writing a Data Transfer Program
Batch Input Method
Data Transfer Decision-Making
Setting up Batch-Input for Data Transfers
Processing Batch Input Sessions
Checking Batch Input Sessions
Anal!ing "rrors
"rror #andling in Batch Input Method
A SAMP$" P%&'%AM T& %() BDC
Batch input report program
Conclusion
Introduction
The early versions of R/3, SAP has been providing batch interfacing
techniques. Among these techniques, atch !ata "ommunication #!"$ is
not bi%directional& it is an integration tool in its typical form. 't can only be
used for uploading data into R/3. !" (or)s through an AAP program
and (or)s on the principle of simulating user input for transactional screen.
Batch data communication (BDC) is an instruction set that SAP can follow to
execute a transaction without user intervention. The instructions dictate the
sequence in which a transaction's screens are rocessed and which fields should
!e oulated with data on which screens. All of the elements of an SAP
transaction that are exosed to an online user have identifications that can !e
used in a BDC
The purpose of the atch !ata "ommunication is to transfer data. The !"
can transfer data from one SAP System to another SAP System or can
transfer data from non%SAP System to SAP System too. To transfer data
!" uses normal transaction codes. T(o methods are provided to !" to
do this (or).
SAP has provided t(o different types of methods for !" to do its (or).
Among these, the first one is called the classical method or session method.
Through this method the data can be read by the !" program from a
sequential dataset file. This sequential dataset file is stored in batch%input
session. 'n order to .run the transaction in this session, (hat one needs is to
e*ecute the session. +or this, follo( these fe( steps, you can start and
subsequently monitor the session firstly from - System Services atch
'nput or have the session run in the bac)ground. 'n this method to generate
the required session, you have to use the function module BDC_OPEN
GROUP, BDC _INSERT and BDC _CLOSE.
'n the second method the !" has to use the AAP statement "A..
TRA/SA"T'0/ 1S'/2 statement to run a transaction. 'n the second
method, unli)e in the first type, you do not need !" to create a session.
Data Transfer
!uring the process of data transfer, data is transferred into the SAP R/3
System. This transfer is from an e*ternal system to SAP R/3 system.
3henever you transfer data from an e*ternal system into an R/3 System,
you can use data transfer because it is installed and regularly transfers data
from an e*ternal system into an R/3 System.
3ith the help of !", you can transfer the required data from a non%SAP
system to an SAP system. +or this )ind of data transfer you are required to
(rite an AAP program. This AAP program (ould help to e*port the
concerned data to a sequential dataset file. The data in this file has to be
stored. This should be stored in a format, (hich is acceptable to SAP batch
input program. ut, to transfer data from a SAP system to another SAP
system, you can ta)e the aid of R+" or "P'%".
SAP application supports the data transfer of numerous SAP business
ob4ects. The said data transfer program specifies the data format definition,
(hich is necessary to import the data into the R/3 System. There are three
methods available for transferring data,
Direct In!t" 'n this method the SAP function modules e*ecute the
consistency chec)s. 5o(ever, there are other means of chec)ing (ith the
help of screens. The !irect 'nput 6ethod has considerable performance
advantages
.
Call Transaction"

'n this method you can chec) the data consistency (ith
the help of screen logic.
Batch In!t Session, 'n this method data consistency is chec)ed (ith the
help of screen logic.
Direct Input Method
Among the methods of data transfer through !", direct input method is the
one that is used, especially in case of transferring large amount of data. 'n
order to enhance the batch input procedure, the system offers you (ith the
direct input technique.
There is a distinction bet(een the batch input technique and this technique.
1nli)e batch input technique, this technique does not create sessions.
'nstead, it stores the data directly. 6oreover, it does not process screens. The
data has to be entered directly into the corresponding database tables. The
system calls a number of function modules (hich e*ecute necessary chec)s,
if any required. 'n the case of errors, the direct input technique has a facility
to restart the entire mechanism. 5o(ever, if you (ant to restart the entire
mechanism in case you faced an error, then direct input programs must be
e*ecuted in the bac)ground only. 0ne has to use program R67S503 or
Transaction 678 to maintain and start these programs.
Call Transaction Method
"all Transaction method is another method used for !ata Transfer. 'n this
type of method your program (ill use the AAP statement "A..
TRA/SA"T'0/ 1S'/2 in order to run a SAP transaction. 'n this type
e*ternal data need not be deposited in a session for being processed later on.
'nstead, the entire batch input process ta)es place inline in your program.
5ere, the data transfer program must convert the data that has to be
transferred into the SAP system. This is as per requirement by the SAP data
structure or the transaction (hich is using it. 't is to be remembered that a
conversion of the data types may be necessary at different times during the
process.
Suppose there is a data type mismatch then you have to convert the data
types to type ". 'n this regard the data transfer program should be capable of
e*porting the data in SAP format to the sequential file. At the time of
uploading the data into the SAP system, the !" program reads the data
from the abovementioned sequential file.
Batch Input Session Method
This is the third method for data transfer. 'f you use the batch input method
to transfer data, then you should remember that an AAP program has to
read the e*ternal data (hich is to be entered in the R/3 System.
Subsequently, it stores the concerned data a 9batch input session.9 The batch
'nput session records the actions (hich are required in the process of
transferring data into the system. This can be done by using normal SAP
transactions.
As soon as the program generates the said session, you (ill be able to run
the session in order to e*ecute the SAP transactions in it. 6oreover, you can
start the session, and at the same time, can monitor a session (ith the help of
batch input management function. +or this you have to choose,
System Services atch input. 6oreover, you can have the session run
in the bac)ground processing.
Writing a Data Transfer Program
'f you (ant to (rite a data transfer program, you have to follo( the steps
mentioned belo(.
+irstly, you (ill analy:e the structure of the e*isting data. Subsequently,
your 4ob is to specify the conversions, (hich are essential to fill the SAP
data structures.
Secondly, you have to generate the SAP data structure. 'n case the program
is (ritten in AAP, you (ill require only the required tables in the
concerned program (ith the help of TA.;S statement.
Thirdly, you (ill have to initiali:e the SAP data structure.
+ourthly, fill the structure (ith data, performing any conversions and error
chec)ing that are required.
+inally, you (ill (rite the sequential file. 'n the SAP system this sequential
file is typically required for ma)ing the data available to the batch input
program.
Batch Input Method
atch input method is a type of data transfer method. 't is used for bul) data
transfer& it is one of the primary (ays by (hich data can transferred into the
R/3 System. This method is not for near real%time data transfers.
There are various typical uses of batch input. 0ne of the (ays includes the
one%time import of data. This import of data is from a legacy system into a
ne(ly installed R/3 System. 'n addition to it, another typical use is for
periodic #i.e. hourly, daily..., and so on$ transfers of data. These transfers are
from e*ternal systems or legacy systems (hich are still in use into R/3
system (here all enterprise data is consolidated.
The R/3 applications deliver different programs for batch input, (hich are
ready to be used. 5o(ever, in some cases a customer has to (rite his or her
o(n batch input program. This is required in order to convert the concerned
data from a legacy System or from a proprietary format into an R/3 data
format.
The process flo(s for a batch input are discussed belo(.
Data Trans#er Decision$%a&in'" 't is (ith a decision to transfer data from
an e*ternal source into R/3 that the process of batch input begins. 't is
probable that the e*ternal source may be a legacy system that is being
replaced. A one%time bul) data transfer is foreseen in this regard.
Alternatively, the e*ternal source may be an e*ternal system that is to remain
in use. 'n this case, a regularly recurring bul) data transfer is foreseen.
Settin' ! Batch$In!t #or Data Trans#ers" 'f R/3 standard one%time or
regular data transfers are required, then by means of customi:ing settings in
the R/3 "ustomi:ing System in SAP ASAP set up (ill occur. <ou must set
up custom batch input procedures by hand, (hich means the system
administrator must schedule the data conversion program that creates the
batch input session. The system administrator and the batch input
programmer must determine the follo(ing, ho( frequently data is made
available from the e*ternal system, ho( frequently the conversion program
should run, and (hether the conversion program runs in R/3 #AAP
program$ or in a host system #e*ternal program$.
Processin' Batch In!t Sessions" 3hen a batch input session is processed,
then the actual transfer of data into R/3 ta)es place. .ittle attention is
required in processing of batch input sessions by the system administrator.
1sually, the starting of batch input sessions is automated by the system
administrator. 'f necessary, the administrators can also start batch input
session e*plicitly from transaction S63=.
Chec&in' Batch In!t Sessions" +or a system administrator the routine
activity is to chec) daily or more frequently in transaction S63= (hether all
batch input sessions have been completed successfully. 't is the schedule for
running batch input sessions on (hich the schedule for chec)ing sessions
depends upon. +or doing this chec) the R/3 System provides easy%to%use
batch input management tools.
(nal)*in' Errors" 't is the duty of the system administrator to analy:e the
problem if one or more transactions in a session end in errors. 1sually, the
assistance of the affected data entry specialist or department for this analysis
(ill be needed by the system administrator. 'n the situation (here the
problem (as caused by incorrect data conversion or incorrect generation of
the batch input session then the programmer (ho (rote the data conversion
program may also need to be involved.
"rror #andling in Batch Input Method
't is found that most problems usually fall into one of the follo(ing t(o
categories discussed belo(.
'n this case either required data is missing from the batch%input session or
invalid data has been included in the session. ;rrors in the data conversion
program or the presence of une*pected types of data or incorrect data in the
legacy database are the possible e*ternal causes of this type of problem.
3ithin R/3, the causes for this type of problem include incorrect or
incomplete customi:ing in an application. +or e*ample, a legacy data type
may not have been foreseen in the chec) table entries made in application
customi:ing.
This case mainly includes technical/programming problems. The data is
entered by a batch input session by running R/3 transactions non%%
interactively. Therefore, a typical technical or programming problem is the
incorrect identification of one of the data fields in a transaction. Thus, the
conversion program may not fill a required data field or may have provided
invalid values.
A SA6P.; PR02RA6 T0 R1/ !"
This sample program is for abap developer only (ho has the )no(ledge of
se=>#dialog programming$ abd ho( to built transparent table#ddic table$
(a) Go to se11 design a transparent table to match the consistiency
with the dialog program you made , like data type and length, this
table is made to store information of various employees.
(b) Design a dialog screen in which there is the information about
employee, employee id, employee name, employee address, employee
city any thing you like.
Go to se51 design the screen and abap report and layout ,give a
transaction name to the dialog screen you have ust made.
PROGRAM z_________
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
TABLES z_______.
data ok_code!" t#$e c.
data %a l&ke zx#z.
*'ATA (A L)*E L)+E O, -_#ou. ta/le 0a1e ()T2 2EA'ER
L)+E.
data3
EMP_)'014" t#$e c5
EMP_+AME014" t#$e c5
EMP_A''RESS014" t#$e c5
EMP_6)T7014" t#$e c.
*----------------------------------------------------------------------*
* MO'ULE STATUS_0100 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MO'ULE STATUS_0100 OUTPUT.
SET P,-STATUS 86URRE+T ()+'O(8.
SET P,-STATUS 897-8.
* SET T)TLEBAR 8d&alo: $.o:.a1&0:8.
E+'MO'ULE. ; STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_6OMMA+'_0100 )+PUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MO'ULE USER_6OMMA+'_0100 )+PUT.
ca<e ok_code.
%=e0 8SA>E8.
%a-e1$_&d ? e1$_&d.
%a-e1$_0a1e ? e1$_0a1e.
%a-e1$_add.e<< ? e1$_add.e<<.
%a-e1$_c&t# ? e1$_c&t#.
&0<e.t &0to z_______ @alue< %a.
(=e0 8B18 . A/ack /utto0
SET <c.ee0 0.
lea@e S6REE+ .
%=e0 8RSET8. To .e<et t=e Beld
clea. z____-e1$_&d. -_____ #ou. ta/le 0a1e
dd&c ta/le
clea. z_______-e1$_0a1e.
clea. z_______-e1$_add.e<<.
clea. z_______-e1$_c&t#.
e0dca<e.
(c) !ow write a bdc input program,
(i) go transcation shdb and enter the name of your transaction
you design before.
(ii) click new recording and give a name for the recording click
ok.
"ou will see your screen which you design before, now input the value
you want to store in the data base, have patience while inputting your
cursor movent is recording after inputting the field values click the
push button(save ), then press #$ or back button .
click back button below window will be visible click save .and
then press back button.
%
press back button and u will see the screen shown below select the
recording and click program and enter the program name ,e&ecutable
program, correct format like tab separated .
sample file'
(D) input program is shown do not change the program, press f* or
e&ecute, enter the session name and enter the name of the file
present at the application server make sure the the file is made in
correct format like tab separated
*atch input report program
.e$o.t -______
0o <ta0da.d $a:e =ead&0: l&0e-<&ze 4CC.
&0clude /dc.ecx1.
$a.a1ete.<3 data<et1D4" lo%e. ca<e.
*** 'O +OT 62A+GE - t=e :e0e.ated data <ect&o0 - 'O
+OT 62A+GE ***
*
* )E &t &< 0e<<e<a.# to c=a0:e t=e data <ect&o0 u<e t=e .ule<3
* 1." Eac= deB0&t&o0 oE a Beld ex&<t< oE t%o l&0e<
* 4." T=e B.<t l&0e <=o%< exactl# t=e co11e0t
* 8* data ele1e0t3 8 Eollo%ed %&t= t=e data ele1e0t
* %=&c= de<c.&/e< t=e Beld.
* )E #ou do08t =a@e a data ele1e0t u<e t=e
* co11e0t %&t=out a data ele1e0t 0a1e
* D." T=e <eco0d l&0e <=o%< t=e Beld0a1e oE t=e
* <t.uctu.e5 t=e Beld0a1e 1u<t co0<&<t oE
* a Beld0a1e a0d o$t&o0al t=e c=a.acte. 8_8 a0d
* t=.ee 0u1/e.< a0d t=e Beld le0:t= &0 /.acket<
* !." Eac= Beld 1u<t /e t#$e 6.
*
*** Ge0e.ated data <ect&o0 %&t= <$ec&Bc Eo.1att&0: - 'O +OT
62A+GE ***
data3 /e:&0 oE .eco.d5
* data ele1e0t3
EMP_)'_001014"5
* data ele1e0t3
EMP_+AME_004014"5
* data ele1e0t3
EMP_A''RESS_00D014"5
* data ele1e0t3
EMP_6)T7_00!014"5
* data ele1e0t3
EMP_)'_00C014"5
* data ele1e0t3
EMP_+AME_00F014"5
* data ele1e0t3
EMP_A''RESS_00G014"5
* data ele1e0t3
EMP_6)T7_00H014"5
e0d oE .eco.d.
*** E0d :e0e.ated data <ect&o0 ***
<ta.t-oE-<elect&o0.
$e.Eo.1 o$e0_data<et u<&0: data<et.
$e.Eo.1 o$e0_:.ou$.
do.
.ead data<et data<et &0to .eco.d.
&E <#-<u/.c IJ 0. ex&t. e0d&E.
$e.Eo.1 /dc_d#0$.o u<&0: 8-____8 801008.
$e.Eo.1 /dc_Beld u<&0: 8B'6_6URSOR8
8EMP_6)T78.
$e.Eo.1 /dc_Beld u<&0: 8B'6_O*6O'E8
8?SA>E8.
$e.Eo.1 /dc_Beld u<&0: 8EMP_)'8
.eco.d-EMP_)'_001.
$e.Eo.1 /dc_Beld u<&0: 8EMP_+AME8
.eco.d-EMP_+AME_004.
$e.Eo.1 /dc_Beld u<&0: 8EMP_A''RESS8
.eco.d-EMP_A''RESS_00D.
$e.Eo.1 /dc_Beld u<&0: 8EMP_6)T78
.eco.d-EMP_6)T7_00!.
$e.Eo.1 /dc_d#0$.o u<&0: 8-______8 801008.
$e.Eo.1 /dc_Beld u<&0: 8B'6_6URSOR8
8EMP_)'8.
$e.Eo.1 /dc_Beld u<&0: 8B'6_O*6O'E8
8?B18.
$e.Eo.1 /dc_Beld u<&0: 8EMP_)'8
.eco.d-EMP_)'_00C.
$e.Eo.1 /dc_Beld u<&0: 8EMP_+AME8
.eco.d-EMP_+AME_00F.
$e.Eo.1 /dc_Beld u<&0: 8EMP_A''RESS8
.eco.d-EMP_A''RESS_00G.
$e.Eo.1 /dc_Beld u<&0: 8EMP_6)T78
.eco.d-EMP_6)T7_00H.
$e.Eo.1 /dc_t.a0<act&o0 u<&0: 8-RA408.
e0ddo.
$e.Eo.1 clo<e_:.ou$.
$e.Eo.1 clo<e_data<et u<&0: data<et.
P.e<< EH5<=o%0 0e% <c.ee0 /elo%
"ither go for session method or call transaction
method
+f genetate session is choose then press f* message will
come , if successful then go to ,-$5 process the session by
choosing it using either background mode or forground
mode.
+f call transaction is used then records r tranfered ,no need
of going to sm$5 data has been tranfered the moment you
click #*.
.&plore the information on bdcdata a internal table use by
sap internally
,tructure of data internal table bdcdata.
and t+o su* routines BDC,-I"$D and BDC,D.)P%&
ho+ to fill BDCDATA internal ta*le using t+o
su*routines mention a*o/e and ho+ to concatenate
the fields in BDC,-I"$D and BDC,D.)P%&
Conclusion
0ne can ma)e use of !" to transfer data from a SAP to SAP system. 'n
addition, it can transfer data from a non SAP system to SAP system too. '
have discussed the various methods of !" and the error handling in the
respective methods.
6ade by
Ritesh aggar(al
?no(ledge ob4ects sof(are pvt. ltd

You might also like