Вы находитесь на странице: 1из 37

BDC Batch Data Communication

SAP R/3 ABAP Training


By
Devendra Babu.I.

Introduction to BDC

Objectives

Give an overvie o! BDC

To enab"e the #artici#ant$ to record the $e$$ion a$ e"" a$ create BDC


#rogram.

Pre-Requisites

%no"edge o! ba$ic tran$action$ and tab"e$ in SAP.

Contents

&eed !or BDC$.

Ste#$ in BDC #rogramming.

Proce$$ !or im#"ementation o! BDC$.

Scope

Doe$ not cover Programming #art a!ter $e$$ion i$ created.

Example

BDC

Defnition

BDC' Batch Data Communication(

BDC $e$$ion i$ combination o! ABAP/)


#rogramming and bui"t in SAP !unctiona"ity.

The $y$tem ta*e$ the data !rom ABAP/)


#rogram and !eed$ it to an SAP tran$action

$creen by $creen.

Components of a BDC

Defnition

SAP Standard or Cu$tom De!ined De!inition.

Contain$

Screen$

+ie"d$

,*-code$

Implementation

SAP create$ $e$$ion through recording.

Se$$ion he"#$ to create BDC #rogram.



Need for a BDC

BDC #rogramming i$ main"y u$ed to "oad "egacy data into SAP


tab"e$ through di!!erent $et o! tran$action$.

