Upload
yzmercan
View
246
Download
0
Embed Size (px)
Citation preview
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 1/68
Accloturl
=:11
AMAZ hbr mlknoolrs
Eusnarn Stlhaob
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 2/68
=
Yam`l bh Cbotlots
1/ Notrbiuctnbo ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9
=/ Gbw tb crlatl a olw prbkrae /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <
3/ Xarnam`ls aoi cbostaots ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 7
3/1 Yypls bh iata /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 7
3/= Iata ilhnontnbo //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// >
9/ [brfnok wntg strnoks ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 11
</ []NYL statlelot ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 13
</1 Hlaturls ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 139/= Lxaep`l ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 19
8/ Cbotrb` nostructnbos ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1<
8/1 NH nostructnbo ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1<
8/= Casl nostructnbo //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 18
;/ @bbps ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1;
;/1 IB"LOIIB //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1;
;/= @BBZ"LOI@BBZ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1;
;/3 [GN@L"LOI[GN@L //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 17
7/ Yam`ls ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1>
7/1 Notlroa` tam`ls /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1>
7/= Iatamasl tam`ls ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// =3
7/3 Lxaep`l ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// =8
>/ Zaraeltlrs aoi Sl`lctnbo%Scrllo //////////////////////////////////////////////////////////////////////////////////////////////////////////// =>
>/1 Zaraeltlrs //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// =>
>/= Sl`lct%bptnbos /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 31
>/3 Sl`lctnbo%scrllo //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 33
>/9 Lxaep`l ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 38
1:/ Hbre aoi huoctnbos /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 3>
1:/1 Hbres ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 3>
1:/= Huoctnbos /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 91
11/ Lrrbr elssakls ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9=
1=/ B\YZ\Y ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 99
1=/1 Snep`l vnlw /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 99
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 3/68
3
1=/= A@X vnlw //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 9;
1=/3 A@X vnlw no ZBZ\Z /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <1
13/ Hn`l ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <<
13/1 Ilc`aratnbo //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <<
13/= \p`bai a hn`l hrbe \ONW //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <8
13/3 \p`bai a hn`l hrbe IBS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <;
13/9 Ibwo`bai a hn`l no \ONW //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 83
13/< Ibwo`bai a hn`l no IBS ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 89
19/ AMAZ Ilmukklr ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 88
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 4/68
9
1/ Notrbiuctnbo
N startli tb wbrf no Accloturl ambut twb ylars akb aoi N inio„t fobw aoytgnok ambut Sap br AMAZ, sb N
startli tb rlai sbel eaoua`s tgat N hbuoi bo%`nol br no ey bhhncl/
N gai olvlr sllo AMAZ cbil mlhbrl, aoi N tgbukgt tgat tgbsl eaoua`s wlrl tbb inhhncu`t hbr a mlknoolr,
wntg lxaep`ls tbb cbep`lx br obt sb c`lar/
Sbel ebutgs `atlr, N ilcnili tglrlhbrl tb wrntl a `ntt`l ibcuelot tgat cbu`i gl`p tgl mlknoolrs tb `laro
tgl masns bh tgl AMAZ cbil, wntg a `bt bh lasy lxaep`ls aoi obt hbrklttnok tgl `ntt`l iltan`s tgat bhtlo arl
enssnok no tgl splcna`nzli tlxts/
Eusnarn Stlhaob
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 5/68
<
=/ Gbw tb crlatl a olw prbkrae
\sl traosactnbo SL37/
[rntl tgl oael bh tgl olw prbkrae, tgao sl`lct ‐Crlatl―/
Hnkurl 1/ Yraosactnbo SL37
Hn`` tgl hnl`is sgbw no hnkurl =/ Yglo savl/
Hnkurl =/ Attrnmutls
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 6/68
8
[rntl tgl ‐Ilvl`bpelot c`ass―/ Nh ybu ibo„t waot tb traoshlr tgl prbkrae no prbiuctnbo lovnrboelot,
mut ybu waot tb stay no tlst lovnrboelot, sl`lct ‐@bca` bmdlct―, btglrwnsl sl`lct
Hnkurl 3/ Ilvl`bpelot c`ass
Yb start wrntnok cbil, sl`lct ‐Sburcl cbil―/
Hnkurl 9/ Sburcl cbil
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 7/68
;
Zrlss H< tb aii olw rbws 'prlss lotlr nh ybu gavl kbt ao lar`nlr vlrsnbo bh Sap./
Hnkurl </ AMAZ Lintbr
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 8/68
7
3/ Xarnam`ls aoi cbostaots
3/1 Yypls bh iat a
No AMAZ tglrl arl inhhlrlot typls bh iata4
Yypl Syemb` Nontna` va`ulIlhau`t
`loktg
@loktg
a``bwli]aokl
A`pgaouelrnc
cgaractlrsC M`aof 1 1 % eax "
Ouelrnc
cgaractlrsO ::…: 1 1 – eax "
Notlklr
ouemlrsN : 9$ " %=31 &=31 %1
Zacfli
ouemlrsZ : 7 1 %18 "
H`bat/ Zbnot
ouemlrsH :/::: 7$ " 1l%3:; 1l&3:;
Glxailcnea`
ouemlrsW W„::„ 1 1 % eax "
Iatl
yyyyeeiiI :::::::: 7 7 "
Ynel ggeess Y :::::: 8 8 "
Yam`l 1/ Yypls bh iata
$ Ygl ilhau`t `loktg ilplois bo ybur cbeputlr/
A oael bh a hnl`i cao ml up tb 3: cgaractlrs, tgl hnrst eust ml a `lttlr/ ^bu cao obt noc`uil splcna`
cgaractlrs lxclpt -R-/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 9/68
>
3/= Iata ilhnont nbo
Hnl`i ilhnontnbo
A hnl`i ns ilhnoli as a varnam`l nh nt eay tafl bo inhhlrlot va`uls/ Nt ns ilc`arli wntg tgl IAYA statlelot/
Ygl typl bh lacg hnl`i ns ilhnoli wntg tgl apprbprnatl syemb` ahtlr tglY^ZL statlelot/
Ygl ouemlr no parlotglsls ahtlr tgl hnl`i oael ns bptnboa` aoi nt ns usli tb noincatl tgl `loktg 'nh nt ns
obt wrnttlo, nt ns flpt tgl ilhau`t `loktg./
Nt„s pbssnm`l tb usl tgl @NFL statlelot tb cbeparl twb varnam`ls/
Ygl tlre XA@\L ilhnols tgl nontna` va`ul bh tgl varnam`l/
No tgl lxaep`l sgbwo no tgl mbx, tgl hnl`i -oael- ns a`pgaouelrnc aoi nt ns 1< cgaractlrs `bok, tgl hnl`i
-suroael- ns slt lqua` tb -oael- hnl`i, tgl hnl`i -iataRsl`lctli- ns iatl typl aoi tgl hnl`i -cbuotlr- ns
ao notlklr iata 'tgl cbuotlrs arl a`ways ilhnoli no tgns way. aoi gas kbt ao nontna` va`ul '1./
]lcbri ilhnontnbo
A rlcbri cao cbotano eu`tnp`l hnl`is aoi nt ns a`ways ilhnoli wntg tgl IAYA statlelot/ Yb ilhnol tglstart aoi tgl loi bh tgl rlcbri, usl tgl obtatnbo MLKNO BH aoi LOI BH hb``bwli my tgl oael bh tgl
rlcbri/
Ygl @NFL flywbri gas tgl sael hlaturls bh tgl ilhnontnbo bh a hnl`i/
IAYA4 oael'1<. Y^ZL c,
suroael @NFL oael,
iataRsl`lctli Y^ZL i,
cbuotlr Y^ZL n XA@\L ‗1„/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 10/68
1:
Cbostaots ilhnontnbo
\o`nfl varnam`ls, cbostaots tafl a`ways tgl sael va`ul wgn`l tgl prbkrae ns ruoonok/
Ygly arl ilhnoli wntg tgl CBOSYAOYS statlelot/
IAYA4 MLKNO BH rlslrvatnbo,
h`nkgt'1:. Y^ZL c,
ilparturlRiatl Y^ZL i,
ilparturlRgbur Y^ZL t,
LOI BH rlslrvatnbo/
IAYA tncflt @NFL rlslrvatnbo/
CBOSYAOYS4 hactbr Y^ZL p XA@\L ‗=33=93„,
cbuotry'=:. Y^ZL c XA@\L ‗Nta`y„/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 11/68
11
9/ [brfnok wntg strnoks
Nt„s pbssnm`l tb plrhbre eu`tnp`l bplratnbos wntg strnoks4 tb sl`lct a clrtano ouemlr bh cgaractlrs no tgl
cbotlots bh a hnl`i, tb rlp`acl cgaractlrs, tb rlvlrsl cgaractlrs, br tb cbocatloatl tgle/
Sl`lct cgaractlrs no a strnok
Ygl syotax ns4
Xarnam`lRoael&W'^.
W ns a ouemlr tgat noincatls tgl `ast cgaractlrs obt tb ml taflo aoi ^ ns a ouemlr tgat noincatls gbweaoy cgaractlrs tb tafl/
No tgns lxaep`l, tgl varnam`l lxtract ns ‐<8―/
Cbocatloatnok eu`tnp`l varnam`ls no a strnok
Structurl tb cbocatloatl twb br ebrl varnam`ls4 CBOCAYLOAYL … NOYB …
No tgns lxaep`l, tgl varnam`l tbta` ns ‐stl<8―/
IAYA cbil'7. Y^ZL c XA@\L +1=39<8;7+/
IAYA lxtract'=. Y^ZL c/
lxtract 5 cbil&9'=./
IAYA cbil'7. Y^ZL c XA@\L +1=39<8;7+/
IAYA oael';. Y^ZL c/
IAYA lxtract'=. Y^ZL c/IAYA tbta`'<. Y^ZL c/
oael 5 +Stlhaob+/
lxtract 5 cbil&9'=./
CBOCAYLOAYL oael'3. lxtract NOYB tbta`/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 12/68
1=
Sp`nt a strnok notb eu`tnp`l varnam`ls
Yb sp`nt a strnok notb eu`tnp`l varnam`ls, ybu olli tb usl tgl hb``bwnok syotax4
SZ@NY strnok AY ‗#„ NOYB varnam`l1 varnam`l = varnam`l 3/
Strnok ns tgl oael bh tgl varnam`l tb sp`nt, # ns tgl syemb` tgat noincatls tgl invnsnbo mltwllo tgl hnl`is
aoi tgl wbris ahtlr tgl nostructnbo NOYB arl tgl varnam`ls wglrl N waot tb sp`nt tgl strnok/
Slarcg hbr va`uls wntgno a strnok
Ygl syotax ns4
SLA]CG strnok HB] ‗kb`i„/
No tgns lxaep`l, wl waot tb slarcg tgl wbri ‗kb`i„ notb tgl strnok/
^bu cao a`sb assbcnatl ao NH statlelot tgat cglcf tgl varnam`l sy%sumrc4 nh nt ns lqua` tb ‗:„ tgl wbri ns
hbuoi wntgno tgl strnok, btglrwnsl obt/
NH sy%sumrc 5 ‗:„/
…
L@SL/…
LOINH/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 13/68
13
</ []NYL statlelot
</1 Hlaturls
[]NYL statlelot ns ao butput statlelot 'hbr ebrl iltan`s ambut butputs, sll tgl Cgaptlr 11./
Ygl wbris loc`bsli mltwllo twb snok`l qubtls arl sgbwo as tgly arl, wgn`l tgbsl butsnil arl
cbosnilrli as varnam`ls br cbostaots/
A`` AMAZ cbeeaois, noc`uinok a`sb tgl []NYL statlelot, eust loi wntg a pbnot/
[]NYL4 ‗ Ey oael ns4 ‗ , oael/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 14/68
19
9/= Lxaep`l
Hnrst bh a`` ybu eust gavl crlatli a olw prbkrae no ilvl`bpelot lovnrboelot, as sgbwo no Cgaptlr =/
Ygl rlpbrt wn`` eafl tgl sue bh tgl ouemlr ‐<― aoi ouemlr ‐3― aoi tgl rlsu`t wn`` sgbw bo scrllo/
My prlssnok tgl H7 fly bo ybur flymbari, tgl prbkrae ruos aoi insp`ays tgl hb``bwnok butput4
Hnkurl 8/ Butput rlpbrt
As ybu cao sll hrbe tgns snep`l rlpbrt, tb assnko a va`ul tb a varnaot ns olclssary tb put tgl lqua`s snko
-5- mltwllo tgl twb wbris/
]LZB]Y zRtlst/
IAYA ouemlrRa Y^ZL o/
IAYA ouemlrRm Y^ZL o/
IAYA sue Y^ZL o/
ouemlrRa 5 </
ouemlrRm 5 3/
sue 5 ouemlrRa & ouemlrRm/
[]NYL4 +Ygl sue ns4+, sue/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 15/68
1<
8/ Cbotrb` nostructnbos
Ygl twb cbostructs n``ustratli no tgl hb``bwnok slctnbos a``bw ybu tb assbcnatl inhhlrlot nostructnbos tb
inhhlrlot rlspbosls tb bol br ebrl `bknca` cbointnbos/
8/1 NH nostr uct nbo
Lacg NH eust loi wntg LOINH , wgn`l nosnil ybu cao lotlr eu`tnp`l statlelots L@SL " L@SLNH /
Ygl syotax ns4 NH 0`bknca` lxprlssnbo A?/
Nostructnbo 1
L@SLNH 0 `bknca` lxprlssnbo M?/
Nostructnbo =
L@SLNH 0 `bknca` lxprlssnbo C?/
Nostructnbo 3
…
L@SL/
Nostructnbo WLOINH/
]LZB]Y zRtlst/
IAYA ouemlrRa Y^ZL o/
IAYA ouemlrRm Y^ZL o/
IAYA sue'=. Y^ZL o/
IAYA eax'3. Y^ZL o/
ouemlrRa 5 </
ouemlrRm 5 3/
sue 5 ouemlrRa & ouemlrRm/
eax 5 1:/
NH sue 0 eax/
[]NYL4 +Ygl sue ns 0 tgao eax„/
L@SL/
[]NYL4 +Ygl sue ns ? tgao eax„/
LOINH/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 16/68
18
8/= Casl nost r uctn bo
Ygl CASL statlelot ns mlttlr tgao NH statlelot nh ybu gavl kbt a `bt bh casls tb tlst/
Ygl syotax ns4
CASL 0hnl`i?/
[GLO 0va`ul A?/
Nstructnbo 1
[GLO 0va`ul M?/Nstructnbo =
[GLO 0va`ul C?/
Nstructnbo 3
…
LOICASL/
]LZB]Y zRtlst /
IAYA ouemlrRa Y^ZL o/
IAYA ouemlrRm Y^ZL o/IAYA sue'=. Y^ZL o/
ouemlrRa 5 </
ouemlrRm 5 3/
sue 5 ouemlrRa & ouemlrRm/
CASL sue/
[GLO ‗=„/
[]NYL4 +Ygl sue ns =‗/
[GLO ‗3„/
[]NYL4 +Ygl sue ns 3‗/[GLO ‗9„/
[]NYL4 +Ygl sue ns 9‗/
…
LOICASL/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 17/68
1;
;/ @bbps
Ygl `bbps arl uslhu` tb rlplat tgl sael nostructnbos ebrl tnels/
[ntg tgl statlelot LWNY ybu cao kb but hrbe tgl `bbp/
;/1 IB" LOIIB
^bu gavl tb wrntl gbw eaoy tnels ybu olli tb ntlratl bol br ebrl statlelots/ Ygl syotax ns4
IB 0o? YNELS/
…nostructnbos…
LOIIB/
Ahtlr IB, ybu cao wrntl a ouemlr br a oael bh a ouelrnc varnam`l/
;/= @BBZ" LOI@BBZ
Bhtlo nt ns usli tb scrb`` tgl cbotlots bh notlroa` tam`ls 'sll Cgaptlr ;./ Ygl syotax ns4
@BBZ AY tam`l/
…nostructnbos…
LOI@BBZ/
IB =: YNELS/
sue 5 sue &1/
LOIIB/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 18/68
17
;/3 [GN@L" LOI[GN@L
[ntg tgns statlelot, tgl cbeeaois wntgno arl rlplatli uotn` tgl `bknca` cbointnbo ns satnshnli/
Ygl syotax ns4
[GN@L 0`bknca` lxprlssnbo?/
…nostructnbos…
LOI[GN@L/
[GN@L sue 0 =:/
sue 5 sue &1/
LOI[GN@L/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 19/68
1>
7/ Yam`ls
7/1 Not lr oa` tam`ls
\o`nfl tgl iatamasl tam`ls, notlroa` tam`ls lxnst bo`y iurnok tgl l`ambratnbo bh tgl prbkrae tgat usls
tgle/ Aoy lotrnls br cgaokls wn`` ml rlslt bocl tgl rlpbrt gas hnonsgli prbclssnok/
Notlroa` tam`ls a``bw ybu tb plrhbre ca`cu`atnbos ebrl quncf`y aoi lhhlctnvl`y tgao tam`ls bh tgl SAZ
iatamasl/
Ilc`aratnbo
Ygl notlroa` tam`ls eust ml ilc`arli at tgl mlknoonok bh tgl prbkrae wntg tgl IAYA statlelot/ \o`nfl
tgl ilhnontnbo bh a rlcbri, ybu eust aii tgl syotax BCC\]S 1:: 'br lntglr BCC\]S :., a paraeltlr tgat
cao a``bcatl ebrl elebry spacl/
A`` tgl hnl`is eust ml ilc`arli splcnhynok `loktg aoi typl, br rlca``nok ao lxnstnok br a prlvnbus`y
ilc`arli hnl`i usnok tgl @NFL statlelot hb``bwli my tgl syotax -oaelRtam`l%oaelRhnl`i/-
Bhtlo tgl notlroa` tam`l gas tgl sael structurl bh a iatamasl tam`l, no tgns casl, ybu cao ilc`arl nt wntg
tgl syotax NOC@\IL SY]\CY\]L / No tgl hb``bwnok lxaep`l, ‐tmRuslr― ns tgl notlroa` tam`l aoi ‐uslr― ns
tgl iatamasl tam`l/
IAYA4 MLKNO BH tmRuslr BCC\]S 1::,
oael'=:. Y^ZL c,
suroael'=:. Y^ZL c
va`ul @NFL tlst%va`ul,
LOI BH tmRuslr/
IAYA4 MLKNO BH tmRuslr BCC\]S 1::,
NOC@\IL SY]\CY\]L uslr,
LOI BH tmRuslr/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 20/68
=:
Noslrt a rlcbri
Yb traoshlr quncf`y tgl cbotlots bh a iatamasl tam`l no ao notlroa` tam`l, ybu cao usl tgl cbeeaoi
EBXL%CB]]LSZBOINOK wgncg, gbwlvlr, rlqunrls tgat tgl twb tam`ls gavl tgl sael structurl,
btglrwnsl bo`y tgl iata tgat arl no hnl`is no mbtg tam`ls wn`` ml traoshlrrli/
Ygl syotax ns4 EBXL%CB]]LSZBOINOK tam`lRim YB tam`lRnotlroa`/
Nt„s a`sb pbssnm`l tb traoshlr tgl cbotlots bh noinvniua` hnl`is usnok tgl syemb` -5-/
[ntg tglsl nostructnbos a rbw bh tgl tam`l ‐uslr― ns cbpnli tb tgl glailr `nol bh tgl notlroa` tam`l/ Yb
traoshlr iata hrbe tgl glailr `nol tb tgl iatamasl tam`l, nt ns olclssary tb aii tgl statlelot AZZLOI
hb``bwli my tgl oael bh tgl notlroa` tam`l/
Il`ltl a rlcbri
Ygl statlelot tb usl ns IL@LYL , hb``bwli my tgl oael bh tgl notlroa` tam`l/ [ntg [GL]L ybu cao hn`tlrtgl rlcbris/
IL@LYL tmRuslr [GL]L oael 5 ‗Taolttn„/
EBXL%CB]]LSZBOINOK uslr YB tmRuslr/
BYGL][NSL
tmRuslr%oael 5 uslr%oael/
tmRuslr%suroael 5 uslr%suroael/
tmRuslr%va`ul 5 uslr%va`ul/
AZZLOI tmRuslr/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 21/68
=1
Yb il`ltl tgl lotnrl cbotlots bh ao notlroa` tam`l ns usli tgl ]LH]LSG cbeeaoi/
Ebinhy a rlcbri
\sl tgl EBINH^ cbeeaoi hb``bwli my tgl oael bh tgl notlroa` tam`l/
Sbrt rlcbris
\sl tgl SB]Y cbeeaoi6 tgl syotax ns4
SB]Y tam`l M^ hnl`i ASCLOINOK"ILSCLOINOK/
Glailr `nol
Ygl glailr `nol ns ao aiintnboa` `nol no tgl notlroa` tam`l, wglrl iata arl noslrtli mlhbrl mlnok wrnttlo
notb tgl tam`l/ Yb nontnatl tgns `nol, ybu cao usl tgl C@LA] cbeeaoi/
Yb c`arnhy tgl bplratnbo, ns sgbwo ao lxaep`l no wgncg a rlcbri ns cbpnli hrbe a iatamasl tam`l 'zgdbm.
tb ao notlroa` tam`l 'tmRzgdbm./ 'Ygl pncturls arl taflo hrbe AMAZ Ilmukklr./
]LH]LSG tmRuslr/
tmRuslr 5 ‗olw„/
EBINH^ tmRuslr/
SB]Y tmRuslr M^ oael ASCLOINOK/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 22/68
==
1. Nontna` sntuatnbo bh tmRzgdbm
Ygl glailr `nol aoi tgl notlroa` tam`l arl lepty
=. Nostructnbo4 EBXL%CB]]LSZBOINOK zgdbm YB tmRzgdbm/
Ygl glailr `nol ns logaocli wntg iata hrbe tgl hnrst rbw bh tgl tam`l zgdbm/ Ygl tmRzgdbm ns stn`` m`aof/
3. Nostructnbo4 AZZLOI tmRzgdbm/
Ygl cbotlots bh tgl glailr `nol ns cbpnli notb tgl hnrst rbw bh tgl notlroa` tam`l 'noincatli my tgl ouemlr
-1- no m`ul./
9. Nostructnbo4 C@LA] tmRzgdbm/
Ygl glailr `nol ns m`aof/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 23/68
=3
7/= Iatamasl t am`ls
Yglsl tam`ls arl vnlwam`l wntg tgl SAZ traosactnbo SL11 'tb sll tgl structurl. aoi SL18 'tb sll tgl
cbotlot./ Aoy cgaokls wn`` rleano plreaolot/
Ilc`aratnbo
Ygl structurl bh tglsl tam`ls eust ml ilhnoli wntg tgl traosactnbo SL11/
[ntgno tgl prbkrae cbil, usl tgl YAM@LS statlelot hb``bwli my tgl oael bh tgl tam`ls/
]lai a iatamasl tam`l
Ygl iatamasl tam`ls arl rlai wntg tgl SL@LCY statlelot/ Ygl masnc syotax ns4
SL@LCY hnl`isRtbRrlai H]BE tam`l/
…
LOISL@LCY/
'Nh ybu waot tb rlai a`` tgl cb`ueos no tgl iatamasl tam`l wrntl4 SL@LCY $ H]BE tam`l/.
Nt„s pbssnm`l tb hn`tlr sbel rlcbris wntg tgl statlelot [GL]L , br tb sbrt tgl rlcbris wntg tgl syotax
B]IL] M^ – ASCLOINOK"ILSCLOINOK/
Ygl cbostruct SL@LCY " LOISL@LCY rlais a snok`l rlcbri at a tnel tgat satnshnls tgl cbointnbos wrnttlo
mltwllo tgl twb fly wbris/ Bocl tgl hnrst rlcbri ns rlai, tgl cbostruct rlais tgl slcboi bol aoi sb bo/
Nt wbrfs `nfl a `bbp/
YAM@LS4 uslr, zgdbm/
SL@LCY $ H]BE uslr [GL]L oael 5 ‗Inlkb„ AOI suroael 5 ‗En`ntb„
B]IL] M^ kba`s ASCLOINOK/
…
LOISL@LCY/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 24/68
=9
Nh ybu wbu`i ratglr aoa`yzl bo`y tgl hnrst rlcbri tgat ellts tgl cbointnbos, ybu cao usl SL@LCY SNOK@L
br SL@LCY% \Z YB 1 ]B[S4
Mbtg hbres ib obt rlqunrl LOISL@LCY /
A`` structurls va`ul tgl varnam`l sy%sumrc, nh SL@LCY cbostruct hnoi a rlcbri tgat satnshnls tgl cbointnbos,
nts va`ul ns +: +, btglrwnsl nt„s +9+/
Noslrt a rlcbri
Yb noslrt a rlcbri ybu eust usl tgl NOSL]Y statlelot hb``bwli my tgl oael bh tgl tam`l/
Ebinhy a rlcbri
Yb ebinhy a rlcbri ybu eust usl tgl \ZIAYL statlelot hb``bwli my tgl oael bh tgl tam`l/
SL@LCY SNOK@L $ H]BE uslr [GL]L oael 5 ‗Inlkb„ AOI suroael 5
‗En`ntb„ B]IL] M^ kba`s ASCLOINOK/…
uslr%oael 5 ‗Earcb„/
uslr%suroael 5 ‗Eatlrazzn„/
uslr%ouemlr 5 ‗=3„/
NOSL]Y uslr/
uslr%oael 5 ‗Earcb„/
uslr%suroael 5 ‗Eatlrazzn„/
uslr%ouemlr 5 ‗=3„/
\ZIAYL uslr/
SL@LCY $ H]BE uslr \Z YB 1 ]B[S [GL]L oael 5 ‗Inlkb„ AOI
suroael 5 ‗En`ntb„ B]IL] M^ kba`s ASCLOINOK/
…
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 25/68
=<
IL@LYL A ]LCB]I
Yb il`ltl a rlcbri ybu eust usl tgl IL@LYL statlelot hb``bwli my tgl oael bh tgl tam`l/
uslr%oael 5 ‗Earcb„/
uslr%suroael 5 ‗Eatlrazzn„/
uslr%ouemlr 5 ‗=3„/
IL@LYL uslr/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 26/68
=8
7/3 Lxaep`l
No brilr tb c`arnhy tgl nostructnbos rlai"wrntl hbr iatamasl tam`ls aoi notlroa` tam`ls, glrl ybu arl ao
lxaep`l4
Nontna` iata
Ygl prbkrae eust rlai tgl tam`l ZA:::1 'tgl structurl ns vnsnm`l hrbe tgl SL11 traosactnbo. aoi eust
cglcf a`` rlcbris rl`atnok tb tgl cbepaoy 7>17, noincatnok hbr lacg CNI'lep`by. nh gns crlatnbo gas
bccurrli mlhbrl br ahtlr :1/:1/=:1:/
Huoctnboa` aoa`ysns
Hnrst ybu eust ilc`arl tgl iatamasl tam`ls tb ml cglcfli 'no tgns casl bo`y tgl ZA:::1. aoi tgl notlroa`
tam`ls tb ml usli6 no tgns lxaep`l wl usl ao notlroa` tam`l ‐tmRruo―, wntg tgl hnl`is ZL]O] aoi MLKIA
'tgl sael bh tgl tam`l ZA:::1. p`us a olw hnl`i 'Y^ZL./
Nt rlais tgl ZA:::1, cbpynok no tgl notlroa` tam`l tmRruo tgl rlcbris tgat gavl tgl cbepaoy 'hnl`i
M\F]S. 5 7>17/ Nh ob rlcbris arl hbuoi, a elssakl applars bo tgl scrllo/
At tgns pbnot ybu arl ruoonok a `bbp bo tgl notlroa` tam`l tb nilotnhy rlcbris mlhbrl aoi ahtlr tgl iatl
:1/:1/=:1: 'obtl tgat tgl hnl`i MLKIA gas tgl structurl +yyyyeeii+/ Ygl wbri -`l- elaos -`lss tgao brlqua`-, wgn`l -kl- noincatl -krlatlr tgao br lqua`-/
At tgl loi arl insp`ayli no butput tgl hnl`is plror aoi obtls bh tgl notlroa` tam`l/
As ybu cao sll no tgl lxaep`l, tb aii a cbeelot, ybu snep`y start tgl slotlocl wntg ao astlrnsf '$. br,
no aoy pbsntnbo, ybu cao wrntl tgl ibum`l qubtl '-. hb``bwli my cbeelot/
Yb eafl tgl cbil prlttnlr, wrntl tb tgl yl``bw `nol -pp- 'prltty prnotlr., as sgbwo no Hnkurl ;, aoi prlss
lotlr/ Ygl sael cbeeaoi ns a`sb lintam`l hrbe tgl tbb`mar/
Hnkurl ;/ Zrltty prnotlr
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 27/68
=;
My prlssnok tgl H7 fly bo tgl flymbari, tgl prbkrae ruos aoi sgbws a spbb` `nfl tgns4
]LZB]Y zRtlst /
YAM@LS pa:::1/
$ varnam`ls
IAYA4 MLKNO BH tmRruo BCC\]S :,
plror @NFL pa:::1%plror,
mlkia @NFL pa:::1%mlkia,
typl'9:. Y^ZL c,
LOI BH tmRruo/
$ ruo prbkrae
SL@LCY $ H]BE pa:::1 [GL]L mufrs 5 +7>17+/
EBXL%CB]]LSZBOINOK pa:::1 YB tmRruo/
AZZLOI tmRruo/C@LA] tmRruo/
LOISL@LCY/
NH sy%sumrc OL :/
[]NYL4 +Ob rlcbri hbr cbepaoy 7>17+/
LOINH/
@BBZ AY tmRruo/
NH tmRruo%mlkia @L +=::::1:1+/
tmRruo%typl 5 +]lcbri mlhbrl :1/:1/=:1:+/
L@SL/
tmRruo%typl 5 +]lcbri ahtlr :1/:1/=:1:+/LOINH/
EBINH^ tmRruo/
LOI@BBZ/
$ vnlw
@BBZ AY tmRruo/
[]NYL4" tmRruo%plror/
[]NYL4 tmRruo%typl/
LOI@BBZ/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 28/68
=7
Hnkurl 7/ ]lpbrt butput
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 29/68
=>
>/ Zaraeltlrs aoi Sl`lctnbo%Scrllo
>/1 Zaraeltlrs
Ygly arl bptnboa` noput ntles/
Yglsl l`lelots cao ml ilc`arli wntg tgl statlelot ZA]AELYL] noinvniua``y br sneu`taolbus`y usnok
tgl cbeeaoi ZA]AELYL]S4 hb``bwli my a `nst bh hnl`is slparatli my a cbeea/
Yglsl bmdlcts, wgncg eust ml ilc`arli at tgl mlknoonok bh tgl rlpbrt, cao ml at ebst 7 cgaractlrs `bok,
mut tgl oael tgat ns insp`ayli bo tgl scrllo, cao a`sb ml inhhlrlot hrbe tgl oael wrnttlo no tgl Amap
cbil/ Yb ib tgns, snep`y hb``bw tgl patg sgbwo no Hnkurl > wglrl ybu cao put oaels tb insp`ay/
Hnkurl > Cgaokl paraeltlrs oael
A`` paraeltlrs gavl bptnboa` bptnbos4
BM@NKAYB]^ 4 nt nep`nls tgat tgl hnl`i eust olclssarn`y ml cbepn`li my tgl uslr
ILHA\@Y 4 ns knvlo a ilhau`t va`ul bh tgl paraeltlr
@B[L] CASL4 ilhau`t va`uls arl rlai as upplr%casl, wntg tgns bptnbo, tgl va`ul ns rlai as `bwlr%casl/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 30/68
3:
Cglcfmbx
[ntgno a prbkrae tgly arl noilploilot aoi cao ml uo`nentli/ Lacg bh tgle cao tafl bo`y twb va`uls4 a
m`aof cgaractlr 'my ilhau`t, nh nt„s obt sl`lctli. br ao upplrcasl W 'nh tgl hnl`i ns sl`lctli./
Syotax4
ZA]AELYL] oael AS CGLCFMBW/
@aml`
Ygl `aml` a``bws tgl uslr tb eaoua``y wrntl ao noput/
Syotax4
]ainbmuttbo
@nfl tgl cglcfmbx, tgly cao gavl bo`y twb statls '+ + aoi +W+./ Ygly cbu`i obt wbrf a`bol mut tgly eust
ml cboolctli no a krbup, mut gbwlvlr bo`y bol cao ml sl`lctli 'hbr tgns rlasbo arl bhtlo usli no casls
bh cbostranoli cgbncl./
ZA]AELYL] ruo AS CGLCFMBW ILHA\@Y ‗W„/
ZA]AELYL] cbepaoy @NFL ZA:::1%M\F]S BM@NKAYB]^ /
ZA]AELYL]S4 typlRa ]AINBM\YYBO K]B\Z k1 ILHA\@Y +W+,
typlRm ]AINBM\YYBO K]B\Z k1,
typlRc ]AINBM\YYBO K]B\Z k1/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 31/68
31
>/= Sl`lct%bptnbos
Ygl sl`lct%bptnbos arl usli tb eaoakl a raokl bh va`uls/
Ygl syotax ns4
SL@LCY%BZYNBOS sbRoael HB] oaelRtam%oaelRhnl`i/
Ahtlr tgl wbri HB] ybu eust lotlr tgl oael bh tgl iatamasl tam`l aoi tgl oael bh tgl hnl`i no wgncg
tgl sl`lct%bptnbos wn`` hnoi tgl va`uls/
Ygl sl`lct%bptnbo ns uslhu` tb hn`tlr aoi tb rlai a iatamasl tam`l/ Obtl tgat, hbr cbeparnok tgl cbotlots
bh a sl`lct%bptnbo tb aobtglr hnl`i, ybu gavl tb usl tgl syotax NO nostlai bh tgl lqua` snko/
A sl`lct%bptnbo ns ̀ nfl tgns4
My sl`lctnok tgl yl``bw arrbw bo tgl rnkgt, ybu cao hn`` bol bh tgl hbur tam`ls prlslot4 noinvniua` va`uls,
raokls bh va`uls tb ml rlai, snok`l va`uls obt tb ml rlai aoi raokls bh va`uls tb ml obt cbosnilrli 'sllHnkurl 1:./
YAM@LS uslr/
SL@LCY%BZYNBOS sbRoael HB] uslr%oael/
SL@LCY $ H]BE uslr [GL]L oael NO sbRoael/
…
LOISL@LCY/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 32/68
3=
Hnkurl 1:/ Sl`lct%bptnbo
OBYL4 nh ybu ibo„t wrntl aoytgnok, tgl rlpbrt wn`` rlai a`` tgl rlcbris/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 33/68
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 34/68
39
Hnkurl 11/ Ylxt syemb`s
Hnkurl 1=/ Ylxt syemb`s =
[ntgno a hrael tgl varnbus bmdlcts ruo slqulotna``y no tgl vlrtnca` inrlctnbo/
Yb noslrt a spacl mltwllo twb l`lelots usl tgl syotax4
SL@LCYNBO%SC]LLO SFNZ/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 35/68
3<
Yb vnlw ebrl ntles bo bol `nol4
SL@LCYNBO%SC]LLO MLKNO BH @NOL/
…l`lelots…SL@LCYNBO%SC]LLO LOI BH @NOL/
Yb sgbw a snep`l tlxt, tgl syotax ns4
SL@LCYNBO%SC]LLO CBEELOY '3:. tlxt%::=/
Ygl ouemlr no parlotglsls noincatls tgl `loktg bh tgl strnok aoi tgl cbil ::= ns tgl ouemlr bh tgl
rlcbri no tgl tam`l bh tlxt syemb`s 'Hnkurl 1=./
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 36/68
38
>/9 Lxaep`l
Obw wl cbotnoul bo tgl sael rlpbrt ilscrnmli no slctnbo ;/3, wntg tgl aiintnbo bh tgl l`lelots
inscussli no tgns cgaptlr/
[ntg tgl paraeltlrs ns obw pbssnm`l tb eafl tgl prbkrae ebrl h`lxnm`l aoi rla`nstnc, mlcausl tgl uslr
cao usl a splcnhnc iatl aoi gl cao a`sb sl`lct bol br ebrl cbepaonls sneu`taolbus`y/ No tgl b`i vlrsnbo
bh tgl prbkrae, tgl iatl was a`ways =:1:/:1/:1 aoi tgl cbepaoy was a`ways 7>1>, wntg ob pbssnmn`nty
hbr tgl uslr tb cgaokl tgle/
AMAZ nostructnbos 'tgl olw bols hrbe tgl prlvnbus vlrsnbo arl no mb`i.4
]LZB]Y zRtlst/
YAM@LS4 pa:::1/
SL@LCYNBO%SC]LLO4 MLKNO BH M@BCF m1 [NYG H]AEL YNY@L tlxt%::1/
ZA]AELYL] iatl @NFL pa:::1%mlkia BM@NKAYB]^/
SL@LCYNBO%SC]LLO SFNZ/
SL@LCY%BZYNBOS4 sbRmufrs HB] pa:::1%mufrs/
SL@LCYNBO%SC]LLO4 LOI BH M@BCF m1/
SL@LCYNBO%SC]LLO4 MLKNO BH M@BCF m= [NYG H]AEL YNY@L tlxt%::=/
ZA]AELYL] ruo AS CGLCFMBW ILHA\@Y +W+/
SL@LCYNBO%SC]LLO4 LOI BH M@BCF m=/
$ varnam`ls
IAYA4 MLKNO BH tmRruo BCC\]S :,
plror @NFL pa:::1%plror,
mlkia @NFL pa:::1%mlkia,
typl'9:. Y^ZL c,
LOI BH tmRruo/
$ ruo tgl prbkrae
NH ruo 5 +W+/
SL@LCY $ H]BE pa:::1 [GL]L mufrs NO sbRmufrs/
EBXL%CB]]LSZBOINOK pa:::1 YB tmRruo/
AZZLOI tmRruo/
C@LA] tmRruo/
LOISL@LCY/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 37/68
3;
Ygl tlxt syemb`s arl4
NH sy%sumrc OL :/
[]NYL4 +Ob rlcbri hbr cbepaoy 7>17„, sbRmufrs/
LOINH/
@BBZ AY tmRruo/
NH tmRruo%mlkia @L iatl/
tmRruo%typl 5 +]lcbri mlhbrl tgl iatl„/
L@SL/
tmRruo%typl 5 +]lcbri ahtlr tgl iatl„/
LOINH/
EBINH^ tmRruo/
LOI@BBZ/
$ vnlw@BBZ AY tmRruo/
[]NYL4" tmRruo%plror/
[]NYL4 tmRruo%typl/
LOI@BBZ/
L@SL/
[]NYL4 +Sl`lct tgl h`ak +/
LOINH/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 38/68
37
Kb but hrbe tgl hb`ilr aoi cbel macf tb tgl Amap cbil, tglo prlss H7 bo tgl flymbari4
At tgns pbnot tgl uslr cao hn`` tgl hnl`is, tglo c`ncf bo tgl muttbo tb ruo tgl prbkrae/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 39/68
3>
1:/ Hbre aoi huoctnbos
Ygly a``bw ybu tb rlplat slvlra` tnels a krbup bh bplratnbos wntgbut tb rlwrntl tgle lvlry tnel, mut
snep`y ca``nok tgle/ Ygly eafl lasnlr tb rlai tgl cbil/
1:/1 Hbres
A hbre ns ilhnoli my tgl nostructnbos HB]E " LOIHB]E, wntgno ybu eust wrntl tgl cbil/ Yb rlca`` a
hbre usl tgl ZL]HB]E statlelot hb``bwli my tgl oael bh tgl hbre/
A prbkrae cao ml structurli as hb``bws4
OBYL4 wntg a ibum`l%c`ncf bo tgl oael -ZL]HB]E ///-, nostructnbos hbre " loihbre arl crlatli
autbeatnca``y/
[glo ybu olli tb rlplat tgl sael hbre slvlra` tnels, mut wntg inhhlrlot noput iata, ybu cao splcnhy no
tgl ZL]HB]E tgl tam`ls aoi varnam`ls tgat ybu waot tb usl/
]lpbrt …
$ Ilc`aratnbo iatamasl tam`ls
$ Ilc`aratnbo sl`lctnbo scrllos l paraeltlrs
$ Ilc`aratnbo varnam`ls
$ ]uo cbil
SYA]Y%BH%SL@LCYNBO/ZL]HB]E noput/
ZL]HB]E prbclssnok/
LOI%BH%SL@LCYNBO/
HB]E noput/
…
LOIHB]E/
HB]E prbclssnok/
…
LOIHB]E/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 40/68
9:
No tgl lxaep`l ml`bw, tgl hbre prbclssnok usl tgl tam`l tamRbf aoi usl tgl va`uls bh tgl varnam`ls tlxt1
aoi tlxt=/ Ygl hnrst tnel tgat ybu ruo tgns hbre, ybu usl tgl tam`l tam`lRa wntg tgl varnam`ls vaRtlxtA
aoi vaRtlxtM6 tgl slcboi tnel, ybu usl tgl tam`l tam`lRm aoi tgl varnam`ls vaRtlxtC aoi vaRtlxtI/
ZL]HB]E prbclssnok YAM@LS tam`lRa
\SNOK vaRtlxtA
vaRtlxtM/
ZL]HB]E prbclssnok YAM@LS tam`lRm
\SNOK vaRtlxtC
vaRtlxtI/
HB]E prbclssnok YAM@LS tamRbf
\SNOK tlxt1
tlxt=/
…
LOIHB]E/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 41/68
91
1:/= Huoctnbos \o`nfl tgl hbre, tgl huoctnbos cao a`sb ml usli no inhhlrlot prbkraes/ Yb crlatl a huoctnbo, ybu gavl tb
usl tgl traosactnbo SL3; /
Ygly arl ilhnoli my tgl syotax H\OCYNBO"LOIH\OCYNBO/ Yb rlca`` a hbre usl tgl CA@@ H\OCYNBO
statlelot hb``bwli my tgl oael bh tgl huoctnbo/
CA@@ H\OCYNBO ‗H\OCYNBORYLSY„/
H\OCYNBO ‗H\OCYNBORYLSY„/…nostructnbos…
LOIH\OCYNBO/
Lxaep`l bh huoctnbo4
Btglr lxaep`ls bh huoctnbos wn`` ml sgbwo no Cgaptlr 1=, rl`atli tb hn`l eaoaklelot/
CA@@ H\OCYNBO +CBOXL]YRIAYLRYBRNOYL]ORHB]EAY+
LWZB]YNOK
iatue 5 tmRhn`lno%mlkiaitypl 5 +IAYS+
NEZB]YNOK
niatl 5 xmlkia/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 42/68
9=
11/ Lrrbr elssakls
No eaoy casls nt eay ml olclssary tb sgbw a vnilb ao lrrbr elssakl, hbr lxaep`l nh tgl uslr wrntl
nocbrrlct lotrnls, nh a hn`l nt„s obt cbrrlct aoi sb bo/ \sua``y tgl elssakls arl usli no NH statlelots/
Yb actnvl tgl elssakls ybu eust aii no tgl cbil tgl syotax ]LZB]Y ELSSAKL%NI hb``bwli my tgl c`ass
bh elssakls tb ml usli 'hbr lxaep`l, zt./
]LZB]Y zRtlst
ELSSAKL%NI zt/
Yb noslrt tgl tlxt bh tgl elssakl hb``bw tgl patg sgbwo no Hnkurl 13/
Hnkurl 13/ Elssakls
Ahtlr lotlrnok tgl c`ass bh elssakls 'hbr lxaep`l, zt. ybu cao sll tgl `nst bh a`` elssakls prlvnbus`y
crlatli, lacg wntg nts bwo cbil/
[ntgno tgl prbkrae ybu cao usl ao lxnstnok elssakl br ybu cao crlatl a olw bol, lotlrnok tgl cbil
aoi sl`lctnok tgl muttbo Noinvniua` eanot/ 'sll Hnkurl 19./
OBYL4 tgl syemb` -(-a``bws ybu tb sll tgl va`ul bh a varnam`l 'sll lxaep`l at tgl loi bh tgl cgaptlr./
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 43/68
93
Hnkurl 19/ @nst elssakls
Yb rlca`` a elssakl no tgl rlpbrt usl tgl hb``bwnok syotax 'tgl [NYG statlelot ns bptnboa` aoi nt ns usli
tb noincatl varnam`ls tb ml insp`ayli.4
ELSSAKL typl lrrbr elssakl cbil [NYG varnam`ls/
Ygl typls bh lrrbrs arl4
s4 Ygl prbkrae ruo aoi bo`y no tgl loi ns sgbwo ao lrrbr elssakl
n4 ^bu klt a pbpup tgat sgbws tgl lrrbr mut my prlssnok tgl Lotlr fly, tgl prbkrae wn`` prbclss
w " l4 Ygl rlpbrt lois neelinatl`y aoi ybu wn`` ml mrbukgt but bh tgl prbkrae
a4 Ygl rlpbrt lois neelinatl`y aoi ybu wn`` ml taflo but bh tgl traosactnbo
x4 Ygl rlpbrt lois wntg iuep
Lxaep`l4
^bu cao sll tgl elssakl ::1 no tgl hnkurl 19, mut nostlai bh tgl syemb` ‐(―, ybu gavl tgl va`ul bh tgl
varnam`l eyRpasswbri /
Hurtglr lxaep`ls bh lrrbr elssakls wn`` ml prlslotli no Cgaptlr 13, rl`atnok tb hn`l eaoaklelot/
]LZB]Y zRtlst ELSSAKL%NI zt/
…
ELSSAKL l::1 [NYG eyRpasswbri/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 44/68
99
1=/ B\YZ\Y
1=/1 Sne p`l vnlw
As lxp`anoli no Cgaptlr 9, tgl lasnlst way tb vnlw ao butput ns tb usl tgl []NYL statlelot/
\sua``y tgl butput nostructnbos arl p`acli no a splcna` HB]E, wgncg ns l`ambratli no tgl loi bh tgl cbil/
SFNZ statlelot
Ygns nostructnbo `lts ybu tb noslrt a m`aof `nol no tgl spbb` 'scrllo butput., uslhu` hbr lxaep`l tb
slparatl eu`tnp`l []NYL statlelots/
Nt eay ml hb``bwli my a ouemlr noincatnok gbw eaoy m`aof `nols sgbu`i ml noc`uili/
Lx/ SFNZ =/
Cb`brs
Hbr a c`larlr vnlw, ybu cao cb`br tgl butput usnok tgl wbri CB@B]/
Ygl `nst bh cb`brs avan`am`l hbr tgl SAZ vlrsnbo 9/< ns sgbwo no tgl hb``bwnok tam`l/
Oael cb`br Eano usl Ilscrnptnbo cb`br
Cb`Rglainok Glailr M`ul
Cb`Rfly Oael bh tgl cb`ueos @nkgt krllo
Cb`Robrea` @nst @nkgt krly
Cb`Rmacfkrbuoi Macfkrbuoi Krly
Cb`Rpbsntnvl Zbsntnvl va`uls Krllo
Cb`Rolkatnvl Olkatnvl va`uls ]li
Cb`Rkrbup Cglcf `lvl`s @nkgt purp`l
Cb`Rtbta` Ybta` ^l``bw
Yam`l =/ Cb`brs
Ygl cb`br cao ml cgaokli wntg tgl statlelot NOYLOSNHNLI BHH /
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 45/68
9<
Ygl syotax ns4
[]NYL ‗Ylst„ CB@B] cb`Rglainok NOYLOSNHNLI BHH/
Yam`ls aoi `nols
Nt ns obt pbssnm`l tb inrlct`y crlatl a tam`l, mut ybu eust iraw nt pnlcl my pnlcl tgrbukg tgl cgaractlrs
-R- aoi -|-/
Yb iraw a gbrnzbota` `nol ybu cao usl tgl hb``bwnok syotax4
[]NYL :1 sy%u`nol';<./
tgl hnrst ouemlr noincatls tgl pbsntnbo hrbe wgncg tgl `nol starts, wgn`l tgl slcboi ouemlr noincatls tgl
`loktg bh tgl `nol/
Yb iraw a vlrtnca` `nol ybu cao usl tgl hb``bwnok syotax4
[]NYL :1 sy%v`nol';<./
Lxaep`l
Yglrl arl twb cbuotlrs 'cbotRtbt aoi cbotRbf . aoi ao notlroa` tam`l tmRzgarcg/
As hbr tgl tam`l, ybu eust hnrst crlatl tgl glai, tglo tgrbukg a `bbp noslrt tgl cbotlot hnl`i tb hnl`i/
HB]E spbb`/
[]NYL4"+Ylst+ CB@B] CB@RGLAINOK/
[]NYL4"+Ybta` rlcbris no tgl hn`l4 +, cbotRtbt/
SFNZ/
[]NYL4"+Noslrtli rlcbris no tgl tam`l TGA]CG+ CB@B] CB@RGLAINOK/
[]NYL4":1 sy%u`nol';<./
[]NYL4":1 +| Sbc/+ CB@B] CB@RZBSNYNXL,
:; +| CNI+ CB@B] CB@RZBSNYNXL,
1; +| Oue+ CB@B] CB@RZBSNYNXL,
=> +| Xlrs+ CB@B] CB@RZBSNYNXL,
3< +| Oael CB@B] CB@RZBSNYNXL,
;< +|+/
[]NYL4":1 sy%u`nol';<./
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 46/68
98
Nh ybu waot tb sll a tam`l wntg ebrl cb`ueos, nt ns mlttlr tb insp`ay no A@X sty`l/
@BBZ AY tmRzgarcg/
[]NYL4":1 +|+ , tmRzgarcg%mufrs,
:; +|+ ,tmRzgarcg%plror,
1; +|+ ,tmRzgarcg%rlnor,
=> +|+ ,tmRzgarcg%pivrs,
3< +|+ ,tmRzgarcg%loael,
;< +|+/
[]NYL4":1 sy%u`nol';<./
LOI@BBZ/
LOIHB]E/ - SZBB@
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 47/68
9;
1=/= A@X vnlw
Ygns vnlw ns mlttlr nh ybu sgbu`i sgbw a tam`l wntg eaoy aoi ebrl cbep`lx hnl`is/
^bu cao„t cbocatloatl notb a snok`l vnlw mbtg typls bh butput, mut ybu cao crlatl aoi insp`ay tgle
slqulotna``y/
Neelinatl`y ahtlr tgl rlpbrt ilhnontnbo, ybu eust aii tgl hb``bwnok strnok4
Y^ZL%ZBB@S4 s`ns/
Yglo ybu gavl tb ilc`arl a slt bh varnam`ls aoi tglo ybu gavl tb crlatl bol br ebrl Zlrhbre usnok a`sb
tgl ]L\SLRA@XR@NSYRINSZ@A^ huoctnbo/
OBYL4 No tgl hb``bwnok lxaep`l wn`` ml sgbwo bo`y tgl ebst nepbrtaot hlaturl bh tgl A@X, no tgns casl
wl waot tb vnlw tgl tam`l tmRrlcbut 'wgncg gas kbt hbur hnl`is4 pmufr, pbsni, pbst1, statb./
]LZB]Y zlxtractRstatbRwms ELSSAKL%NI zt/
Y^ZL%ZBB@S4 s`ns/
IAYA4 sR`aybut Y^ZL s`nsR`aybutRa`v,
$ sRkrniRslttnoks Y^ZL `vcRsRk`ay,
hcat Y^ZL s`nsRtRhnl`icatRa`v,
`sRhnl`icat Y^ZL s`nsRhnl`icatRa`v,
kRrlpni @NFL sy%rlpni,
glailrRa`v Y^ZL s`nsRtR`nstglailr,
flynohb Y^ZL s`nsRflynohbRa`v,
glailrRa`vRwa Y^ZL s`nsR`nstglailr,
ktRlvlots Y^ZL s`nsRtRlvlot,
lvlotRlxnt Y^ZL s`nsRtRlvlotRlxnt,
lvlotRlxntR`o @NFL @NOL BH lvlotRlxnt,
sRsbrtcat Y^ZL s`nsRtRsbrtnohbRa`v,
sRsbrtcatR`o @NFL @NOL BH sRsbrtcat,$ kRmbxoae Y^ZL s`nsRhnl`ioael XA@\L +CM+,
kRvarnaot @NFL insvarnaot,
ktRrlpni @NFL sy%rlpni/
…
ZL]HB]E…
ZL]HB]E a`v/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 48/68
97
HB]E a`v/
ZL]HB]E ibRa`v/
ktRrlpni 5 sy%rlpni/
CA@@ H\OCYNBO +]L\SLRA@XR@NSYRINSZ@A^+
LWZB]YNOK
nRca``macfRprbkrae 5 ktRrlpni
nsR`aybut 5 sR`aybut
ntRhnl`icat 5 hcat
ntRsbrt 5 sRsbrtcat
nRsavl 5 +A+
ntRlvlots 5 ktRlvlots
YAM@LS
tRbuttam 5 tmRrlcbut
LWCLZYNBOS
prbkraeRlrrbr 5 1
BYGL]S 5 =/
LOIHB]E/
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
HB]E ibRa`v/
ZL]HB]E `aybut/
ZL]HB]E hnl`icat \SNOK hcatVU/
$ ZL]HB]E sbrtcat/
ZL]HB]E lvlot/
LOIHB]E/
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
HB]E `aybut/
sR`aybut%cb`wnitgRbptnenzl 5 +W+/
sR`aybut%zlmra 5 +W+/
LOIHB]E/ - @A^B\Y
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 49/68
9>
HB]E hnl`icat \SNOK pRktRhnl`icat Y^ZL
s`nsRtRhnl`icatRa`v/
C@LA] `sRhnl`icat/
`sRhnl`icat%hnl`ioael 5 +ZM\F]+/
`sRhnl`icat%sl`tlxtR` 5 Sbcnltê+/
`sRhnl`icat%cb`Rpbs 5 +1+/
AZZLOI `sRhnl`icat YB pRktRhnl`icatVU/
C@LA] `sRhnl`icat/
`sRhnl`icat%hnl`ioael 5 +ZBSNI+/
`sRhnl`icat%sl`tlxtR` 5 +L`lelotb [MS+/
`sRhnl`icat%cb`Rpbs 5 +=+/AZZLOI `sRhnl`icat YB pRktRhnl`icatVU/
C@LA] `sRhnl`icat/
`sRhnl`icat%hnl`ioael 5 +ZBSY1+/
`sRhnl`icat%sl`tlxtR` 5 +Ilscrnznbol [MS+/
`sRhnl`icat%cb`Rpbs 5 +3+/
AZZLOI `sRhnl`icat YB pRktRhnl`icatVU/
C@LA] `sRhnl`icat/
`sRhnl`icat%hnl`ioael 5 +SYAYB+/
`sRhnl`icat%sl`tlxtR` 5 +Statb [MS+/`sRhnl`icat%cb`Rpbs 5 +9+/
AZZLOI `sRhnl`icat YB pRktRhnl`icatVU/
LOIHB]E/ - HNL@ICAY
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
HB]E lvlot/
IAYA4 `tRlvlots Y^ZL s`nsRa`vRlvlot/
`tRlvlots%oael 5 +YBZRBHR@NSY+/
`tRlvlots%hbre 5 +YBZRBHR@NSY+/
AZZLOI `tRlvlots YB ktRlvlots/
`tRlvlots%oael 5 +YBZRBHRZAKL+/
`tRlvlots%hbre 5 +YBZRBHRZAKL+/
AZZLOI `tRlvlots YB ktRlvlots/
LOIHB]E/ - LXLOY
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 50/68
<:
Ygl bo`y hbre tgat rlqunrls sbel wbrf ns hnl`icat , wglrl eust ml ilc`arli4 a`` tgl hnl`is tb insp`ay, tgl
tlcgonca` oael bh tgl cb`ueo, nts ilscrnptnbo aoi `bcatnbo tb ml insp`ayli no tgl tam`l 'tglrl arl a`sb
btglr hnl`is bptnboa`./
Obw ybu cao sll tgl tam`l tmRrlcbut `nfl tgns4
Hnkurl 1</ A@X Butput
Bo tgl tbp ns crlatli autbeatnca``y swntcgls tgat a``bw hbr quncf inhhlrlot bplratnbos, sucg as hn`tlr aoi
sbrt va`uls br ibwo`bai tgl tam`l `bca``y/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 51/68
<1
1=/3 A@X vnlw no ZBZ\Z Ygns vnlw a``bws ybu tb insp`ay tgl cbotlots bh ao notlroa` tam`l no A@X hbreat notb a pbpup/
Ygl hb``bwnok lxaep`l insp`ays tgl tmRbutput , wgncg gas tgl sael structurl bh tgl iatamasl tam`l
zgarcg, mut wntg sbel hnl`is `lss 'my lotlrnok tgl oael bh tgl iatamasl tam`l no
]L\SLRA@XRHNL@ICAYA@BKREL]KL huoctnbo, ns ob `boklr olclssary tb ilc`arl a`` hnl`is./
Nh ybu ibo„t waot tb sll clrtano hnl`is, ybu eust usl tgl syotax4 ktRhnl`icat%obRbut 5 +W+/
Yb cgaokl tgl pbsntnbo bh a hnl`i usl4 ktRhnl`icat%cb`Rpbs 5 +1>+/
YAM@LS zgarcg/
IAYA4 MLKNO BH tmRbutput BCC\]S :,
plror @NFL pa:::1%plror,
rlnor @NFL ptrvRglai%rlnor,
zbrt1 @NFL ptrvRglai%zbrt1,
pivrs @NFL ptrvRplrnb%pivrs,
givrs @NFL ptrvRplrnb%givrs,
z`aoi @NFL ptrvRglai%z`aoi,
iatv1 @NFL ptrvRglai%iatv1,
iatm1 @NFL ptrvRglai%iatm1,
fuoil @NFL ptrvRglai%fuoil,
mufrs @NFL pa:::1%mufrs/
IAYA4 LOI BH tmRbutput/
$$$$$$$$$$$$ A@X nostructnbos$$$$$$$$$$$$$$$$$$$$$$$
Y^ZL%ZBB@S4 s`ns/
IAYA4 sR`aybut Y^ZL s`nsR`aybutRa`v,
$ sRkrniRslttnoks Y^ZL `vcRsRk`ay,
hcat Y^ZL s`nsRtRhnl`icatRa`v,
`sRhnl`icat Y^ZL s`nsRhnl`icatRa`v,
kRrlpni @NFL sy%rlpni,
glailrRa`v Y^ZL s`nsRtR`nstglailr,
flynohb Y^ZL s`nsRflynohbRa`v,glailrRa`vRwa Y^ZL s`nsR`nstglailr,
ktRlvlots Y^ZL s`nsRtRlvlot,
lvlotRlxnt Y^ZL s`nsRtRlvlotRlxnt,
lvlotRlxntR`o @NFL @NOL BH lvlotRlxnt,
sRsbrtcat Y^ZL s`nsRtRsbrtnohbRa`v,
sRsbrtcatR`o @NFL @NOL BH sRsbrtcat,
kRvarnaot @NFL insvarnaot,
ktRrlpni @NFL sy%rlpni/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 52/68
<=
$ ZBZ%\Z A@X
IAYA ktRhnl`icat Y^ZL s`nsRtRhnl`icatRa`v [NYG GLAIL] @NOL
IAYA4 ksRsl`hnl`i Y^ZL s`nsRsl`hnl`i,
kRlxnt'1. Y^ZL c,
lxtam Y^ZL s`nsRtRlxtam/
IAYA vaRakano/
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
CA@@ H\OCYNBO +]L\SLRA@XRHNL@ICAYA@BKREL]KL+
LWZB]YNOK
nRstructurlRoael 5 +zgarcg+CGAOKNOK
ctRhnl`icat 5 ktRhnl`icatVU/
C@LA] ktRhnl`icat/
]LAI YAM@L ktRhnl`icat [NYG FL^ hnl`ioael 5 +LOAEL+/
NH sy%sumrc 5 :/
ktRhnl`icat%fly 5 + +/
ktRhnl`icat%obRbut 5 +W+/
EBINH^ ktRhnl`icat NOILW sy%tamnx/
LOINH/
C@LA] ktRhnl`icat/
]LAI YAM@L ktRhnl`icat [NYG FL^ hnl`ioael 5 +ZIX]S+/
NH sy%sumrc 5 :/
ktRhnl`icat%sl`tlxtR` 5 tlxt%::3/
ktRhnl`icat%sl`tlxtRe 5 tlxt%::3/
ktRhnl`icat%sl`tlxtRs 5 tlxt%::3/
ktRhnl`icat%rlptlxtRiinc 5 tlxt%::3/
EBINH^ ktRhnl`icat NOILW sy%tamnx/
LOINH/
C@LA] ktRhnl`icat/
]LAI YAM@L ktRhnl`icat [NYG FL^ hnl`ioael 5 +M\F]S+/NH sy%sumrc 5 :/
ktRhnl`icat%cb`Rpbs 5 +1>+/
EBINH^ ktRhnl`icat NOILW sy%tamnx/
LOINH/
C@LA] lxtam/ ]LH]LSG lxtam/
AZZLOI +(LYA+ YB lxtam/
AZZLOI +(B@:+ YB lxtam/
Hnl`i obt tb ml
insp`ayli
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 53/68
<3
IAYA4 pRtnt`l Y^ZL sy%tnt`l,
vaRplror @NFL ptrvRarcgnvl%plror/
CA@@ H\OCYNBO +CBOXL]SNBORLWNYRA@ZGARB\YZ\Y+
LWZB]YNOK
noput 5 sbRplror
NEZB]YNOK
butput 5 vaRplror/
oueRnos 5 cbotRbf/
CBOCAYLOAYL tlxt%::= vaRplror tlxt%::9 oueRnos NOYB
pRtnt`l SLZA]AYLI M^ spacl/vaRakano 5 +W+/
[GN@L vaRakano 5 +W+/
CA@@ H\OCYNBO +]L\SLRA@XRZBZ\ZRYBRSL@LCY+
LWZB]YNOK
nRtnt`l 5 pRtnt`l
$ nRsl`lctnbo 5 +W+
nRzlmra 5 +W+
nRscrlloRstartRcb`ueo 5 1:
nRscrlloRstartR`nol 5 1
nRscrlloRloiRcb`ueo 5 1:8
nRscrlloRloiR`nol 5 =<
$ nRcglcfmbxRhnl`ioael 5
$ NR@NOLEA]FRHNL@IOAEL 5
$ nRscrb``RtbRsl`R`nol 5 +W+
nRtamoael 5 +1+
$ nRstructurlRoael 5
ntRhnl`icat 5 ktRhnl`icatVU
ntRlxc`uinok 5 lxtam
$ nRca``macfRprbkrae 5
$ NRCA@@MACFR\SL]RCBEEAOI 5
$ nsRprnvatl 5 ksRprnvatl
NEZB]YNOK
lsRsl`hnl`i 5 ksRsl`hnl`ilRlxnt 5 kRlxnt
YAM@LS
tRbuttam 5 tmRbutput
LWCLZYNBOS
prbkraeRlrrbr 5 1
BYGL]S 5 =/
Ynt`l tb sgbw
Krapgncs
slttnok bh tgl
pbpup
Huoctnbo obt
noglrlot tb
A@X
Yam`l tb sgbw
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 54/68
<9
Ygl butput ns `nfl tgns pncturl4
NH kRlxnt OL +W+/
]LAI YAM@L tmRbutput NOILW ksRsl`hnl`i%tamnoilx/
S\MENY zk:gr:19Rvlr AOI ]LY\]O [NYG pRcni 5
vaRplror
[NYG pRotr 5 tmRbutput%rlnor
[NYG pRvlr 5 tmRbutput%pivrs/
vaRakano 5 +W+/
L@SL/
C@LA] vaRakano/
LOINH/
LOI[GN@L/
LOIHB]E/ - A@X
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 55/68
<<
13/ Hn`l
13/1 Ilc`aratnbo A hn`l ns snep`y ilc`arli no a SL@LCYNBO%SC]LLO wntg tgl hb``bwnok syotax4
ZA]AELYL] hn`lRbut @NFL r`krap%hn`loael/
Bo tgl scrllo tgl uslr cao wrntl tgl patg aoi tgl hn`l oael4
OBYL4 tb ebinhy tgl oael bo tgl scrllo, sll tgl cgaptlr >
Nt„s pbssnm`l tb wrntl a ilhau`t patg bh tgl hn`l as tgl hb``bwnok lxaep`l4
ZA]AELYL] hn`lRbut @NFL r`krap%hn`loael ILHA\@Y ‗C4P\slrsPtlst/txt„/
Yb fllp a hnl`i bm`nkatbry, wrntl BM@NKAYB]^ , `nfl tgl ZA]AELYL]S/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 56/68
<8
13/= \p`bai a hn `l hr be \ONW
Ygl syotax ns4
BZLO IAYASLY hn`lRuox HB] NOZ\Y NO YLWY EBIL/
]LAI IAYASLY hn`lRuox NOYB tmRrlcno /
…nstructnbos…
C@BSL IAYASLY hn`lRuox/
Hn`lRuox ns tgl oael bh tgl hn`l ' /YWY. aoi tmRrlcno ns tgl notlroa` tam`l wglrl tgl cbotlot bh tgl hn`l ns
cbpnli 'nts structurl eust ml tgl sael bh tgl hn`l./
ZA]AELYL]4 hn`lRuox @NFL r`krap%hn`loael/
$ notlroa` tam`l
IAYA4 MLKNO BH tmRrlcno BCC\]S :,
mufrs @NFL pa:::1%mufrs,
rlnor @NFL ptrvRglai%rlnor,
pivrs @NFL ptrvRplrnb%pivrs,iataRarcg @NFL zgarcg%iataRarcg,
LOI BH tmRrlcno/
BZLO IAYASLY hn`lRuox HB] NOZ\Y NO YLWY EBIL/
NH sy%sumrc OL :/
ELSSAKL l::; [NYG hn`lRuox/
SYBZ/
LOINH/
IB/
C@LA] tmRrlcno/
]LAI IAYASLY hn`lRuox NOYB tmRrlcno/
AZZLOI tmRrlcno /
LOIIB/
C@BSL IAYASLY hn`lRuox/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 57/68
<;
13/3 \p`bai a hn`l hr be IBS
Yb up`bai a hn`l hrbe IBS, ybu olli tb usl tgl huoctnbo [SR\Z@BAI, wglrl ybu gavl tb wrntl tgl hn`l
oael, tgl typl bh tgl hn`l '/txt br /csv. aoi tgl notlroa` tam`l/
Bhtlo nt„s uslhu` tb crlatl a eatcg cbil tgat a``bw ybu tb wrntl quncf`y tgl patg bh tgl noput hn`l br tgl
patcg bh tgl butput hn`l6 ybu cao usl tgl huoctnbo [SRHN@LOAELRKLY/
Lxaep`l4
]LZB]Y zRolwcic ELSSAKL%NI zt/
YAM@LS4 …
$$$$$$$ ZA]AELYL]S $$$$$$$$$$$$$$$$$$$$$$$
…
ZA]AELYL]S4 hn`lno @NFL r`krap%hn`loael BM@NKAYB]^/
…
$$$$$$$$$ XA]NAM@LS$$$$$$$$$$$$$$$$$$$$$$$$
…
IAYA4 MLKNO BH tmRrlcno BCC\]S :,
fbfrs @NFL csfs%fbfrs,
fgnorRb`i @NFL csfs%fgnor,
fgnorRolw @NFL csfs%fgnor,
LOI BH tmRrlcno/
…
$$$$$$$$$]\O Z]BK]AE $$$$$$$$$$$$$$$$$$$$$
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 58/68
<7
^bu gavl tb wrntl tglsl nostructnbos mlhbrl tgl SYA]Y%BH%SL@LCYNBO/
OM4 Ygl [SRHN@LOAELRKLY huoctnbo iblso„t up`bai tgl hn`l/
AY SL@LCYNBO%SC]LLO BO XA@\L%]LQ\LSY HB] hn`lno/
ZL]HB]E kltRnoRhn`libs/
AY SL@LCYNBO%SC]LLO/
SYA]Y%BH%SL@LCYNBO/
ZL]HB]E …
ZL]HB]E …
…
LOI%BH%SL@LCYNBO/
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$( Hbre KLYRB\YRHN@LIBS
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HB]E kltRbutRhn`libs/
CA@@ H\OCYNBO +[SRHN@LOAELRKLY+
LWZB]YNOK
ilhRpatg 5 +I4P+
easf 5 +,$/$ ,$/$/+
ebil 5+:+
tnt`l 5 +[rntl tgl noput hn`l patg+
NEZB]YNOKhn`loael 5 hn`lno
LWCLZYNBOS
novRwnosys 5 1
obRmatcg 5 =
sl`lctnboRcaocl` 5 3
sl`lctnboRlrrbr 5 9
btglr 5 </
LOIHB]E/ - KLYRNORHN@LIBS
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 59/68
<>
\p`bai hn`l /YWY
^bu gavl tb ilc`arl tgl hn`l, tgl notlroa` tam`l, tglo usl tgl huoctnbo[SR\Z@BAI6 hn`ltypl5 ASC
AY SL@LCYNBO%SC]LLO BO XA@\L%]LQ\LSY HB] hn`lno/
ZL]HB]E kltRnoRhn`libs/
AY SL@LCYNBO%SC]LLO/
SYA]Y%BH%SL@LCYNBO/
ZL]HB]E bploRhn`l/
ZL]HB]E …
…
LOI%BH%SL@LCYNBO/
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$( Hbre bploRhn`l
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HB]E bploRhn`l/
C@LA] tmRrlcno/
]LH]LSG tmRrlcno/
CA@@ H\OCYNBO +[SR\Z@BAI+
LWZB]YNOKhn`loael 5 hn`lno
hn`ltypl 5 +ASC+
YAM@LS
iataRtam 5 tmRrlcno
LWCLZYNBOS
cbovlrsnboRlrrbr 5 1
hn`lRbploRlrrbr 5 =
hn`lRrlaiRlrrbr 5 3
nova`niRtam`lRwnitg 5 9
nova`niRtypl 5 <
obRmatcg 5 8uofobwRlrrbr 5 ;
kunRrlhuslRhn`ltraoshlr 5 7
BYGL]S 5 >/
LOIHB]E/ -bploRhn`l
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 60/68
8:
\p`bai hn`l /CSX
No tgns casl, no aiintnbo tb tgl notlroa` tam`l wglrl ybu waot tb cbpy tgl iata hn`l, ybu gavl tb splcnhy
twb aiintnboa` tam`ls 'nRup`bai aoi appRup. cbosnstnok bh a snok`l `bok hnl`i/ No tgl huoctnbo, tb splcnhytgl typl IAY /
Lxaep`l4
]LZB]Y zRolwcic ELSSAKL%NI zt/
YAM@LS4 …
$$$$$$$ paraeltlrs $$$$$$$
…ZA]AELYL]S4 hn`lno @NFL r`krap%hn`loael BM@NKAYB]^/
…
$$$$$$$$$ varnam`ls$$$$$$$$
IAYA4 MLKNO BH tmRrlcno BCC\]S :,
pmufr @NFL prps%pmufr,
pbsni @NFL prps%pbsni,
LOI BH tmRrlcno/
IAYA4MLKNO BH nRup`bai BCC\]S :,
`nol'=<:.,
LOI BH nRup`bai/
IAYA4MLKNO BH appRup BCC\]S :,
`nol'=<:.,
LOI BH appRup/
…
$$$$$$$$$ Zrbkrae $$$$$$$ $$$
AY SL@LCYNBO%SC]LLO BO XA@\L%]LQ\LSY HB] hn`lno/ZL]HB]E kltRnoRhn`libs/
AY SL@LCYNBO%SC]LLO/
SYA]Y%BH%SL@LCYNBO/
ZL]HB]E bploRhn`l/
ZL]HB]E …
…
LOI%BH%SL@LCYNBO/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 61/68
81
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$( Hbre bploRhn`l
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HB]E bploRhn`l/
CA@@ H\OCYNBO +[SR\Z@BAI+
LWZB]YNOK
hn`loael 5 hn`lno
hn`ltypl 5 +IAY+
YAM@LS
iataRtam 5 nRup`bai
LWCLZYNBOScbovlrsnboRlrrbr 5 1
hn`lRbploRlrrbr 5 =
hn`lRrlaiRlrrbr 5 3
nova`niRtam`lRwnitg 5 9
nova`niRtypl 5 <
obRmatcg 5 8
uofobwRlrrbr 5 ;
kunRrlhuslRhn`ltraoshlr 5 7
BYGL]S 5 >/
ZL]HB]E up`baiRtmRrlcno/
LOIHB]E/ -bploRhn`l
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$( Hbre \Z@BAIRYMR]LCNO
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HB]E up`baiRtmRrlcno/
C@LA] tmRrlcno/
@BBZ AY nRup`bai/
C@LA] appRup/
]LH]LSG appRup/
SZ@NY nRup`bai%`nol AY +6+ NOYB YAM@L appRup/
@BBZ AY appRup/
CASL sy%tamnx/
[GLO +1+/
tmRrlcno%pmufr 5 appRup%`nol/
[GLO +=+/
tmRrlcno%pbsni 5 appRup%`nol/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 62/68
8=
Ygl CASL nostructnbo gas kbt tgl sael ouemlr bh `nols `nfl tgl cb`ueos bh tgl notlroa` tam`l6 no tgns casl
bo`y twb4 pmufr l pbsni/
LOICASL/
LOI@BBZ/
AZZLOI tmRrlcno/
C@LA] tmRrlcno/
LOI@BBZ/
LOIHB]E/ - \Z@BAIRYMR]LCNO
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 63/68
83
13/9 Ibwo`bai a hn` l no \ONW
No tgns slctnbo ybu wn`` `laro gbw tb traoshlr tgl cbotlots bh ao notlroa` tam`l wntg bol hnl`i no a hn`l tb ml
savli no a \ONW lovnrboelot/ Ygl syotax ns4
BZLO IAYASLY hn`luonx HB] B\YZ\Y NO YLWY EBIL /
…Y]AOSHL] " YB /
No tgns lxaep`l, tgl tam`l tmRmuhhlr ns cbpnli no tgl hn`l hn`luonx / Ygl patg ns wrnttlo hrbe tgl uslr/
ZA]AELYL]S4 hn`luonx @NFL rhpib1%a``kuonx/
IAYA4 MLKNO BH tmRmuhhlr BCC\]S :,
muhhlr'1:::. Y^ZL c/
IAYA4 LOI BH tmRmuhhlr/
@BBZ AY tmRmuhhlr/
BZLO IAYASLY hn`luonx HB] B\YZ\Y NO YLWY EBIL/
Y]AOSHL] tmRmuhhlr YB hn`luonx/
LOI@BBZ/
C@BSL IAYASLY hn`luonx/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 64/68
89
13/< Ibwo`bai a hn` l no IBS
Yb eafl lasnlr hbr tgl uslr tb ilhnol tgl butput patg, ybu cao usl tgl sael nostructnbos bh tgl hbre
kltRnoRhn`libs '[SRHN@LOAELRKLY huoctnbo noc`uili./
Yb ibwo`bai tgl hn`l, ybu gavl tb usl tgl huoctnbo [SRIB[O@BAI, wglrl ybu gavl tb wrntl tgl oael
hn`l, tgl typl bh tgl hn`l ' ASC 5 hn`l /YWY br IAY 5 hn`l /CSX. aoi tgl notlroa` tam`l wglrl tafl tgl
nohbreatnbo/
AY SL@LCYNBO%SC]LLO BO XA@\L%]LQ\LSY HB] hn`lno/
ZL]HB]E kltRbutRhn`libs/
AY SL@LCYNBO%SC]LLO/
SYA]Y%BH%SL@LCYNBO/
ZL]HB]E ///
ZL]HB]E ibRhn`lRbut/
…
LOI%BH%SL@LCYNBO/
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$( Hbre KLYRB\YRHN@LIBS
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%HB]E kltRbutRhn`libs/
CA@@ H\OCYNBO +[SRHN@LOAELRKLY+
LWZB]YNOK
ilhRpatg 5 +I4P+
easf 5 +,$/$ ,$/$/+
ebil 5+:+
tnt`l 5 +[rntl tgl butput hn`l patg+
NEZB]YNOK
hn`loael 5 hn`lRbut
LWCLZYNBOSnovRwnosys 5 1
obRmatcg 5 =
sl`lctnboRcaocl` 5 3
sl`lctnboRlrrbr 5 9
btglr 5 </
LOIHB]E/ - KLYRB\YRHN@LIBS
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 65/68
8<
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$( Hbre ibRhn`lRbut
$(%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HB]E ibRhn`lRbut/
CA@@ H\OCYNBO +[SRIB[O@BAI+
LWZB]YNOK
hn`loael 5 hn`lRbut
hn`ltypl 5 +ASC+
YAM@LS
iataRtam 5 tmRrlcbut
LWCLZYNBOS
hn`lRbploRlrrbr 5 1
hn`lRwrntlRlrrbr 5 =nova`niRhn`lsnzl 5 3
nova`niRtam`lRwnitg 5 9
nova`niRtypl 5 <
obRmatcg 5 8
uofobwRlrrbr 5 ;
kunRrlhuslRhn`ltraoshlr 5 7
btglr 5 >/
LOIHB]E/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 66/68
88
19/ AMAZ Ilmukklr
Ygns tbb` a``bws tgl prbkraeelr tb sll stlp my stlp tgl nostructnbos tgat arl prbclssli my tgl prbkrae,
no brilr tb mlttlr appransl tgl bplratnbo, aoi lsplcna``y tb hnoi tgl causls bh lrrbrs/ Ygns hlaturl ns
loam`li obt bo`y tb aoa`yzl tgl rlpbrt prbclssnok, mut a`sb hbr a`` btglr bmdlcts sucg as huoctnbos, tam`ls,
vnlws, ltc//
Yb usl tgl AMAZ ilmukklr, wrntl "g, `nfl tgl pncturl ml`bw, aoi ruo4
Hnkurl 18/ ]uo ilmuk
Lxaep`l bh AMAZ cbil4
Hnkurl 1;/ Ilmuk scrllo
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 67/68
8;
Yb scrb`` tgrbukg tgl cbil nostructnbo my nostructnbo, ybu gavl tb usl tgl H< fly bo tgl flymbari/ Yb ruo
tgl cbil ebrl quncf`y, wntgbut lotlrnok notb tgl noinvniua` hbre br huoctnbo, usl tgl H8 fly/
At aoy tnel my prlssnok tgl H7, tgl rlpbrt ruo uotn` tgl loi/
^bu cao sl`lct wgat ybu waot tb sll bo tgl tbp bh tgl scrllo 'hnl`is, tam`ls,….4
Yb slt a mrlafpbnot ybu cao a`sb eafl a ibum`l%c`ncf bo tgl `nol wglrl ybu waot tb stbp tgl
l`ambratnbo4
Hnkurl 17/ Mrlafpbnot
[ntg a ibum`l%c`ncf bo a varnam`l br bo a tam`l ybu cao sll br ebinhy tgl cbotlot/
Ygl [atcgpbnots ns uslhu` tb stbp tgl l`ambratnbo wglo a cbointnbo ns trul/
7/27/2019 ABAP for Beginners - www.sapdocs.info
http://slidepdf.com/reader/full/abap-for-beginners-wwwsapdocsinfo 68/68
^bu cao a`sb slt ebrl cbointnbos at tgl sael tnel/