+or doing thi$ .ob there are $evera" method$ "i*e /S01 '/egacy
Sy$tem 0igration 1or*bench( and BAPI ' Bu$ine$$ A##"ication
Programming Inter!ace(.

BDC i$ a !air"y $tab"e and convenient a##roach to "oad data.

The don$ide o! BDC #rogramming i$ that it may need change$ in


the code henever a ne $y$tem i$ u$ed.

The advantage o! u$ing a BDC i$ that it i$ ea$y to !ind here the


e2act error occurred hi"e u#"oading the data into SAP tab"e$ by
running the $e$$ion in !oreground mode.

Steps in BDC program creation

The !ir$t $te# in BDC #rogram i$ to identi!y the


$creen$ o! the tran$action that the #rogram i""
#roce$$.

The $econd $te# i$ rite a #rogram to bui"d the


BDC tab"e that i"" be u$ed to $ubmit the data to
SAP.

The "a$t $te# i$ to $ubmit the BDC tab"e to the


$y$tem in batch mode or a$ a $ing"e tran$action
through the ca"" tran$action command.

,nce the$e $te#$ are com#"eted the #rogram can


be $chedu"ed !or #eriodic e2ecution

Identifying screens in Transaction

There are to ay$ to enter the data into SAP tab"e$ one i$ manua"
entry and other one i$ through tran$action "i*e me34 etc..

0o$t o! the tab"e$ are SAP $tandard tab"e$ $o manua""y entering and
modi!ying data i$ not #o$$ib"e.

The other #o$$ibi"ity i$ to enter/change data i$ through tran$action$.

5ach end every tran$action contain$ a $et o! $creen$ ith minimum


to $creen$ and a ma2imum o! 46 $creen$.

1hi"e creating a BDC #rogram identi!ying $creen$ #"ay$ a vita" ro"e.


Ba$ed on thi$ e record the $e$$ion ith a##ro#riate va"ue$.

In $ome ca$e$ ba$ed on the va"ue$ entered in the $creen the ne2t
$creen change$7 e need to ta*en care o! a"" the$e ca$e$.

5very tran$action i"" have a uni8ue $creen !"o.

In each and every tran$action the header data i$ !i""ed !ir$t and then
the "ine item 7 i! the "ine item e2i$t.

I! you ant to *no the !ie"d detai"$ in any $creen .u$t #"ace cur$or there and
#re$$ he"# *ey'+4(7 then $ee the technica" in!ormation.

The he"# di$#"ay$ $creen name and $creen number.

Be!ore creating any BDC #rogram it i$ better to ma# out the $et o! $creen$
hich i"" be u$ed in the tran$action a$ e"" a$ a"" !ie"d$ hich are
mandatory and o#tiona" in tho$e $creen$.

+or e2am#"e9 In +-3: tran$action a!ter entering data in the !ir$t $creen7
Ba$ed on radio button o#tion you $e"ect in that $creen the
$creen !"o i"" change. In thi$ e2am#"e none7
amount7 re!erence etc... Radio button$ are there7 i! you
$e"ect none radio button it direct"y goe$ to SAPD+6;<-=463 $creen7
in ca$e you $e"ect amount radio button it goe$ to SAP0+6;A-6>36
$creen.

1ith that each and every $creen have $ome $et o! !unctiona" button$
'tab$( "i*e $ervice7 ta2e$7 1ithho"ding ta27 Standard7 Partia" etc..

+or 52am#"e 9 In +-3: Tran$action a!ter entering data at the !ir$t $creen you
#re$$ enter it goe$ to $creen here you have
choice$ to $e"ect !unction$ 'in di!!erent tab$( "i*e
$tandard7 #artia"7 re$idua" etc..

Building a BDC Table

The BDC tab"e i$ an interna" tab"e ith a $#eci!ic $tructure that?$


!i""ed ith the data to be $ubmitted.

The #rogram $hou"d !i"" the BDC tab"e ith va"ue$ !or !ie"d$7 one ro
in the interna" tab"e #er record. An additiona" record to #rovide
in!ormation about the $creen it$e"! mu$t #recede the ro$ o! !ie"d
data.

BDC tab"e $tructure9


+ie"d Ty#e De$cri#tion
Program Char':( Program name o! tran$action
Dyn#ro Char':( Screen number o! tran$action
Dynbegin Char'4( Indicator !or ne $creen
+nam Char'3;( &ame o! databa$e !ie"d !rom
$creen
+va" Char':6( @a"ue to $ubmit to !ie"d

The !o""oing are to e2am#"e$ o! bui"ding a BDC tab"e.


4.1ithout Recording
Dec"aration9
DATA Begin o! intAbdc occur$ 466.
Inc"ude $tructure bdcdata.
DATA 5nd o! intAbdc.

0ove BSAP0+63%? to intAbdc #rogram.
0ove B6466? to intAbdc dyn#ro.
0ove B<? to intAbdc dynbegin.
A##end intAbdc.
0ove R+63%-/I+&R? to intAbdc-+nam.
0ove B6646646? to intAbdc-+va".
A##end intAbdc.
Thi$ #roce$$ continue$ ti"" the BDC tab"e i$ com#"eted.

The !ir$t ro o! BDC tab"e contain$ the $creen name and the $creen number . +rom
$econd ro onard$ !ie"d$ in the $creen are #o#u"ated.

1ith Recording.

DATA Begin o! I&TABDC occur$ 466.


I&C/CD5 STRCCTCR5 BDCDATA.
DATA 5nd o! I&TABDC.

P5R+,R0 BDCASCR55& TAB/5S I&TABDC CSI&G BSAP0+63%? B 6466?.
P5R+,R0 BDC-+I5/D TAB/5S I&TABDC CSI&G BR+63%-/I+&R? B6646646?.

+,R0 BDC-SCR55& TAB/5S PABDC STRCCTCR5 BDCDATA CSI&G
P-PR,GRA0 P-SCR55&.
C/5AR PABDC.
PABDC-PR,GRA0 D P-PR,GRA0.
PABDC-DE&PR, D PASCR55&.
PABDC-DE&B5GI& D B<?.
APP5&D PABDC.
5&D+,R0.

+,R0 BDCA+I5/D TAB/5S P-BDC STRCCTCR5


BDCDATA CSI&G
P-&A05 PA@A/C5.
0,@5 PA&A05 T, PABDC-+&A0.
0,@5 P-@A/C5 T, PABDC-+@A/.
APP5&D PABDC.
5&D+,R0.

I! the BDC #rogram ha$ more than !ive $creen$ and


$ome !i!ty !ie"d$ then #re#aring BDC tab"e in the
!ir$t !ormat i$ 8uite com#"icated com#ared to
$econd method. The detai"$ o! the$e #roce$$e$ are
ta*en u# "ater in the tutoria".

Submitting BDC table to SAP

,nce the BDC tab"e ha$ been bui"t7 it need$ to be $ubmitted to SAP
!or #roce$$ing.

There are to di!!erent ay$ to $ubmit a BDC tab"e.


4. The !ir$t i$ through the CA// TRA&SACTI,& command7
hich a""o$ a $ing"e tran$action to be #roce$$ed by SAP.
3. The $econd i$ to u$e the BDCAI&S5RT !unction7 hich a""o$
mu"ti#"e tran$action$ to be #roce$$ed.
Processing Data with Call Transaction:

The ca"" tran$action command a""o$ a $ing"e BDC tab"e to be


#roce$$ed immediate"y by the $y$tem.

1hen u$ing ca"" tran$action7 it?$ the #rogrammer$ re$#on$ibi"ity to


hand"e !ai"ed tran$action$7 but thi$ i$ a very e!!icient ay to #roce$$
tran$action$.

Synta2 o! ca"" tran$action9


CA T!ANSACTI"N trans #$SIN% BDCTAB &"D' mode(

Thi$ mode a""o$ the #rogrammer to contro" hat ha##en$ hen the tab"e i$
$ubmitted.

Ba$ica""y There are three di!!erent mode$9


4. A Sho a"" $creen$.
3. 5 Sho on"y $creen$ ith error$.
3. & Sho no $creen$.

The A and 5 mode$ are norma""y u$ed !or debugging.

0ode & i$ the on"y mode that can u$ed in a #rogram that i$ run in the
bac*ground7 ithout u$er interaction.
Processing Data with BDC)INS'!T:

The $econd ay to #roce$$ a BDC $e$$ion i$ by $ubmitting it to the $y$tem


!or batch #roce$$ing. 1ith thi$ method7 $evera" tran$action$ can be
#roce$$ed together.

But un"i*e ca"" tran$action7 the data i$n?t #roce$$ed immediate"y it?$ #"aced
into the SAP batch 8ueue !or "ater #roce$$ing.

There are three SAP !unction modu"e$ that need$ to be ca""ed !rom the BDC
#rogram to $ubmit the tran$action !or #roce$$ing

4. BDCA,P5&AGR,CP9 Thi$ !unction o#en$ the BDC $e$$ion and mu$t be ca""ed
be!ore any #roce$$ing i$ done.
3. BDCAI&S5RT9 Thi$ !unction i$ ca""ed !or each tran$action in the batch.
3. BDCAC/,S5AGR,CP9 Thi$ !ina" !unction c"o$e$ the $e$$ion and $ubmit$ it to SAP
!or #roce$$ing.
*unction module details:
+, BDC)"P'N)%!"$P:

Thi$ !unction modu"e o#en$ a BDC $e$$ion. ,n"y one $e$$ion can be
o#ened at a time. C"ient7 Grou#7 Fo"d date7 %ee# and C$er #arameter$ are
e2#orted hi"e ca""ing !unction.

C"ient9 C$ua""y de!au"t to the current c"ient hen "e!t b"an*.

Grou#9 A name u$ed to identi!y the BDC $e$$ion.

Fo"d date9 Su$#end$ #roce$$ing o! the BDC $e$$ion unti" a!ter thi$ ha$
#a$$ed.

%ee#9 %ee#$ the $e$$ion in the $y$tem a!ter #roce$$ing7 unti" it$ de"eted by
an admini$trator hen the !ie"d i$ $et to <.

C$er9 The name u$ed to e2ecute the $e$$ion in batch mode you can?t $u##"y
an on"ine u$er name.

-, BDC)INS'!T:

Thi$ !unction add$ a tran$action to the BDC


$e$$ion that?$ current"y o#en.

TC,D59 Tran$action code !or tran$action that


$hou"d be u$ed to #roce$$ the data in the BDC
tab"e being in$erted.

DE&PR,TAB9 the name o! the interna" tab"e being


u$ed a$ the BDC tab"e !or the current #rogram.
., BDC)C"S')%!"$P:

Thi$ !unction i$ to c"o$e the current BDC $e$$ion7


,nce a"" tran$action$ ha$ are #roce$$ed.

&o #arameter$ needed !or thi$ !unction.



Process for implementing BDC

Tran$action S03; i$ u$ed !or recording any $e$$ion.

Recording need$ a $et o! $te#$7 hich i$ e"aborated "ater.

The !o""oing $creen-$hot$ re#re$ent $et o! $te#$ to record the $e$$ion.

The !ir$t $te# i$ to o#en S03; editor.

Se"ect recording o#tion by c"ic*ing recording button.

Se"ect ne recording button to get ne $creen.

Fere you enter a"" the detai"$ "i*e $e$$ion name and tran$action !or e2am#"e
e can have a $e$$ion name a$ Cu$tomer and the tran$action a$ 0534.

Then you get $et o! $creen$ to enter the data to create ne record or modi!y
e2i$ting record.

5nter/0odi!y the data in the $creen$ a$ you ant the #rogram to do. A!ter
com#"etion o! thi$ #roce$$ !or one tran$action7 your recording i$ com#"ete.

The $creen $hot$ and the e2am#"e$ are $hon be"o



*irst Screen of S&./

!ecorded Sessions Display Screen

New !ecording Pop up Screen

!ecording Sessions

Create Programs for !ecorded Sessions

Program Creation thru System

'0ample

Creating one BDC #rogram ith tran$action 0534.

Tran$action 0534 i$ re"ated to #urcha$e order creation.

+ir$t record the $e$$ion !rom S03;.

Identi!y the $creen$ and !ie"d$ #o#u"ated to create #urcha$e order.

Create #rogram u$ing recorded $e$$ion !rom S03;.

C$e a##ro#riate "ogic !or #age #"u$ in ca$e there are mu"ti#"e "ine
item$ more than tab"e contro".

Create $e$$ion ith in#ut !i"e by u$ing BDC #rogram.

Go to S03;7 run the $e$$ion7 here e have di!!erent ty#e$ o! mode$


to run the $e$$ion $e"ect one mode and run the $e$$ion.

+ind out hether the $e$$ion i$ $ucce$$!u" or erroneou$.

Go to error "og to $ee hat i$ the #rob"em hen ever the tran$action
i$ erroneou$.

Initial Screen of &'-+

Purchase order item screen

Purchase order item sub
screen account assignment,

Purchase order Ser1ice Screen

Purchase order Ser1ice sub
Screen account assignment

'0ample

+ir$t $creen 9 Thi$ i$ header $creen !or #urcha$e order creation. The !ie"d$
are vendor number7 #urcha$e order ty#e7 #urcha$e order date7
currency.

Second $creen 9 Thi$ i$ the #urcha$e order item $creen. The !ie"d$ are item
category7 account a$$ignment7 materia" number7 materia" $hort
de$cri#tion7 Guantity7 De"ivery date7 &et #rice7 materia" grou#7
#"ant.

Third $creen 9 Thi$ i$ the #urcha$e order item account a$$ignment. Ba$ed
on in#ut va"ue o! item category i$ em#ty and account
a$$ignment i$ %.

+ourth $creen 9 Thi$ i$ #urcha$e order $ervice $creen here u$er enter$
Service te2t7 Guantity7 Gro$$ #rice7 Cnit o! mea$ure.

+i!th $creen 9 Thi$ i$ #urcha$e order $ervice $ub $creen here u$er enter$
co$t center and G/ account va"ue.
After this the recording is done, Then the recorded program is used in the ob2ect,
3hen this ob2ect is e0ecuted with BDC)INS'!T method without submitting the
BDC4 we can go to S&./ to manually process the BDC, If we e0ecute the
program while submitting the BDC 4 the BDC processing will be done
automatically, The following slides e0plain the manual processing of a BDC,

New Session in S&./

Process the session in
Different modes,

Process the session in fore
ground mode,

Session in Processing

Incorrect session

Processed session,

'0planation

+ir$t $creen 9Thi$ $creen re#re$ent$ ne $e$$ion created in S03;.

Second $creen 9 Thi$ i$ the $creen to run the $e$$ion in di!!erent mode$ "i*e

!oreground7 bac*ground7 di$#"ay error$ on"y ith additiona"
!unction$
e2tended "og7 e2#ert mode7 dyn#ro $tandard $iHe7 cance" i!
"og error$
occurred7 $imu"ate bac*ground mode7
C$e /B5&D tran$action to come out !rom #roce$$ing
$e$$ion.

Third $creen 9 Thi$ i$ the $creen re#re$ent$ #roce$$ing in !oreground ith


di!!erent
$creen$ and di!!erent o*-code$ .

+ourth $creen 9 Thi$ $creen te""$ that $e$$ion i$ under #roce$$ing.

+i!th $creen 9 Thi$ $creen te""$ that thi$ i$ incorrect $e$$ion.

Si2th Screen 9 Thi$ $creen te""$ that #roce$$ed $e$$ion ithout error$.

Вам также может понравиться