You are on page 1of 445

0

SAP AG 2003
TAW10 Introduction to the ABAP Workbench (1/2)
SAP AG
TAW10 1/2
TAW10 1/2
ABAP Workbench
Fundamentals
ABAP Workbench
Fundamentals
R/3 System
Release 4.6D or above
2003/Q2
Material number 5006 0990
SA A! "A#$0 0%$
0.2
SAP AG 2003
Co!ri"ht 200# $AP A%& All ri"hts reser'ed&
(o art o) this ublication ma! be reroduced or transmitted in
an! )orm or )or an! urose *ithout
the e+ress ermission o) $AP A%& The in)ormation contained
herein ma! be chan"ed *ithout rior notice&
All ri"hts reser'ed&
Co!ri"ht
&omments on tra'emar(s)
Some so*t+are ,ro'u-ts mar(ete' by SA A! an' its 'istributors -ontain ,ro,rietary so*t+are
-om,onents o* ot.er so*t+are ven'ors.
Mi-roso*t/0 #12D3#S/0 2"/0 45&46/0 #or'/0 o+eroint/ an' SQ6 Server/ are re7istere'
tra'emar(s o* Mi-roso*t &or,oration.
18M/0 D82/0 D82 9niversal Database0 3S/2/0 arallel Sys,le:/0 M;S/4SA0 A15/0 S/390/0
AS/400/0 3S/390/0 3S/400/0 iSeries0 ,Series0 :Series0 <Series0 </3S0 A=0 1ntelli7ent Miner0
#ebS,.ere/0 2et*inity/0 "ivoli/0 1n*ormi: an' 1n*ormi:/ Dynami- Server"M are tra'emar(s o*
18M &or,oration in 9SA an'/or ot.er -ountries.
3RA&64/ is a re7istere' tra'emar( o* 3RA&64 &or,oration.
9215/0 5/3,en/0 3S=/$/ an' Moti*/ are re7istere' tra'emar(s o* t.e 3,en !rou,.
&itri:/0 t.e &itri: lo7o0 1&A/0 ro7ram 2ei7.bor.oo'/0 Meta=rame/0 #in=rame/0
;i'eo=rame/0 Multi#in/ an' ot.er &itri: ,ro'u-t names re*eren-e' .erein are tra'emar(s o*
&itri: Systems0 1n-.
>"M60 D>"M60 5M60 5>"M6 are tra'emar(s or re7istere' tra'emar(s o* #3&/0 #orl' #i'e
#eb &onsortium0 Massa-.usetts 1nstitute o* "e-.nolo7y.
?A;A/ is a re7istere' tra'emar( o* Sun Mi-rosystems0 1n-.
?A;AS&R1"/ is a re7istere' tra'emar( o* Sun Mi-rosystems0 1n-.0 use' un'er li-ense *or
te-.nolo7y invente' an' im,lemente' by 2ets-a,e.
MarketSet and Enterprise Buyer are jointly owned trademarks of SAP AG and Commerce ne!
SA0 R/0 mySA0 mySA.-om0 :A,,s0 :A,,0 an' ot.er SA ,ro'u-ts an' servi-es mentione'
.erein as +ell as t.eir res,e-tive lo7os are tra'emar(s or re7istere' tra'emar(s o* SA A! in
!ermany an' in several ot.er -ountries all over t.e +orl'. All ot.er ,ro'u-t an' servi-e names
mentione' are t.e tra'emar(s o* t.eir res,e-tive -om,anies.
SA A! "A#$0 0%2
0.3
SAP AG 2003
,e'eloment Consultant m!$AP Technolo"! -
ABAP Workbench
mySAP Technology
- ABAP Workbench
Concepts
TAW12 15 days
Development
consltant
cert!"!cat!on #
mySAP Technology
# ABAP Workbench
TAW1$ 1$ days
mySAP Technology -
ABAP Workbench
%ndamentals
SA A! "A#$0 0%3
0.4
SAP AG 2003
Course Prere.uisites
Required
$olid /,P basic kno*led"e
%ood ro"rammin" e+erience in a di))erent
ro"rammin" lan"ua"e
SA A! "A#$0 0%4
0.5
SAP AG 2003
Tar"et "rou
&
&
Target group
Duration
10 da!s
,e'eloment consultants and de'eloers *ho are
resonsible )or adatin" and de'eloin" ABAP/ABAP
0b1ects ro"rams
SA A! "A#$0 0%5
0.6
SAP AG 2003
At the end o) this course2 !ou *ill be able to3
Work *ith the ABAP Workbench tools
Write !our o*n simle ABAP ro"rams
Pro"ram ob1ect4oriented ABAP 0b1ects
Course %oals
SA A! "A#$0 0%6
0.7
SAP AG 2003
Comple" m!$AP&com Technolo"ies
Comple" ABAP Workbench 4
Fundamentals
Comple" ABAP 0b1ects
Case $tud!
Course Content3 m!$AP Technolo"! - ABAP
Workbench Fundamentals
Pre)ace
".is SA &onsultant 4'u-ation trainin7 -ourse -ontains 'i**erent in'ivi'ual -ourses @se-tionsA0 ea-.
o* +.i-. 'eals +it. a se,arate to,i-
4a-. in'ivi'ual -ourse @se-tionA is 'ivi'e' into 'i**erent units.
SA A! "A#$0 0%B
0.8
SAP AG 2003
Comple" Pro"rammin" ,atabase
5dates
Comple" $olution 6ana"er
Comple" /nhancements and
6odi)ications
Case $tud!
Comple" ABAP ,ictionar!
Comple" Techni.ues o) 7ist
Processin"
Comple" Pro"rammin" 5ser
,ialo"s
Course Content3 m!$AP Technolo"! - ABAP
Workbench Concets
Pre)ace
".is SA &onsultant 4'u-ation trainin7 -ourse -ontains 'i**erent in'ivi'ual -ourses @se-tionsA0 ea-.
o* +.i-. 'eals +it. a se,arate to,i-
4a-. in'ivi'ual -ourse @se-tionA is 'ivi'e' into 'i**erent units.
SA A! "A#$0 0%C
SAP AG 2003
Comle+3 m!$AP&com Technolo"ies
SA A! "A#$0 $%$
SAP AG 2003
Course Content3 m!$AP&com Technolo"ies
#nit m!$AP&com
#nit (a'i"ation
#nit Technical $tructure o) an $AP $!stem
#nit Cross4$!stem Concets
SA A! "A#$0 $%2
SAP AG 2003
$!stem 0'er'ie*
Internet Technolo"ies
Inter)aces
$AP $er'ice 6arketlace
Contents3
m!$AP&com
SA A! "A#$0 2%$
SAP AG 2003
m!$AP&com (1)
$!stem 0'er'ie*
$!stem 0'er'ie* $!stem 0'er'ie*
Internet Technolo"ies
Internet Technolo"ies
Inter)aces
Inter)aces
$AP $er'ice 6arketlace
$AP $er'ice 6arketlace
SA A! "A#$0 2%2
SAP AG 2003
Possibilities 0))ered b! m!$AP&com
0ther
so)t*are
Field sta))
8/#3
98
8/#3
FI/C0
The Internet2 or :the
rest o) the *orld:
BW
8/#3
$,
AP0
C86
7e"ac!
so)t*are
0nl!
bro*ser
re.uired
Customer
;our coman!
(e* business artner
7ato or
P,A (handheld)
0nl! a )raction o) the
inte"ration ossibilities
is sho*n here&&&
0ther
so)t*are
Business artner
T6
6arketlace
8/#
8/#
mySA.-om ,rovi'es t.e o,tion o* ma,,in7 internal business ,ro-esses +it. em,loyees an'
e:ternal business ,ro-esses *or ,artners0 -ustomers or su,,liers usin7 t.e 1nternet.
SA A! "A#$0 2%3
SAP AG 2003
$AP 8/# (/nterrise)
$AP 8/# (/nterrise)
$rowser
$rowser
SAP G#%
SAP G#%
$rowser
$rowser
$AP %5I )or 9T67
Classic users
/$$
/$$ < /mlo!ee $el)4$er'ice
6iddle*are
comonents
&suc' as SAP %(S)
SA R/3 4nter,rise ,rovi'es a +i'e ran7e o* -ore business *un-tions @as 'i' its ,re-ursor0 SA R/3A0
in-lu'in7 =inan-ial A--ountin7 an' >uman Resour-es Mana7ement.
SA R/3 4nter,rise0 +.i-. e:-ellently -om,lements all SA solutions0 -an be use' as an 4R
ba-(en' system.
SA A! "A#$0 2%4
SAP AG 2003
m!$AP C86
C86 $!stem /8P Backend
e&"& Internet sellin"
$rowser
$rowser
SAP G#%
SAP G#%
Call Center
6obile $er'ices
*aptop
*aptop
6iddle*are
comonents
Many -om,anies no+ atta-. 7ro+in7 im,ortan-e to 7eneratin7 an' maintainin7 -ustomer loyalty.
".is is +.y it is ne-essary to mana7e -ustomer in*ormation e**i-iently.
mySA &ustomer Relations.i, Mana7ement @mySA &RMA not only enables you to 'o t.is0 it also
enables you to o,timi<e your -ustomer relations.i,s as a +.ole an' t.rou7.out t.e li*e -y-le D *rom
-ustomer a-Euisition t.rou7. sales ,ro-esses an' or'er *ul*illment to -ustomer servi-e.
SA A! "A#$0 2%5
SAP AG 2003
m!$AP /4Procurement
/8P Backend
SAP G#%
SAP G#%
/mlo!ees
*ithin !our
coman!
/BP $!stem
Catalo"
Internet 6arketlace
&&&
&&&
(ot necessaril!
re.uired
6iddle*are
mySA 4%ro-urement su,,orts business%to%business ,ro-urement o* bot. ,ro'u-tion materials an'
in'ire-t materials @,en-ils0 ,a,er0 et-.A. Fou -an ma(e ,ur-.ases on e%mar(et,la-es0 use ele-troni-
bi' invitations or sear-. *or t.e best o**ers on t.e #orl' #i'e #eb.
SA A! "A#$0 2%6
SAP AG 2003
m!$AP BI
BW $!stem
$/6 $!stem
G#%
G#%
6ana"er
&&&
(ot necessaril!
re.uired
/8P Backend
/8P Backend
".e mySA 8usiness 1ntelli7en-e solution ,rovi'es you +it. a variety o* o,tions *or e:tra-tin70
evaluatin70 storin7 an' 'isseminatin7 t.e 'ata in your systems so you -an ma(e business or strate7i-
'e-isions.
mySA 81 -om,onents)
% SA 8usiness 1n*ormation #are.ouse @SA 8#A
% SA Strate7i- 4nter,rise Mana7ement @SA S4MA
SA A! "A#$0 2%B
SAP AG 2003
m!$AP $C6
0ther
/8P Backend AP0 $!stem
BW $!stem
SAP G#%
SAP G#%
G#%
&E"cel+$ased
for e"ample)
G#%
&E"cel+$ased
for e"ample)
6ana"er
(erson resonsible)
6ana"er
(lanner)
/8P Backend
mySA Su,,ly &.ain Mana7ement @mySA S&MA 7ives you t.e tools you nee' to mana7e your
entire lo7isti-s -.ain0 so you -an -ontrol all intra-om,any an' inter-om,any ,ro-esses0 *rom
ma,,in7 t.e lo7isti-s -.ain to sour-in70 an' *rom reEuirements ,lannin7 to sales.
".e 1nternet%enable' *un-tions in mySA Su,,ly &.ain Mana7ement allo+ you to -ontrol t.e
lo7isti-s -.ain even beyon' your -om,any boun'aries. ".is enables you to -ollaborate +it. your
,artners an' -ustomers0 e:-.an7in7 im,ortant in*ormation an' rea-tin7 s+i*tly as t.e nee' arises.
3ne o* t.e -entral mo'ules o* mySA S&M is t.e A'van-e' lanner G 3,timi<er @A3A. A3
in-lu'es t.e *ollo+in7 -om,onents) Su,,ly &.ain &o-(,it0 Deman' lannin70 Su,,ly 2et+or(
lannin7 an' De,loyment0 ro'u-tion lannin7 an' Detaile' S-.e'ulin7 an' !lobal Available%to%
romise.
8y -ombinin7 A3 +it. t.e 8usiness 1n*ormation #are.ouse0 SA -ustomers -an o,timi<e
,er*orman-e an' -osts alon7 t.e entire lo7isti-s -.ain.
SA A! "A#$0 2%C
SAP AG 2003
m!$AP /nterrise Portal
/8P Backend
$rowser
$rowser
$rowser
$rowser
Browser
Browser
Portal
0ther sources o)
in)ormation or s!stems
(such as the Internet)
0ther
/8P Backend
/mlo!ee
$rowser
$rowser
ossibilities o**ere' by mySA 4nter,rise ortal)
% Sim,le0 uni*orm a--ess to 'i**erent sour-es o* in*ormation @sin7le ,oint o*
entryA
% 4asy a--ess to 'i**erent so*t+are -om,onents *rom various ,rovi'ers @*or e:am,le0
8aan0 eo,leSo*t0 3ra-le0 an' Siebel0 alon7si'e SAA
% 9sers nee' to lo7 onto t.e ,ortal on-e only to a--ess all systems @Sin7le Si7n 3nA
% Role%base' a--ess to *un-tions
% ".e ,ortal -an be ,ersonali<e' by a'Hustin7 it to ,ersonal nee's
% Se-ure a--ess *rom any+.ere
mySA 4nter,rise ortal -an be use' as an em,loyee0 -ustomer an'/or su,,lier ,ortal0 amon7st
ot.ers.
SA A! "A#$0 2%9
SAP AG 2003
m!$AP&com (2)
$!stem 0'er'ie*
$!stem 0'er'ie*
Internet Technolo"ies
Internet Technolo"ies Internet Technolo"ies
Inter)aces
Inter)aces
$AP $er'ice 6arketlace
$AP $er'ice 6arketlace
SA A! "A#$0 2%$0
SAP AG 2003
$AP IT$2 $AP Web A$3 9TTP Communication
$AP Alication
$er'er
re'iousl!
=$AP Basis=)
$AP Web
Alication $er'er
9TTP re.uest
9TTP
9TTP
8FC
,arious
SAP systems
optional
Web ser'er
$AP IT$
8FC/
,IA%
".ere are basi-ally t+o +ays o* a--essin7 an SA -om,onent in 'ialo7 mo'e *rom t.e 1nternet)
% 9sin7 t.e SA 1nternet "ransa-tion Server @SA 1"SA
% 9sin7 t.e 1nternet &ommuni-ation Mana7er @1&MA o* t.e SA #eb A,,li-ation Server @SA #eb
ASA
SA A! "A#$0 2%$$
SAP AG 2003
The $AP Internet Transaction $er'er
A%ate
9T67 a"e
Web
bro*ser
Web
ser'er
W%ate
9TTP C%I> TCP/IP
,IA%
8FC
-9T67
Business
Temlates
-Flo* )iles
Common host
$AP IT$
$er'ice
)iles
C$$
)iles
> ($API and I$API are also suorted
$AP
$!stem
".e SA 1"S ,rovi'es t.e *ollo+in7 o,tions)
% Automati- -onversion o* SA s-reens into >"M6 *ormat
% 9se o* s-reen%base' 1A&s @1nternet A,,li-ation &om,onentsA t.at .ave been 'elivere'
+it. t.e R/3 System *or years @t.e online store0 *or e:am,leA
% 9se o* t.e SA !91 *or >"M60 a $)$ -onversion o* SA s-reens into >"M6
SA A! "A#$0 2%$2
SAP AG 2003
The $AP Web Alication $er'er
$AP Web Alication $er'er
as o) 8el& ?&10
$AP Alication $er'er2
u to (incl&) 8el& @&?,
IC6
6emor!
ies
,isatcher ,isatcher
,B
,B
,isatcher
,B
,B
WP WP WP WP WP WP
".e SA #eb AS is a *urt.er 'evelo,ment o* t.e -lassi- SA 8asis te-.nolo7y. A ne+ ,ro-ess .as
been a''e' to t.e SA (ernel0 t.e 1nternet &ommuni-ation Mana7er @1&MA.
".e 1&M enables you to ,ro-ess 'ire-tly Eueries t.at +ere ,la-e' *rom t.e 1nternet/1ntranet via a
bro+ser.
".e #eb bro+ser an' 1&M -ommuni-ate usin7 8usiness Server a7esI t.ese are >"M6 ,a7es t.at
also -ontain A8A -o'in70 *or e:am,le0 so t.at t.e >"M6 ,a7e -an be *ille' +it. 'ata at runtime.
".e SA !91 *or >"M6 -annot -urrently be use' +it. t.e 1&M @%J SA 1"SA
SA A! "A#$0 2%$3
SAP AG 2003
m!$AP&com (#)
$!stem 0'er'ie*
$!stem 0'er'ie*
Internet Technolo"ies
Internet Technolo"ies
Inter)aces
Inter)aces Inter)aces
$AP $er'ice 6arketlace
$AP $er'ice 6arketlace
SA A! "A#$0 2%$4
SAP AG 2003
Inter)aces Technolo"ies 5sed in $AP $!stems
0en Inter)aces
0en Inter)aces
0en Inter)aces
/
,
I
/
,
I
TCP/IP
TCP/IP
75?&2
75?&2
CPI4C
CPI4C
8FC
8FC
A
7
/
A
7
/
BAPI
BAPI
07/
07/
$6TP
$6TP 9
T
T
P
9
T
T
P
mySA.-om is an open system. 1t su,,orts a variety o* net+or( -ommuni-ation ,roto-ols.
1n*ormation -an be e:-.an7e' bet+een -om,onent systems an' non%SA systems.
SA su,,orts t.e "&/1 @"ransmission &ontrol roto-ol/1nternet roto-olA an' S2A 696.2
@System 2et+or( Ar-.ite-tureI 6o7i-al 9nit 6.2A ,roto-ols. &ommuni-ation in mySA.-om ta(es
,la-e usin7 t.e stan'ar' "&/1 ,roto-ol. 696.2 +as 'evelo,e' by 18M an' is use' to -ommuni-ate
+it. main*rame%base' R/2 Systems.
R/3 a,,li-ation ,ro7rammin7 su,,orts &1%& @&ommon ro7rammin7 1nter*a-e &ommuni-ationA0
R=& @Remote =un-tion &allA an' 364 Automation @3bHe-t 6in(in7 an' 4mbe''in7A as
-ommuni-ation inter*a-es. 3t.er inter*a-es are base' on t.is te-.nolo7y0 su-. as -ommuni-ation via
8A1s @8usiness A,,li-ation ro7rammin7 1nter*a-esA0 4D1 @4le-troni- Data 1nter-.an7eA or an
A64 @A,,li-ation 6in( 4nablin7A 'istribution mo'el.
1t is also ,ossible to sen' an' re-eive mails usin7 SM" @Sim,le Mail "rans*er roto-olA.
SA A! "A#$0 2%$5
SAP AG 2003
Business Process ,istribution 5sin" A7/
Distributed
business processes
Accountin"
Central Controllin"
In)ormation s!stems3
In'entor!
Purchasin"
$ales
Central urchasin"
8e)erence s!stem )or
master data and ta+
data
$ales2 shiin" and
billin"
Purchasin" o)
tradin" "oods
In'entor!
mana"ement
7ocal Controllin"
Plant maintenance
In'entor!
mana"ement
Internal sales2
shiin" and billin"
7ocal urchasin"
PP
A64 is t.e business%-ontrolle' messa7e e:-.an7e
% ".rou7. syn-.ronous an' asyn-.ronous -ommuni-ation
% 9sin7 8A1 inter*a-es an' 1Do- 'ata -ontainers
% 9sin7 -onsistent 'ata @t.e a,,li-ations 'o not use a -entral 'atabase0 but
are *ille' in'e,en'ently by re7ional 'atabases +it. t.eir o+n 'atabaseA
% A-ross loosely lin(e' SA a,,li-ations.
SA A! "A#$0 2%$6
SAP AG 2003
8FC Connection 0tions
./C interface
ABAP pro0ram
$AP s!stem
$AP s!stem
./C interface
/+ternal s!stem
./C interface
ABAP pro0ram E"ternal pro0ram
&SAP .12 also possi$le)
Remote Function Call @R=&A is a -ommuni-ations inter*a-e t.at is base' on &1%&0 but +.i-. .as
more *un-tions an' is easer *or a,,li-ation ,ro7rammers to use. Fou -an use R/3 an' R/2 Systems as
+ell as e:ternal a,,li-ations as R=& -ommuni-ation ,artners. See also SA 2otes $3903 an'
$$605$.
R=& is t.e ,roto-ol *or -allin7 s,e-ial subroutines over t.e net+or(. ".ese subroutines are labele'
*un-tion mo'ules. =un-tion mo'ules are -om,arable +it. & *un-tions or AS&A6 ,ro-e'ures. ".ey
.ave a 'e*ine' inter*a-e via +.i-. 'ata0 tables an' return -o'es -an be e:-.an7e'. =un-tion mo'ules
are mana7e' in t.e R/3 System in t.eir o+n *un-tion library0 -alle' t.e =un-tion 8uil'er.
SA A! "A#$0 2%$B
SAP AG 2003
8emote Function Call in ,etail
Callin" s!stem
...
CALL FUNCTION XY
DESTINATION DEST
EXPORTING...
IMPORTING...
...
$!stem called
FUNCTION XY.
.
.
.
ENDFUNCTION.
RFC DESTINATION
R/2
R/3
DEST
...
./C interface
./C interface ./C interface
=un-tion mo'ules remote -alls a-ross system bor'ers are only 'i**erent to lo-al remote -alls in t.at a
s,e-ial ,arameter @DestinationA s,e-i*ies t.e 'estination .ost on +.i-. t.e ,ro7ram is to be e:e-ute'.
".ere are t.ree ty,es o* R=& -all)
% Synchronous RFC call) t.e -allin7 ,ro7ram sto,s until t.e *un-tion mo'ule .as been
,ro-esse' in t.e 'estination system an' any results .ave been returne' to t.e -aller. 3nly
t.en 'oes t.e -allin7 ,ro7ram -ontinue ,ro-essin7.
% Asynchronous RFC call) t.e -allin7 ,ro7ram runs ,arallel to an' in'e,en'ently
o* *un-tion mo'ule ,ro-essin7 in t.e 'estination system. ro7rammers are
res,onsible *or .an'lin7 result ,ro-essin7. 1n a''ition0 t.e 'estination system must also be
available at t.e time o* t.e R=& -all.
% Transactional RFC call) several *un-tion mo'ules -an be 7rou,e' into one
transa-tion. ".ey are ,ro-esse' in t.e 'estination system +it.in an 69# on-e only0
an' in t.e seEuen-e in +.i-. t.ey +ere -alle'. 1n t.e -ase o* an error0 t.e -allin7 system re-eives
a -on*irmation t.at you -an a--ess usin7 "ransa-tion SM5C. 1n t.e -ase o* transa-tional R=&0 t.e
'estination system 'oes not .ave to be available at t.e time o* t.e R=& -all. 1n a''ition0 you -an
-on*i7ure t.e *reEuen-y an' intervals o* in'ivi'ual Eueries.
SA A! "A#$0 2%$C
SAP AG 2003
m!$AP&com (@)
$!stem 0'er'ie*
$!stem 0'er'ie*
Internet Technolo"ies
Internet Technolo"ies
Inter)aces
Inter)aces
$AP $er'ice 6arketlace
$AP $er'ice 6arketlace $AP $er'ice 6arketlace
SA A! "A#$0 2%$9
SAP AG 2003
ser'ice&sa&com - the $AP $er'ice 6arketlace
$er'ice
re.uirements
Current
0utut /
messa"esA
(otes
database
Problem
messa"es
?
?
?
?
$AP $o)t*are
Chan"e
8e"istration
Corrections
Trainin"
course
in)ormation
".e SA Servi-e Mar(et,la-e un'er .tt,)//servi-e.sa,.-om is aime' at SA -ustomers an' ,artners
@unli(e .tt,)//+++.sa,.-om0 +.i-. ,rovi'es in*ormation on all SA solutions an' on SA as a
-om,any *or everyoneA.
At t.e SA Servi-e Mar(et,la-e you -an a--ess various servi-es0 s,e-ial in*ormation an' a''itional
o**ers.
Fou must be re7istere' as a user to use t.e SA Servi-e Mar(et,la-e. ".ere is normally a -onta-t
,erson in ea-. -om,any +.o -reates users *or em,loyees as reEuire' an' sets aut.ori<ations.
A--ess to t.e SA Servi-e Mar(et,la-e is *ree o* -.ar7e @a,art *rom t.e ne-essary 1nternet a--essA.
SA A! "A#$0 2%20
SAP AG 2003
m!$AP&com3 5nit $ummar!
;ou are no* able to
(ame some o) the ad'anta"es that !our coman!
"ains b! usin" m!$AP&com e4business solutions&
,escribe *here $AP IT$ and $AP Web A$ can be
used and ho* the! *ork
(ame 'arious inter)ace technolo"ies used b! $AP
s!stems
5se the $AP $er'ice 6arketlace
SA A! "A#$0 2%2$
SAP AG 2003
7o"on and $creen ,esi"n
5ser %uide
%ettin" 9el
5ser $ettin"s
Contents3
(a'i"ation
SA A! "A#$0 3%$
SAP AG 2003
(a'i"ation (1)
7o"on and $creen ,esi"n
7o"on and $creen ,esi"n 7o"on and $creen ,esi"n
5ser %uide
5ser %uide
%ettin" 9el
%ettin" 9el
5ser $ettin"s
5ser $ettin"s
SA A! "A#$0 3%2
SAP AG 2003
The $AP 7o"on Pro"ram
SAP *o0on 230
*an0ua0e
4E, 5SPACE6
Sys!7o! Messa0eser8er
00 twdf0290
S%4
4E, SPACE
Group1Ser8er
*o0on
Properties
Groups!!!
Ser8er!!!
7ew!!!
4elete
".e SA !91 ,ro7ram -onne-ts t.e *ront%en' -om,uter +it. a s,e-i*i- SA System. ".eoreti-ally
you -an s,e-i*y t.e SA system reEuire' at -omman'%line level +.en -allin7 t.e SA !91 ,ro7ram.
1n ,ra-ti-e0 you never nee' to 'o t.is. SA ,rovi'es anot.er ,ro7ram *or startin7 t.e SA !91) SA
6o7on.
#.en you -all u, t.e SA 6o7on0 it 'is,lays a list o* SA systems +.ose lo7on ,ro-ess -an be
starte'. ".is list is 'erive' *rom a *ile on t.e *ront%en' -om,uter) sa,lo7on.ini. ".is *ile is normally
,re-on*i7ure' -entrally an' ma'e available to en' users.
SA A! "A#$0 3%3
SAP AG 2003
The 7o"on $creen )or an $AP $!stem
#sers System :elp
SAP R/3
7ew password
4E, &3) &300) (;4/0290 ,.
client
#ser
Password
*an0ua0e
Please call your user administrator on
(el! 3<92 if you 'a8e pro$lems lo00in0 on
300
4E
=
SA systems are client systems. Fou -an use t.e -lient -on-e,t to -ontrol several se,arate
enter,rises in one system at t.e same time. ".e 8# an' K# -om,onents are e:-e,tions sin-e ea-.
uses one -lient only. 4a-. user session only a--esses 'ata on t.e -lient t.at you sele-te' +.en you
lo77e' on.
A client is a sel*%-ontaine' or7ani<ational unit in t.e system. 4a-. -lient .as its o+n 'ata
environment an'0 t.ere*ore0 its o+n user master an' transa-tion 'ata0 assi7ne' user master re-or's
an' -.art o* a--ounts an' s,e-i*i- &ustomi<in7 ,arameters.
So t.at you -an lo7 onto t.e system0 you must .ave a user master re-or' -reate' *or you *or t.e
-orres,on'in7 -lient. =or reasons o* a--ess ,rote-tion0 you must enter a ,ass+or' +.en you lo7 onto
t.e system. ".e system 'oes not 'is,lay t.e ,ass+or' t.at you enter @stars are 'is,laye' in ,la-e o*
t.e ,ass+or'A.
SA systems are multilin7ual. Fou -an use t.e Language *iel' to sele-t t.e lo7on lan7ua7e *or t.e
-urrent session.
Multi,le lo7ons are re-or'e' as o* Release 4.6. ".is is *or reasons o* bot. se-urity an' li-ensin7. 1*
t.e same user lo7s on more t.an on-e0 t.en t.e system 'is,lays a +arnin7 messa7e *or ea-.
subseEuent lo7on.
Fou -an a'' your o+n te:ts to t.e lo7on s-reen in 'i**erent +ays. =or more in*ormation0 see SA
2ote 2054CB.
SA A! "A#$0 3%4
SAP AG 2003
$AP /as! Access
ffice
%nformation Systems
tools
SAP menu
/a8orites
t'er menu
SAP Easy Access
Create role Assi0n users 4ocumentation
Menu Edit /a8orites E"tras System :elp
4E, &3) &300) (;4/0290 ,.
".e SA !asy Access s-reen is t.e stan'ar' +ay to a--ess t.e system. Fou navi7ate +it.in t.e
system usin7 a -learly arran7e' tree stru-ture.
Fou -an atta-. an ima7e su-. as your -om,any lo7o to t.e ri7.t si'e o* t.e s-reen. ".is ima7e -an
be assi7ne' t.rou7.out t.e system an' is vali' *or all -lients. !iven t.at you .ave aut.ori<ation to 'o
so0 you -an *in' a 'etaile' 'es-ri,tion o* t.e settin7s t.at are reEuire' to 'o t.is by -.oosin7 Extras
%%J Administration information. lease note t.at t.e 7ra,.i- is store' in t.e system an' trans,orte' to
t.e *ront%en' every time SA 4asy A--ess is -alle'. Alt.ou7. it is trans,orte' in -om,resse' *orm0
t.e 7ra,.i- s.oul' not e:-ee' 20 K8. Fou -an also ,revent t.e 7ra,.i- *rom bein7 -alle' by
-.oosin7 t.e settin7 6o+ S,ee' &onne-tion in t.e SA 6o7on ,ro7ram @see SA 2ote $6$053A0 or
by -.oosin7 Extras --> Settings in t.e SA 4asy A--ess s-reen. See also L9ser Settin7sL.
SA A! "A#$0 3%5
SAP AG 2003
$creen /lements
4E, &3) &300) (;4/0290 ,.
#sers Edit Goto System :elp
Maintaining your user profile
#ser
*ast c'an0ed $y
ESC:
ESC: 0>!09!2003 3> ? @2 ? 39 Status Sa8ed
Address 4efaults Parameter
s
StartMenu
*o0on lan0ua0e
utput Controller
utput4e8ice
utput immediately
4elete after output
4ecimal notation
4ate format
3!23@!>29AB<
3A23@A>29!B<
3 23@ >29AB<
44!MM!CCCC
MM1441CCCC
MM+44+CCCC
CCCC!MM!44
CCCC1MM144
CCCC+MM+44
Personal time Done
CE(
CA((
(est status
%nput fields
C'eck$o"es
.adio $uttons
(itle $ar
Standard tool$ar
Menu $ar
Application tool$ar Command
field
(a$ pa0e
Status $ar
Comman" #iel"$ you -an start a,,li-ations 'ire-tly by enterin7 t.eir transa-tion -o'e in t.e
-omman' *iel' @t.is is .i''en by 'e*aultA. Fou -an *in' t.e transa-tion -o'e *or an a,,li-ation eit.er
in t.e SA 4asy A--ess menu tree @see L9ser Settin7sLA or in t.e a,,li-ation itsel* un'er System ->
Status.
%enu &ar$ t.e menus s.o+n .ere 'e,en' on +.i-. a,,li-ation you are in. ".ese menus may also
-ontain -as-a'in7 menus.
Stan"ar" tool&ar$ t.e i-ons in t.e stan'ar' toolbar are s.o+n on every R/3 s-reen. 1* t.ey are not
available in an a,,li-ation0 t.e ,us.buttons t.at you -annot use on t.at s-reen are 'ea-tivate'. 1* you
,osition t.e -ursor over an i-on *or a s.ort time0 t.e system 'is,lays Eui-( in*o te:t +it. t.e name or
*un-tion o* t.e i-on. 1* a,,ro,riate0 you also see t.e -orres,on'in7 *un-tion (ey settin7. ".e
application tool&ar s.o+s t.e i-ons available in t.e a,,li-ation you are -urrently in.
Title &ar$ t.e title bar names t.e *un-tion t.at is available in t.e a,,li-ation you are -urrently in.
Chec'&o(es$ -.e-(bo:es enable you to sele-t several o,tions *rom a 7rou, o* *iel's at t.e same
time.
Ra"io &uttons$ ra'io buttons enable you to -.oose e:a-tly one item *rom a sele-tion.
Ta&$ arran7es several in*ormation s-reens to im,rove -larity.
Status &ar$ t.e status bar 'is,lays in*ormation su-. as +arnin7s an' errors about t.e -urrent system
status.
SA A! "A#$0 3%6
SAP AG 2003
(a'i"ation (2)
7o"on and $creen ,esi"n
7o"on and $creen ,esi"n
5ser %uide
5ser %uide 5ser %uide
%ettin" 9el
%ettin" 9el
5ser $ettin"s
5ser $ettin"s
SA A! "A#$0 3%B
SAP AG 2003
Fa'orites 7ist and 5ser 6enu
t'er menu Create role Assi0n users 4ocumentation
Menu Edit /a8orites E"tras System :elp
4E, &3) &300) (;4/0290 ,.
#.* + SAP Ser8ice Marketplace
/a8orites
SAP Easy Access
SM>0 + Process 8er8iew
SM0@ + #ser *ist
.ole SAPEBCEBAS%SEA4M%7
System? .unnin0 peration
System Confi0uration
Performance Analysis
Pro$lem Analysis
8er8iew
.F20 + CCMS Monitorin0
4etails
.ole+$ased menu
/a8orites list
Role$ a role 'es-ribes a number o* a-tivities in t.e system t.at it ma(es sense to 'e*ine. ".ese
re,resent t.e s-o,e o* *un-tions t.at users ty,i-ally reEuire at t.eir +or( station.
Roles @*ormerly La-tivity 7rou,sLA must be set u, usin7 t.e ro*ile !enerator so t.at SA system
users -an +or( +it. user)speci#ic or *or' station)relate" menus.
Roles are also use' to assi7n users +it. aut.ori<ation *or t.e a-tivities 'e*ine' in menus. re'e*ine'
user roles *rom all a,,li-ation areas are in-lu'e' in t.e stan'ar' system as o* Release 4.6.
#.en users are assi7ne' roles0 t.ey -an -.oose bet+een t.e stan'ar' SA menu an' t.eir user
menus.
1n a''ition to t.eir roles0 en' users -an also use =avorites to ,ersonali<e t.eir a--ess to t.e system.
Fou -an -reate your o+n Fa+orites list o* t.e transa-tions0 re,orts0 *iles an' #eb a''resses t.at you
*reEuently use.
Fou -an -reate e'its usin7 t.e Favorites menu or sim,ly usin7 t.e mouse to L'ra7 G 'ro,L 9R6s or
lin(s to *iles to your ,ersonal *avorites list.
SA A! "A#$0 3%C
SAP AG 2003
(a'i"ation 0tions
Menu Edit /a8orites E"tras
SAP Easy Access
t'er menu
Fa'orites
587 4 $AP $er'ice 6arketlace
$6B0 4 Process 0'er'ie*
$60@ 4 5ser 7ist
8ole $APCBCCBA$I$CA,6I(
$!stem3 8unnin" 0eration
$!stem Con)i"uration
Per)ormance Anal!sis
Problem Anal!sis
0'er'ie*
8D20 4 CC6$ 6onitorin"
,etails
Create session
End session
#ser profile
Ser8ices
#tilities
*ist
Ser8ices for o$ject
$ject 'istory
wn spool reGuests
wn jo$s
S'ort messa0e
Status!!!
*o0 off
System
Command field
SAP Easy Access and /a8orites list
Menu
Fou -an -all t.e *ollo+in7 ty,es o* system *un-tions)
9sin7 t.e mouse by sele-tin7 a
menu entry
= avorites
an SA 4asy A--ess entry
usin7 t.e (eyboar' @A6" M t.e un'erline' letter o* t.e menu o,tion reEuire'A
by enterin7 a transaction co"e in the comman" #iel")
1n SA systems0 ea-. *un-tion @not ea-. s-reenNA is assi7ne' a transa-tion -o'e. Fou -an -all
t.e allo-ate' transa-tion -o'e *rom any system s-reen. =or e:am,le0 you -an 'is,lay t.e
-ustomer master 'ata0 enter L/nL an' t.en enter t.e -orres,on'in7 transa-tion -o'e) L/n*'03L.
Fou -an 'etermine t.e transa-tion -o'e by -.oosin7 Status in t.e System menu. A''itional
in,ut o,tions)
% L/nL en's t.e -urrent transa-tion.
% L/iL 'eletes t.e -urrent session
% L/osm04L o,ens a ne+ session an' bran-.es to t.e s,e-i*ie' transa-tion @SM04A.
SA A! "A#$0 3%9
SAP AG 2003
The $!stem and 9el 6enus
ffice
%nformation Systems
tools
SAP menu
/a8orites
t'er menu
SAP Easy Access
Create role Assi0n users 4ocumentation
4E, &3) &300) (;4/0290 ,.
:elp
Application 'elp
SAP *i$rary
Glossary
.elease 7otes
SAP Ser8ice Marketplace
/eed$ack
Settin0s!!!
Menu Edit /a8orites E"tras System
Create session
End session
#ser profile
Ser8ices
#tilities
*ist
Ser8ices for o$ject
$ject 'istory
wn spool reGuests
wn jo$s
S'ort messa0e
Status!!!
*o0 off
Fou -an *in' t.e *ollo+in7 o,tions amon7st ot.ers in t.e System menu o,tion)
&reate/en' session) -reates an' en's a session. System a'ministrators -an use ,arameter
r'is,/ma:OaltOmo'es to set t.e ma:imum number o* sessions to a number bet+een 2 an' 6.
9ser ,ro*ile) -ontains user%s,e-i*i- settin7s. &.oose Own data to use ,arameters 1Ds t.at *ill
s,e-i*i- *iel's in t.e system @su-. as t.e -om,any -o'e *iel'A +it. 'e*ault values.
6ist) im,ortant list *un-tions0 su-. as sear-.in7 by -.ara-ter strin70 savin7 to & *iles0 ,rintin7 an'
so on.
Status) 'is,lays t.e most im,ortant user an' system 'ata
6o7o**) en's t.e SA R/3 session @+it. a reEuest *or -on*irmationA
".e menu o,tion Help -ontains t.e *ollo+in7 o,tions0 amon7st ot.ers)
% A -onte:t%sensitive Application Help
% SAP Lirary -all @see ne:t ,a7eA
% A !lossary
SA A! "A#$0 3%$0
SAP AG 2003
(a'i"ation (#)
7o"on and $creen ,esi"n
7o"on and $creen ,esi"n
5ser %uide
5ser %uide
%ettin" 9el
%ettin" 9el %ettin" 9el
5ser $ettin"s
5ser $ettin"s
SA A! "A#$0 3%$$
SAP AG 2003
F1 9el
Print arameter 2
%ndicates w'et'er spool reGuests are printed immediately!
Select t'is field to print your spool reGuests immediately!
lassen!
*ea8e t'e field $lank to retain spool reGuests in t'e spool
system until t'ey are released! (o release t'ese spool
reGuests for printin0A you can use System+H Services +H Output controller!
Performance Assistant
utput Controller
utput4e8ice
utput immediately
4elete after output
Personal time Done
CE(
CA((
(est status
F1 hel
Technical in)ormation
Fou -an -.oose t.e F, (ey to 'is,lay an e:,lanation o* *iel's0 menus0 *un-tions an' messa7es.
".e =$ .el, also 'is,lays te-.ni-al in*ormation on t.e relevant *iel'. ".is in*ormation in-lu'es0 *or
e:am,le0 t.e ,arameter 1D t.at you nee' to set user%s,e-i*i- 'e*ault values *or in,ut *iel's t.at are
also lin(e' to t.e ,arameter 1D.
SA A! "A#$0 3%$2
SAP AG 2003
F@ 9el
Afrikaans
Ara$ic
Bul0arian
CDec'
4anis'
German
Greek
En0lis'
Spanis'
Estonian
/innis'
/renc'
:e$rew
Croatian
:un0arian
%ndonesian
*an0ua0e &2) 3B Entries found
.estrictions
7an"u&&& 7an"ua"e
A/
A.
BG
CS
4A
4E
E*
E7
ES
E(
/%
/.
:E
:.
:#
%4
Address 4efaults
StartMenu
*o0on lan0ua0e
utput Controller
utput4e8ice
F@ hel
Fou -an use F4 to 'is,lay ,ossible in,ut values. Fou -an also -all u, t.e =4 .el, *or a *iel' usin7
t.e button imme'iately to t.e ri7.t o* t.e sele-te' *iel'.
SA A! "A#$0 3%$3
SAP AG 2003
The $AP 7ibrar!
$AP 7ibrar!
SAP ;e$ Application Ser8erA .elease 2!30A Iune 2003
J Copyri0't 2003 SAP AG! All ri0'ts reser8ed!
SAP *i$rary
Gettin0 Started
SAP ;e$ Application Ser8er
SAP Knowled0e Mana0ement
:elp on :elp
:elp on t'e ;e$
Copyri0't
pen All Close All
Pre8ious 7e"t Sync'roniDe
Area :ide (ree
SAP *i$rary Gettin0 Started .elease
7otes
%MG Glossary Searc' :elp on :elp
*ocal intranet
SA Systems ,rovi'e e:tensive online .el,. Fou -an -all t.is .el, *rom every s-reen in t.e system"
Fou -an -all u, .el, by -.oosin7 t.e Help menu# or by -.oosin7 t.e a,,ro,riate i-on @yello+
Euestion mar(A.
Fou -an also a--ess t.e SA 6ibrary easily an' Eui-(ly *rom t.e SA Servi-e Mar(et,la-e. Fou -an
*in' t.e SAP Help Portal un'er $nowledge and %raining. Fou -an 'is,lay t.e .el, in >"M6 *ormat
an' also ,er*orm a very e**i-ient *ull te:t sear-. in t.e library. 1* t.e SA 6ibrary .as been installe'0
you -an also -all t.is o,tion +it.in your -om,any.
Fou -an also a--ess t.e >el, ortal 'ire-tly at .tt,)//.el,.sa,.-om.
SA A! "A#$0 3%$4
SAP AG 2003
(a'i"ation (@)
7o"on and $creen ,esi"n
7o"on and $creen ,esi"n
5ser %uide
5ser %uide
%ettin" 9el
%ettin" 9el
5ser $ettin"s
5ser $ettin"s 5ser $ettin"s
SA A! "A#$0 3%$5
SAP AG 2003
T*o o) the 6an! PersonaliEation 0tions
4E, &3) &300) (;4/0290 ,.
Set start transaction
Settin0s
(ec'nical details
4isplay documentation S'iftL/2
CtrlLS'iftL/30
S'iftL/<
S'iftL/9
E"tras System :elp
Settin0s
('is is used to specify settin0s
4isplay fa8orites at end of list
4o not display menuA only display fa8orites
4o not display picture
4isplay tec'nical names
ffice
%nformation Systems
tools
SAP menu
/a8orites
t'er menu
SAP Easy Access
Menu Edit /a8orites
Create role Assi0n users 4ocumentation
ptions !!!
7ew ,isual 4esi0n !!!
Clip$oard
Generate 0rap'ic
Create s'ortcut !!!
Acti8ate GuiM(
4efault siDe
:ardcopy
Nuick Cut and Paste
Spellin0 C'eck
Sap0ui :elp
A$out !!!
A ran"e o) settin"s simli)ies
*orkin" *ith the s!stem
&.oose Extras ->Settings to -.an7e t.e a,,earan-e o* t.e initial s-reen0 *or e:am,le0 by turnin7 o**
t.e 7ra,.i-s 'is,lay on t.e ri7.t si'e o* t.e s-reen0 or by 'is,layin7 te-.ni-al names @transa-tion
-o'esA on t.e SA 4asy A--ess s-reen.
#.en you -.oose Options# you .ave t.e o,tion o* a-tivatin7 Qui-( &ut an' aste. 9n'er Options"""
you .ave t.e o,tion o* settin7 t.e rea-tion s,ee' o* t.e Eui-( in*o te:t t.at is 'is,laye' +.en you
,osition t.e -ursor over an i-on or ,us.button.
Fou -an set ,ersonal stan'ar' values by -.oosin7 System -> &ser Profile -> Own 'ata. Fou -an 'o
t.is on t.e tab ,a7es Address0 'efaults0 an' Parameters.
SA A! "A#$0 3%$6
SAP AG 2003
(a'i"ation3 5nit $ummar!
;ou are no* able to
7o" on to the s!stem success)ull!
(ame and use elements o) a $AP %5I screen
5se F1 and F@ hel
,isla! the in)ormation in the online documentation
5se the 'arious otions )or ersonaliEin" the $AP
s!stem
SA A! "A#$0 3%$B
-a+i.ation ) !(ercises
/nit$ -a+i.ation
Topic$ 0asic Functions
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
6o7 on to an SA system
1'enti*y transa-tion -o'es
A--ess SA 6ibrary in*ormation
9se t.e =$ .el, to *in' *iel' in*ormation
9se t.e =4 .el, to sear-. *or ,ossible *iel' values
As a ne+ SA system user0 start to navi7ate in t.e system usin7 menu
,at.s an' transa-tion -o'es0 an' use t.e various ty,es o* online .el,.
All menu paths in the e(ercises re#er to the SA stan"ar" menu.
$%$ 6o77in7 on t.e system
Sele-t t.e -orres,on'in7 system *or t.is trainin7 -ourse. 4nter t.e -lient0 user name0
initial ,ass+or'0 an' t.e lo7on lan7ua7e s,e-i*ie' by t.e instru-tor. #.en lo77in7
on *or t.e *irst time0 a +in'o+ a,,ears in +.i-. you must enter a ne+ ,ass+or'
t+i-e. 2ote t.e
&lient) O O O 9ser) O O O O O O O O ass+or') OOOOOOOOOO 6an7ua7e) O O.
$%2 #.at is t.e ma:imum number o* ,arallel sessions @+in'o+s o* t.e SA systemA
-an you o,en by -.oosin7 System &reate sessionP
2umber) OO
$%3 #.at are t.e *un-tions -alle' t.at you a--ess usin7 t.e *ollo+in7 SA stan'ar'
menu ,at.s an' +.at are t.e -orres,on'in7 transa-tion -o'esP
$%3%$ Tools Administration Monitor System Monitoring User
Overview
=un-tion name) OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
"ransa-tion) OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
SA A! "A#$0 3%$C
$%3%2 Accounting Financial Accounting Accounts Receivable Master
records Display
Sele-t &ustomer $000 in &om,any -o'e $000 to a--ess
t.e *ollo+in7 s-reen.
=un-tion name) OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
"ransa-tion) OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
$%4 >el,
$%4%$ 3n t.e SAP Easy Access initial s-reen0 i* you -.oose Application Help
@L>el,L menuA0 you bran-. to +.i-. area o* t.e SAP LiraryP
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
"o ans+er t.e Euestion belo+0 you must -all t.e
transa-tion *or 'is,layin7 t.e -ustomer master re-or'.
$%4%2 9se t.e F, help *or t.e (ustomer *iel' to ans+er t.e *ollo+in7 Euestion.
#.at 'o you use t.e (ustomer *iel' *orP
Summari<e t.e business%relevant in*ormation .ere.
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
$%4%3 9se t.e =$ .el, *or t.e (ompany code *iel'. "o +.i-. business area o* t.e
SA 6ibrary 'oes t.e system bran-. +.en you -.oose t.e A,,li-ation >el,
i-on at t.e to, e'7e o* t.e =$ .el, +in'o+P
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
$%4%4 #.i-. i-on at t.e u,,er e'7e o* t.e =$ .el, +in'o+ -an you use to *in' t.e
,arameter 1D *or t.e &om,any -o'e *iel'P
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
SA A! "A#$0 3%$9
$%4%5 9se t.e =4 .el, *or t.e &ustomer *iel' to *in' t.e number o* -ustomer
L8e-(er QQL. "o 'o t.is0 -all t.e =4 .el, an' use t.e sear-. term L8e-(erRL.
>int) QQ is your 7rou, number.
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
SA A! "A#$0 3%20
/nit$ -a+i.ation
Topic$ /ser)Speci#ic Settin.s
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
=ill a *iel' +it. 'e*ault ,arameters
Ma(e various user%s,e-i*i- settin7s
Maintain your *avorites list
De*ine a user%s,e-i*i- start transa-tion
Start to 'e*ine various user%s,e-i*i- settin7s.
3,tional e:er-ises are mar(e' +it. an asteris( @RA.
2%$ De*ine user ,arameters.
2%$%$ Assi7n a 'e*ault value to t.e &om,any -o'e *iel' *or your user.
>int) Four instru-tor +ill s,e-i*y t.e &om,any -o'e value @su-. as L$000LA.
Fou -an *in' a .int on 'e*ault values in t.e notes on t.e L9ser Settin7sL
,a7e.
arameter) OOO OOO OOO
arameter value) OOO OOO OOO OOO
2%2 De*ine user%s,e-i*i- settin7s by -.oosin7 System %%J 9ser ro*ile %%J 3+n Data.
2%2%$ Set your 6o7on 6an7ua7e to t.e lan7ua7e t.at you are usin7 in t.e trainin7
-ourse.
2%2%2 De*ine t.e De-imal 2otation an' t.e Date =ormat you reEuire.
SA A! "A#$0 3%2$
2%3 Maintain *avorites
2%3%$ &reate at least one ne+ *ol'er belo+ t.e *avorites *ol'er.
2%3%2 A'' t+o o* your *avorite transa-tions to t.is *ol'er.
2%3%3 A'' t.e 1nternet a''ress S.tt,)//+++.sa,.-omT belo+ t.e title SSA
>ome,a7eT.
2%4R De*ine a start transa-tion in t.e L4:trasL menu.
2%4%$ Set a transa-tion as t.e start transa-tion. Fou must no+ lo7 o** an' on a7ain
so t.at t.e system -an u,'ate t.e -.an7es.
>int) Fou -an also reset t.e start transa-tion to t.e stan'ar' value sim,ly by
'eletin7 your entry.
SA A! "A#$0 3%22
Solutions
/nit$ -a+i.ation
Topic$ 0asic Functions
$%$ 6o7 on to t.e system in'i-ate' by t.e instru-tor an' -.an7e your ,ass+or'.
$%2 "o -reate an' en' sessions0 -.oose System Create session @or -.oose t.e
-orres,on'in7 i-onA an' System End session.
De,en'in7 on t.e system settin70 u, to si: sessions -an be o,ene' simultaneously
'urin7 one user terminal session.
$%3 Fou -an *in' t.e transa-tion -o'e un'er System Status. ".ese s-reens an'
transa-tion -o'es -orres,on' to t.e menu ,at.s)
$%3%$ SM04 *or &ser List
$%3%2 =D03 *or (ustomer 'isplay) !eneral 'ata
$%4 >el,
$%4%$ ".e !etting Started unit is 'is,laye' +it.
in*ormation about usin7 SA 4asy A--ess.
$%4%2 Su77estion) ".e (ustomer *iel' is use' +it.in an SA
system to i'enti*y a -ustomer uniEuely.
$%4%3 =1 A--ounts Re-eivable an' A--ounts ayable
$%4%4 9sin7 t.e %ec*nical +nfo i-on you -an *in') Parameter +') 89K
$%4%5 &ustomerQQ @QQ is your 7rou, numberA
1* you use t.e F4 .el, *or t.e (ustomer *iel'0 a 'ialo7 bo: a,,ears in +.i-. you
-an enter various sear-. -riteria.
".e 'i**erent tabs on t.e 'ialo7 bo: -ontain 'i**erent sear-. -riteria. 9se t.e
Searc* term sear-. -riteria an' enter t.e *ollo+in7 'ata)
Criterion -ame 1alue
Searc* term ,ec-er.
1* you ,er*orm t.e sear-. usin7 t.e Enter (ey0 a list o* ,ossible .its is 'is,laye'0
*rom +.i-. you -an sele-t t.e -orres,on'in7 value.
SA A! "A#$0 3%23
/nit$ -a+i.ation
Topic$ /ser)Speci#ic Settin.s
2%$ De*ine user ,arameters
2%$%$ "o 'e*ine 'e*ault values *or a *iel'0 you nee' t.e ,arameter 1D o* t.e *iel'
-on-erne'. "o *in' t.is0 you must *irst sele-t a transa-tion t.at -ontains t.is
*iel'. osition t.e -ursor on t.e -orres,on'in7 *iel' @Hust -li-( on it +it. t.e
mouseA.
&.oose F Tec!nical "n#ormation $arameter "D to 'is,lay t.e
in*ormation you reEuire. =or t.e &om,any -o'e *iel'0 t.e ,arameter is
0/2.
2o+ enter t.is ,arameter into your user settin7s @System User $ro#ile
Own DataA in t.e Parameter tab an' assi7n it t.e value t.at +ill be vali' *or
t.e obHe-t in *uture. ".en save your 'ata.
2%2 De*ine user%s,e-i*i- settin7s
2%2%$ "o set t.e lo7on lan7ua7e0 7o to t.e user ,ro*ile @System User $ro#ile
Own Data/ an' t.en -.oose t.e 'efaults tab. 4nter t.e lo7on lan7ua7e you
reEuire in 6o7on 6an7ua7e.
2%2%2 See 2%2%$
2%3 Maintain *avorites
2%3%$ "o ,la-e *avorites in a *ol'er0 you must *irst -reate a *ol'er @*un-tional
areasA) =avorites "nsert #older +it. a name o* your -.oi-e. Fou -an
-reate as many *ol'ers as you li(e. Fou -an move *ol'ers usin7 t.e mouse to
S'ra7 G 'ro,T t.em.
2%3%2 "o -reate *avorites0 sele-t s,e-i*i- a,,li-ations @transa-tionsA in t.e menu
tree o* t.e SA stan'ar' menu t.at you reEuire as *avorites @t.ose
a,,li-ations t.at you use 'ailyA. Fou -an a'' entries to your *avorites list by
sele-tin7 t.e a,,li-ation an' -.oosin7 Favorites Add. Fou -an
subseEuently move *avorites into *ol'ers by -.oosin7 Favorites Move
#avorites" Fou -an also move *avorites usin7 t.e mouse to S'ra7 G 'ro,T
t.em.
2%3%3 Fou -reate 1nternet a''resses by -.oosin7 Favorites Add %eb address
or #ile.
SA A! "A#$0 3%24
2%4 De*ine a start transa-tion
2%4%$ E&tras Set start transaction
4nter a transa-tion an' t.en -.oose Enter. ".e system messa7e in t.e status
bar 'is,lays t.at t.is transa-tion +ill be t.e start transa-tion t.e ne:t time
you lo7 on.
3int$ "o reset t.is a-tion0 you must -.oose t.e menu ,at. a7ain an' 'elete
t.e transa-tion -o'e you entere'. ".e ne:t time you lo7 on to t.e system0
t.e initial SAP Easy Access s-reen +ill be 'is,laye' a7ain.
SA A! "A#$0 3%25
SAP AG 2003
,ata $tructure
$!stem Fernel
Contents3
Technical $tructure o) an $AP $!stem
SA A! "A#$0 4%$
SAP AG 2003
Technical $tructure o) an $AP $!stem (1)
,ata $tructure
,ata $tructure ,ata $tructure
$!stem Fernel
$!stem Fernel
SA A! "A#$0 4%2
SAP AG 2003
m!$AP&com $!stem ,ata $tructure
Client 100
Cross4Client CustomiEin"
,e'eloment Classes
66
FI
C0 98 PP Basis $,
&&&
8eositor! 0b1ects
&/or e"ample? (a$le 4efinitionsA Pro0ramsA (ransactionsA /unction
Modules)
Alication
,ata
&rdersA
%n8oicesA!!!)
Client4$eci)ic
CustomiEin"
&Company CodesA PlantsA
StoresA !!!)
Customer
,e'eloments
&&&
5
s
e
r
&
A
u
t
'
o
r
i
D
a
t
i
o
n
s
A

M
a
s
t
e
r
.
e
c
o
r
d
!
!
!
)
Client4$eci)ic
CustomiEin"
&Company CodesA PlantsA
StoresA !!!)
5
s
e
r
&
A
u
t
'
o
r
i
D
a
t
i
o
n
s
A

M
a
s
t
e
r
.
e
c
o
r
d
s
!
!
!
)
Alication
,ata
&rdersA
%n8oicesA!!!)
Client 200
mySA.-om Systems -ontain 'i**erent ty,es o* 'ata.
Some 'ata -an only be a--esse' *rom one -lient0 su-. as business a,,li-ation 'ata @'o-uments0
material masters0 an' so onA0 an' most &ustomi<in7 settin7s. &ustomi<in7 is use' to 'e*ine a
-ustomerUs or7ani<ational stru-tures0 su-. as 'istribution -.annels0 -om,any -o'es0 an' so on0 an' to
set -ustomer%s,e-i*i- ,arameters *or SA transa-tions.
".e -lient%s,e-i*i- 'ata is -losely relate'. At in,ut0 a,,li-ation 'ata is -.e-(e' a7ainst t.e
&ustomi<in7 settin7s in t.e -lient. 1* in-onsisten-ies are *oun'0 t.e in,ut is reHe-te'. ".is is +.y
a,,li-ation 'ata usually ma(es sense only in its o+n &ustomi<in7 environment.
1n a''ition to t.e -lient%s,e-i*i- &ustomi<in7 settin7s0 t.ere are ot.er settin7s t.at are set on-e an'
are a-tive *or all -lients. ".ese -ross%-lient &ustomi<in7 settin7s in-lu'e ,rinter settin7s0 *or
e:am,le.
".e Re,ository is also -lient%in'e,en'ent. 1t -ontains all A8A Di-tionary obHe-ts @tables0 'ata
elements0 an' 'omainsA as +ell as all A8A ,ro7rams0 menus0 s-reens0 an' so on.
8e-ause t.ey are -ross%-lient0 Re,ository obHe-ts 'evelo,e' in one -lient are t.e same in all ot.er
-lients in t.e same system.
SA A! "A#$0 4%3
SAP AG 3<<<
CustomiEin"
A$AP 8oadma
CustomiEin"
& & &
&
CustomiEin"
CoCd& Coman! name
View View !"ange !"ange !o#pany !o#pany !ode !ode
7ew entries
CustomiEin"
1n a''ition to t.e various 'ata ty,es in t.e SA R/3 System0 t.ere are also 'i**erent ty,es o* -.an7es
an' a'a,tations in t.e SA R/3 System0 an' in ot.er mySA.-om -om,onent systems.
As t.e SA R/3 System is stan'ar' so*t+are0 it must be a'a,te' to t.e in'ivi'ual nee's o* ea-.
-om,any t.at uses it. ".is tailorin7 ,ro-ess is -alle' &ustomi<in70 +.i-. in-lu'es t.e -lient%s,e-i*i-
an' -ross%-lient 'ata s.o+n in t.e sli'e. A small amount o* &ustomi<in7 may also be reEuire' a*ter
an SA R/3 System u,7ra'e.
&ustomi<in7 is not 'evelo,e' an' teste' in t.e same -lient in +.i-. it +ill be in ,ro'u-tion. ".is
means t.at several -lients are reEuire' 'urin7 an SA R/3 im,lementation. &ustomi<in7 is e:e-ute'
an' teste' in one -lient. 1n a lar7e installation0 it may ma(e sense to -ombine an' test &ustomi<in7
sub,roHe-ts in anot.er -lient. ro'u-tion o--urs in its o+n -lient.
SA A! "A#$0 4%4
SAP AG 3<<<
Chan"es to 8eositor! 0b1ects
Customer ,e'eloment /+tension 6odi)ications
& & &
P8,
GA$
$AP (amesace Customer (amesace
8eositor!
,/H
1n -ontrast to &ustomi<in70 t.e Re,ository 'oes not ne-essarily nee' to be -.an7e' or en.an-e' *or a
mySA.-om System im,lementation)
&ustomers -an a'' t.eir o+n 'evelo,ments to t.e Re,ository.
1n a''ition0 -ustomers -an a'' +.at are -alle' -ustomer en.an-ements0 +.i-. are -ustomer
obHe-ts a''e' to e:istin7 obHe-ts in t.e SA stan'ar' system. &ustomers a'' t.eir en.an-ements
usin7 &ustomer 4:its.
Mo'i*i-ations -.an7e SA obHe-ts0 su-. as re,orts an' table 'e*initions. ".e Re,ository
'elivere' *rom SA is not only en.an-e'0 but -.an7e' as +ell. ".is is +.y t.e mo'i*i-ations
may nee' to be a'Huste' to a ne+ Re,ository installe' 'urin7 t.e ne:t SA R/3 u,7ra'e. ".is
a'Hustment may ta(e some time.
As Re,ository obHe-ts are -ross%-lient0 it is not ,ossible to use a 'evelo,ment system as a ,ro'u-tion
environment. ".e 'an7er o* -reatin7 'ata in-onsisten-ies +oul' be too 7reat.
".ere*ore0 i* -.an7es are to be ma'e to t.e Re,ository0 +e re-ommen' t+o0 even better0 t.ree
systems. ".e t.ir' SA R/3 System -an be use' *or testin7 an' Euality assuran-e.
All -ustomer 'evelo,ments ta(e ,la-e in t.e -ustomer names,a-e. ".is means t.at all obHe-ts
-reate' by -ustomers .ave names +it.in a -ertain names,a-e0 *or e:am,le be7innin7 +it. F or V *or
A8A ,ro7rams.
SA A! "A#$0 4%5
SAP AG 2003
Technical $tructure o) an $AP $!stem (2)
,ata $tructure
,ata $tructure
$!stem Fernel
$!stem Fernel $!stem Fernel
SA A! "A#$0 4%6
SAP AG 3<<<
$creen
Processor
The $!stem Fernel
$perating Syste# and %ardware Platfor#
ABAP
,ictionar!
Pro"rammin" Inter)aces
Applications
C
o
m
m
u
n
i
c
a
t
i
o
n

I
n
t
e
r
)
a
c
e
C
o
m
m
u
n
i
c
a
t
i
o
n

I
n
t
e
r
)
a
c
e
5
s
e
r

I
n
t
e
r
)
a
c
e
5
s
e
r

I
n
t
e
r
)
a
c
e
8untime /n'ironment 8untime /n'ironment
ABAP
Interreter
".is unit intro'u-es t.e -entral ,ro-esses o* mySA.-om 8asis "e-.nolo7y. ".is in-lu'es an
e:,lanation o* .o+ a user reEuest is sent to an' ,ro-esse' by t.e a,,li-ation layer0 an' +.i-.
,ro-ess ty,es are involve' in ,ro-essin7 t.e reEuest. Data entere' by t.e user is sent t.rou7. t.e user
inter*a-e @t.e SA !91A to t.e 'is,at-.er0 +.i-. -oor'inates *urt.er ,ro-essin7. ".e +or( ,ro-esses
use t.e same sour-e -o'e as t.e 'is,at-.er an' +.ose substru-tures su-. as t.e S-reen 1nter,reter
an' t.e A8A 1nter,reter are ,resente' .ere. Anot.er to,i- is 'ata e:-.an7e +it. t.e 'atabase.
SA A! "A#$0 4%B
SAP AG 3<<<
Processin" 5ser 8e.uests
Presentation
Alication
,atabase
Communication
$AP %5I
,B ,B
,atabase Processes
,isatcher
Work
Process
Bu))er
$AP %5I $AP %5I $AP %5I
Work
Process
Work
Process
".e 'is,at-.er is t.e -entral ,ro-ess o* t.e a,,li-ation server. ".e 'is,at-.er mana7es0 in
asso-iation +it. t.e o,eratin7 system0 t.e resour-es *or t.e a,,li-ations +ritten in A8A. ".e main
tas(s o* t.e 'is,at-.er in-lu'e 'istributin7 transa-tion loa' to t.e +or( ,ro-esses0 -onne-tin7 to t.e
,resentation level0 an' or7ani<in7 -ommuni-ation.
9ser in,ut is re-eive' by t.e SA ,resentation ,ro7ram SA!910 -onverte' into its o+n *ormat an'
t.en sent to t.e 'is,at-.er. ".e ,ro-essin7 reEuests are t.en save' by t.e 'is,at-.er in reEuest
Eueues an' ,ro-esse' a--or'in7 to a first in-first-out ,rin-i,le.
".e 'is,at-.er 'istributes t.e reEuests one a*ter t.e ot.er to available +or( ,ro-esses. Data is
a-tually ,ro-esse' in t.e +or( ,ro-ess0 alt.ou7. t.e user0 +.o -reates t.e reEuest usin7 t.e SA
!910 is not al+ays assi7ne' t.e same +or( ,ro-ess. ".ere is no *i:e' assi7nment o* +or( ,ro-esses
to users.
3n-e t.e 'ata .as been ,ro-esse'0 t.e ,ro-essin7 result *rom t.e +or( ,ro-ess is sent via t.e
'is,at-.er ba-( to t.e SA !91. ".e SA !91 inter,rets t.e re-eive' 'ata an' 7enerates t.e out,ut
s-reen *or t.e user +it. t.e .el, o* t.e o,eratin7 system on t.e *ront en' -om,uter.
Durin7 initiali<ation o* t.e mySA.-om -om,onent system0 t.e 'is,at-.er e:e-utes t.e *ollo+in7
a-tions amon7 ot.ers) 1t rea's t.e system ,ro*ile ,arameters0 starts +or( ,ro-esses0 an' lo7s on to
t.e messa7e server @t.is servi-e +ill be e:,laine' laterA.
SA A! "A#$0 4%C
SAP AG 3<<<
$AP %5I T!es
$AP %5I )or Windo*sI
$AP %5I )or Ja'aK
$AP %5I )or 9T67
Windo*s #2 Bit
Ja'a Alication
Bro*ser4Based
".e ,resentation inter*a-e SA4/5 @!91 W 4raphical /ser 5nter#aceA im,lements t.e ,lat*orm%
s,e-i*i- in,ut an' out,ut *un-tions o* an SA business a,,li-ation. ".e SA !91 is ,rimarily base'
on t.e #in'o+s Style !ui'e an' is available *or several ,lat*orms ,rovi'in7 t.e same *un-tions *or
ea-.. 1* you .ave learne' to use t.e SA !91 on one ,lat*orm0 +it. t.e e:-e,tion o* a *e+ small
,lat*orm%s,e-i*i- !91 attributes0 you -an use t.e system on anot.er ,lat*orm e:a-tly t.e same as
be*ore.
".e ,resentation so*t+are im,lements t.e 7ra,.i-al user inter*a-e usin7 t.e *un-tions ,rovi'e' by
t.e relevant ,resentation environment.
As o* SA R/3 Release 4.68 you .ave a -.oi-e bet+een t.e S-lassi-T SA !91 an' a number o*
alternative a--ess ,ossibilities)
SAP !&+ for H%0L
SAP !&+ for 1ava2
SA A! "A#$0 4%9
SAP AG 3<<<
Presentation 7a!er
Presentation
Alication
$AP %5I
Process
Terminal
$er'er
Terminal Client
7A( / WA(
(et*ork
$AP %5I
Process
Windo*s PC
Ja'a
/n'ironment
Workstation/PC
,isatcher
$AP %5I
Windo*s PC and
Bro*ser )or
$AP %5I )or 9T67
".e 'ata *lo+ bet+een t.e ,resentation level an' t.e a,,li-ation level +.en usin7 t.e SA !91 *or
#in'o+s -onsists not o* ,re,are' ima7es0 but o* -om,a-t0 lo7i-al in*ormation about -ontrol
elements an' user entries @D1A! roto-olA. ".e amount o* 'ata t.at must be trans*erre' *or ea-.
s-reen -.an7e +.en usin7 t.e SA !91 *or #in'o+s is ty,i-ally several (8. Fou -an also -onne-t
a,,li-ation servers over #i'e Area 2et+or(s @#A2sA. =or more in*ormation0 see SA 2ote
$6$053.
An 1nternet "ransa-tion Server is use' *or t.e SA !91 *or >"M6 to turn t.e SA !91 'ata *lo+
*rom t.e 'is,at-.er into >"M60 an' -onversely. 1n t.is -ase0 an >"M6 'ata *lo+ is e:-.an7e'
bet+een t.e #!ate o* t.e 1"S @see t.e (ommunications and +ntegrations %ec*nology unitA an' t.e
=ronten'. ".e ,rimary a'vanta7e o* t.e SA !91 *or >"M6 is t.e lo+ installation -ost *or t.e
=ronten'I all you nee' is a bro+ser.
SA !91 *or ?ava re-eives t.e Stan'ar' D1A! roto-ol @*rom t.e 'is,at-.erA an' ,la-es t.is on t.e
=ronten' in >"M6 or0 i* in use by ?ava lu7%1ns0 in a 7ra,.i-al *ormat0 +.i-. -an0 *or e:am,le0 be
'is,laye' in a bro+ser. 1n t.is -ase t.e installation -osts *or t.e =ronten' are eEually minimal. =or
more in*ormation0 see SA 2ote $46505.
=or in*ormation about im,lementation o* t.e SA !91 on a #in'o+s "erminal &lient0 see SA
2ote $3CC69.
SA A! "A#$0 4%$0
SAP AG 3<<<
$AP Basis ,atabase 7a!er
(ati'e $G7
,B ,ata
Application Ser&er Database Ser&er
ABAP
Interreter
SELECT *
FROM ...
EXEC SQL.
SELECT ...
END EXEC.
,B ,ata
(ati'e $G7
0P/( $G7
,ata
,B
Inter)ace
7ocal
Bu))er
,ata
,atabase
(ati'e $G7
Relational Database Mana7ement Systems @RD8MSA are 7enerally use' to mana7e lar7e sets o*
'ata. An RD8MS saves 'ata an' relations.i,s bet+een 'ata in t.e *orm o* t+o%'imensional tables.
".ese are (no+n *or t.eir lo7i-al sim,li-ity. ".e 'ata0 tables0 an' table relations.i,s are 'e*ine' in
t.e 'atabase -atalo7 @t.e 'ata 'i-tionaryA o* t.e 'atabase system.
#it.in t.e A8A ,ro7rammin7 lan7ua7e0 you -an use SA 6!- S78 to a--ess 'ata in t.e
'atabase re7ar'less o* your 'atabase mana7ement system. ".e mySA.-om 'atabase inter*a-e
-onverts 3,en SQ6 statements *rom A8A statements into -orres,on'in7 'atabase statements. ".is
means t.at t.e a,,li-ation ,ro7rams t.at are +ritten in A8A 'o not 'e,en' on t.e 'atabase use'.
=urt.ermore0 2ative SQ6 -omman's -an be use' 'ire-tly in A8A.
#.en inter,retin7 3,en SQ6 statements0 t.e SA 'atabase inter*a-e -.e-(s t.e synta: o* t.ese
statements an' ensures t.e o,timal utili<ation o* t.e lo-al SA bu**ers in t.e s.are' memory o* t.e
a,,li-ation server. Data t.at is *reEuently reEuire' by t.e a,,li-ations is store' in t.ese bu**ers so
t.at t.e system 'oes not .ave to a--ess t.e 'atabase to rea' t.is 'ata. 1n ,arti-ular0 all te-.ni-al 'ata0
su-. as A8A ,ro7rams0 s-reens0 an' A8A Di-tionary in*ormation0 as +ell as a number o*
business a'ministration ,arameters0 usually remain un-.an7e' in a runnin7 system an' are t.ere*ore
i'eally suite' to bu**erin7. ".e same is true o* business a,,li-ation 'ata0 +.i-. is almost e:-lusively
a--esse' as rea'%only an' -an t.ere*ore be bu**ere'.
SA A! "A#$0 4%$$
SAP AG 3<<<
m!$AP&com Processes
H2
,ialo"
,
$AP ,isatcher
$ool
$
Back"round
12
L
?
#
33 3
9 >
B @
2 30
B
5date
H1
7ock Administration
/
%ate*a! $er'er
8/2
8/#
6essa"e $er'er
,is&
,is&
,is&
,is&
6$ 6$
%W %W
".e o,eratin7 system vie+s t.e SA runtime system as a 7rou, o* ,arallel0 -oo,eratin7 ,ro-esses.
3n ea-. a,,li-ation server t.ese ,ro-esses in-lu'e t.e 'is,at-.er as +ell as +or( ,ro-essesI t.e
number o* +or( ,ro-esses 'e,en's on t.e available resour-es. S,e-ial +or( ,ro-esses may be
installe' *or 'ialo7 ,ro-essin70 u,'ate0 ba-(7roun' ,ro-essin7 an' s,oolin7.
1n a''ition to t.ese +or( ,ro-ess ty,es @'ialo7 ,ro-essin7 @DA0 u,'ate @;) *or t.e !erman
L;erbu-.un7LA0 lo-( mana7ement @4A0 ba-(7roun' ,ro-essin7 @8A0 s,ool @SA0 t.e runtime system
,rovi'es t+o a''itional servi-es *or internal an' e:ternal -ommuni-ation @belo+ are t.e restri-tions
on t.e number o* +or( ,ro-essesA)
".e messa7e server @MS or MA -ommuni-ates bet+een t.e 'istribute' 'is,at-.ers +it.in a
mySA.-om System an' is t.ere*ore t.e ,rereEuisite *or s-alability usin7 several ,arallel%
,ro-essin7 a,,li-ation servers.
".e 7ate+ay server @!# or !A allo+s -ommuni-ation bet+een mySA.-om -om,onents su-. as
SA R/3 an' SA R/2 an' e:ternal a,,li-ation systems. ".ere is only one 7ate+ay ,ro-ess *or
ea-. 'is,at-.er ,ro-ess.
Dialo7) 4very 'is,at-.er reEuires at least t+o 'ialo7 +or( ,ro-esses
S,ool) At least one *or ea-. mySA.-om System @more t.an one allo+e' *or ea-. 'is,at-.erA
9,'ate) At least one *or ea-. mySA.-om System @more t.an one allo+e' *or ea-. 'is,at-.erA
8a-(7roun' ,ro-essin7) At least t+o *or ea-. mySA.-om System @more t.an one allo+e' *or
ea-. 'is,at-.erA
4nEueue) 3nly one enEueue +or( ,ro-ess is nee'e' *or ea-. system
SA A! "A#$0 4%$2
SAP AG 3<<<
The Instance Concet
4+;P
4ispatc'er
Instance (a) Instance (b)
=Central= Instance (c)
4ispatc'er
& & &
4+;P 4+;P
& & &
& & &
6$ 6$
4ispatc'er
4+;P B+;P
,+;P E+;P B+;P S+;P
An instan-e is an a'ministrative unit t.at -ombines mySA.-om system -om,onents ,rovi'in7 one
or more servi-es. ".e servi-es o**ere' by an instan-e are starte' or sto,,e' to7et.er. Fou use a
-ommon instan-e ,ro*ile to set ,arameters *or all o* t.e -om,onents o* an instan-e.
A -entral mySA.-om System -onsists o* a sin7le instan-e t.at ,rovi'es all o* t.e ne-essary
servi-es.
4a-. instan-e .as its o+n SA bu**er areas.
".e e:am,le illustrates .o+ a ba-(7roun' ,ro-essin7 server @aA an' 'ialo7 server @bA are set u,.
".ese instan-es0 +.i-. ,rovi'e s,e-i*i- servi-es0 7enerally run on se,arate servers0 but -an also run
on t.e same server0 i* nee'e'.
".e messa7e server ,rovi'es t.e a,,li-ation servers +it. a -entral messa7e servi-e *or internal
-ommuni-ation @*or e:am,le) tri77er u,'ate0 reEuest an' remove lo-(s0 or tri77er ba-(7roun'
reEuestsA.
".e 'is,at-.ers *or t.e in'ivi'ual a,,li-ation servers -ommuni-ate t.rou7. t.e messa7e server t.at
is installe' on-e in ea-. mySA.-om System @it is -on*i7ure' in t.e system ,ro*ile *ilesA.
resentation servers -an also lo7 on to an a,,li-ation server t.rou7. t.e messa7e server. ".is means
t.at you -an use t.e messa7e server ,er*orman-e 'atabase *or automati- loa' 'istribution @lo7on loa'
balan-in7A.
SA A! "A#$0 4%$3
SAP AG 3<<<
The ,ialo" Work Process
$hared 6emor!
8e.uest
Gueues
Frontend3 $AP %5I
,isatcher
Factor! Calendar
$creens
ABAP Pro"rams
Tables
,ictionar! 0b1ects&&&
Alication Bu))er
8oll File
5ser Conte+t
8oll Area
$creen
Processor
ABAP
Processor
,atabase
Inter)ace
Task
9andler
I
n
t
e
r
n
a
l

6
e
m
o
r
!
8oll In 8ollout
Bu))er Access
Work Process n
&&&
Work
Process 1
7A( / WA(
(et*ork
".e *ollo+in7 -om,onents on t.e a,,li-ation level are involve' in ,ro-essin7 a 'ialo7 reEuest)
".e 'is,at-.er as -entral -ontrol ,ro-ess
#or( ,ro-ess Eueues @a'ministere' by t.e 'is,at-.erA *or in-omin7 reEuests.
3ne o* t.e 'iao7 +or( ,ro-esses
8u**ers in s.are' memory an' also ,ossibly t.e roll *ile
".e tas' han"ler -oor'inates a-tivity +it.in a 'ialo7 +or( ,ro-ess. 1t a-tivates t.e s-reen ,ro-essor
or t.e t.e A8A ,ro-essor @+.i-. -ontrol t.e s-reen *lo+ lo7i- an' ,ro-ess A8A statements0
res,e-tivelyA an' e:e-utes t.e roll%in an' roll%out o* t.e user -onte:t.
".e memory mana7ement system 'i**erentiates bet+een main memory areas t.at are available
e:-lusively to a +or( ,ro-ess0 an' memory areas t.at -an be use' by all +or( ,ro-esses. ".e
memory s,a-e use' e:-lusively by a +or( ,ro-ess stores session%s,e-i*i- 'ata t.at must be (e,t
lon7er t.an t.e 'uration o* a +or( ste,. ".is 'ata is automati-ally ma'e available to t.e ,ro-ess at
t.e start o* a 'ialo7 ste, @rolle'%inA an' save' at t.e en' o* t.e 'ialo7 ste, @rolle'%outA. ".is 'ata
-.ara-teri<es users @user -onte:tA0 su-. as t.eir aut.ori<ations0 a'ministration in*ormation an'
a''itional 'ata *or t.e A8A an' 'ialo7 ,ro-essor. 1t also -ontains 'ata -olle-te' by t.e system in
t.e ,re-e'in7 'ialo7 ste,s in t.e runnin7 transa-tion @see sli'e 3or- Process 0ultiplexing and SAP
%ransactionsA.
".ere are also a''itional memory areas *or all ,ro-esses in t.e s.are' memory *or t.e *a-tory
-alen'ar0 s-reen0 table0 ,ro7ram0 an' ot.er bu**ers.
SA A! "A#$0 4%$4
SAP AG 3<<<
7on"48unnin" ABAP Pro"rams
4+;P 4+;P 4+;P 4+;P 4+;P 4+;P 4+;P 4+;P
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
12
L
?
#
33 3
9 >
B @
2 30
,ialo" Work Processes )or ,ialo" Transactions
T*o 5sers Are Blockin" $e'en ,ialo" Work Processes *ith
7on"48unnin" Transactions
4ispatc'er
Dialo7 +or( ,ro-esses s.oul' not be loa'e' 'o+n +it. lon7%runnin7 'ialo7 ste,s0 as t.ese +or(
,ro-esses +oul' t.en not be available to ot.er users. ".e remainin7 'ialo7 +or( ,ro-esses +oul'
.ave to .an'le many more users0 t.us -onsi'erably in-reasin7 res,onse times.
".is is t.e reason *or t.e ,arameter r'is,/ma:O+,runOtime @'e*ault settin7) 300 se-on'sA0 +.i-.
sets t.e ma:imum time a 'ialo7 ste, is allo+e' to remain in a 'ialo7 +or( ,ro-ess. 1* t.is time is
e:-ee'e' by more t.an 'ouble0 t.e 'ialo7 ste, is terminate' an' t.e starte' transa-tion terminates
+it. an error. ".is allo+s t.e a'ministrator to ensure t.at users e:e-ute lon7%runnin7 a-tions only in
t.e ba-(7roun' +or( ,ro-esses0 +.i-. are 'esi7ne' *or t.ese ty,es o* lon7%runnin7 a-tions.
SA A! "A#$0 4%$5
SAP AG 3<<<
12
L
?
#
33 3
9 >
B @
2 30
Job
Back"round Processin"
,B
,B
1 1
@ @
2 2
,ialo" $er'er
& & &
4+;P
Back"round Processin" $er'er
& & &
MMM ++++
MMM ++++ ++++ +++ +++ ++
555 uuuu uuuu uuu uuu uu
55 uuuu uuu u
Sc"eduling Table Sc"eduling Table
Job1 Job1 C C &&& &&& &&& &&&
Back"round $cheduler
(e'er! ?0 s)
4ispatc'er 4ispatc'er
4+;P
B+;P B+;P B+;P
# #
8a-(7roun' +or( ,ro-esses are use' *or 'ialo7%*ree e:e-ution o* ,ro7rams. ".ey are use'0 *or
e:am,le0 *or ,erio'i- tas(s su-. as reor7ani<ation or t.e automati- trans*er o* 'ata *rom an e:ternal
system to a mySA.-om -om,onent system.
8a-(7roun' ,ro-essin7 is s-.e'ule' in t.e *orm o* Hobs. 4a-. Hob -onsists o* one or more ste,s
@A8A re,orts0 e:ternal ,ro7rams or ot.er o,eratin7 system -allsA t.at are ,ro-esse' seEuentially.
Fou -an also set ,riorities @*rom L&L to LALA so t.at -ertain Hobs are ,rioriti<e'.
?ob ,ro-essin7 is not 7enerally tri77ere' imme'iately @imme'iate startA. 1nstea' you s,e-i*y a start
'ate an' time +.en you s-.e'ule t.e Hob. 1t may also be ne-essary to start Hobs ,erio'i-ally0 *or
e:am,le0 system -ontrol Hobs re,eate' on a *i:e' -y-le. Fou -an tri77er a Hob start at t.e o,eratin7
system level usin7 t.e SA4;" ,ro7ram.
".e ba-(7roun' s-.e'uler is res,onsible *or automati-ally tri77erin7 t.e Hob at t.e s,e-i*ie' time.
".e ba-(7roun' s-.e'uler is an A8A ,ro7ram t.at re7ularly loo(s in t.e s-.e'ulin7 table *or Hobs
to be e:e-ute' an' t.en ensures t.at t.ey are e:e-ute' @RD1S/8"&"1M40 'e*ault 60 sA.
SA A! "A#$0 4%$6
SAP AG 3<<<
Printin" in m!$AP&com $!stems
Printer ser'er
7A(/WA(
$ool $er'er
& & &
0eratin" $!stem
$ool
Tem$e Tem$e
,atabase/File $!stem
1B &&&
@1 @2
@# &&&&
0, 0A
1B &&&
@1 @2
@# &&&&
0, 0A
0eratin"
$!stem
$ool
Tri""erin" o) rint rocess2
)or e+amle )rom $AP %5I3 Printin" a 7ist
ABC
MCF
4ispatc'er
ABC
MCF
$ool
8e.uest
0utut
8e.uest
S+;P
4+;P
S,oolin7 re*ers to t.e bu**ere' trans*er o* 'ata to out,ut 'evi-es su-. as ,rinters0 *a: 'evi-es an' so
on. 1n 'istribute' systems0 net+or(e' a'ministration is ne-essary *or t.is out,ut.
".e s,ool me-.anism in mySA.-om Systems -an su,,ly out,ut reEuests to ,rinters an' e:ternal
s,oolers bot. +it.in a lo-al net+or( as +ell as over #A2s. ".e s,ool me-.anism +or(s +it. t.e
lo-al s,ool system on ea-. server.
S,ool reEuests are 7enerate' in 'ialo7 mo'e or 'urin7 ba-(7roun' ,ro-essin7 an' are t.en set in t.e
s,ool 'atabase +it. 'etails about t.e out,ut 'evi-e an' t.e ,rint *ormat. ".e 'ata itsel* is store' in
t.e "4M,orary SeEuential@"emSeA obHe-t 'atabase.
#.en 'ata is to be ,rinte'0 an out,ut reEuest is 7enerate' *or a s,ool reEuest. ".is out,ut reEuest is
,ro-esse' by a s,ool +or( ,ro-ess.
3n-e t.e s,ool +or( ,ro-ess .as *ormatte' t.e 'ata *or out,ut0 it returns t.e out,ut reEuest to t.e
o,eratin7 system s,ool system.
".e o,eratin7 system s,ooler ta(es over t.e Eueue mana7ement an' ensures t.at t.e reEuire' 'ata is
,asse' on to t.e out,ut 'evi-e.
SA A! "A#$0 4%$B
SAP AG 3<<<
7ock Administration in m!$AP&com $!stems
,B ,B
55 uuuu uuu u
MMM ++++ ++++ +++ +++ ++
555 uuuu uuuu uuu uuu uu
Chan"e Access At 6ost 8ead Access
4+;P E+;P B+;P 4+;P
".e lo-( me-.anisms ,resent in t.e -urrent relational 'atabase systems are not 7enerally su**i-ient
to .an'le business 'ata obHe-ts @su-. as sales or'ersA t.at may a**e-t several tables in t.e 'atabase.
"o -oor'inate several a,,li-ations simultaneously a--essin7 t.e same business obHe-t0 t.e
mySA.-om System ,rovi'es its o+n lo-( mana7ement0 -ontrolle' by t.e enEueue +or( ,ro-ess.
1n or'er *or t.e system to e:e-ute lo-( reEuests0 you must *irst 'e*ine a lo-( obHe-t in t.e A8A
Di-tionary. ".e lo-( obHe-t -ontains tables +.ose entries are to be lo-(e'. Fou -an also .ave
a''itional se-on'ary tables usin7 *orei7n (ey relations.i,s @t.e name o* a user%'e*ine' lo-( obHe-t
must be7in +it. L4FL or L4VLA.
Fou -an s,e-i*y t.e lo-( mo'e @LSL) s.are' lo-( or L4L) e:-lusive lo-(A *or a lo-( obHe-t. An
e:-lusive lo-( @mo'e L4LA -an only be set i* no ot.er user .as set a lo-( @L4L or LSLA on t.e 'ata
re-or'. ".e same user -an reEuest a''itional L4L or LSL lo-(s +it.in a transa-tion.
1* a lo-( obHe-t is a-tivate'0 t.e system 7enerates an 42Q9494 an' a D4Q9494 *un-tion mo'ule.
".ese *un-tion mo'ules .ave t.e names 42Q9494OXobHe-tOnameJ an'
D4Q9494OXobHe-tOnameJ0 an' are use' in A8A -o'in7 to lo-( an' unlo-( 'ata.
SA A! "A#$0 4%$C
SAP AG 3<<<
8e.uestin" a 7ock )rom the /n.ueue WP
!all function
'E()*E*E+E,,,'
/n.ueue $er'er
& & &
& & &
,ialo" $er'er
7ock table in
main memor!
& & &
6$ 6$
4+;P
4ispatc'er
4ispatc'er
E+;P
#.en a lo-( is reEueste'0 t.e system -.e-(s to 'etermine +.et.er t.e reEueste' lo-( -on*li-ts +it.
any entries in t.e lo-( table. 1* t.ere are -on*li-ts0 t.e lo-( reEuest is reHe-te'. ".e a,,li-ation
,ro7ram -an t.en in*orm t.e user t.at t.e reEueste' o,eration -annot -urrently be e:e-ute'.
".e lo-(s @enEueuesA are a'ministere' by t.e enEueue +or( ,ro-ess usin7 t.e lo-( table. ".e lo-(
table is store' in t.e main memory o* t.e server +.ere t.e enEueue +or( ,ro-ess is runnin7. 1n t.e
e:am,le s.o+n above0 t.e 'ialo7 +or( ,ro-ess an' t.e enEueue +or( ,ro-esses are not lo-ate' on
t.e same a,,li-ation server0 t.ey -ommuni-ate t.rou7. t.e messa7e server.
6o-(s set by an a,,li-ation ,ro7ram are eit.er reset by t.e a,,li-ation ,ro7ram itsel*0 or usin7 a
s,e-ial u,'ate ,ro7ram @se-on' ,art o* t.e SA 6o7i-al 9nit o* #or(A. 6o-(s0 +.i-. are in.erite'
in t.is +ay by an u,'ate +or( ,ro-ess0 are also +ritten to a *ile at o,eratin7 system level. 1n
transa-tion SM$20 t.e lo-(s .el' by t.e u,'ate ,ro7ram are -olore' blue0 +.ile t.e lo-(s .el' in t.e
'ialo7 +or( ,ro-ess are -olore' bla-(.
SA A! "A#$0 4%$9
SAP AG 3<<<
Work Process 6ultile+in" and $AP Transactions
4ialo0
;P 0
4ialo0
;P 3
4ialo0
;P 2
PB0
100
PAI
100
PB0
10B
PAI
110
PAI
10B
PB0
110
PB0 PAI
5ser Chooses3
$a'e / Cancel
Screen
,05
Screen
,00
Screen
,,0
PAI PB0 PB0 PAI
Screen
8usiness transa-tions are ,ro-essin7 units +it. relate' *un-tionsI t.ese transa-tions e:e-ute
-onsistent 'atabase -.an7es meanin7*ul *or t.e business. "y,i-al e:am,les are -re'it an' 'ebit
,ostin7s0 +.i-. only ma(e sense to7et.er0 or -reatin7 an or'er an' reservin7 t.e material -on-erne'.
A--or'in7ly0 an SA transa-tion is im,lemente' as a series o* -onsistent0 -onne-te' 'ialo7 ste,s. A
user 'ialo7 ste, is re,resente' by a s-reen @or a 'yn,ro0 +.i-. is a 'ynami- ,ro7ram W mas( an'
*lo+ lo7i-A.
SA transa-tions are not ne-essarily e:e-ute' +it.in one sin7le 'ialo7 +or( ,ro-ess. 1n *a-t0 t.e
in'ivi'ual 'ialo7 ste,s o* a transa-tion -an be ,ro-esse' by various 'ialo7 +or( ,ro-esses @+or(
,ro-ess multi,le:in70 +.i-. only e:ists *or 'ialo7 +or( ,ro-essesA. 9sin7 asyn-.ronous u,'ate0 t.e
'ialo7 ,art o* t.e transa-tion an' t.e asso-iate' 'atabase u,'ate -an also be run in 'i**erent +or(
,ro-ess ty,es or even on 'i**erent servers.
=rom t.e systemUs ,oint o* vie+0 a 'ialo7 ste, be7ins +it. t.e ,ro-essin7 o* a ,ie-e o* 'ata entere'
by t.e user @ro-ess a*ter 1n,ut @A1A an' t.e ,re,aration an' sen'in7 o* t.e ne:t s-reen tem,late
@ro-ess be*ore 3ut,ut @83AI a*ter t.is0 t.e s-reen t.at .as been *ille' out by t.e user is on-e a7ain
a--e,te'0 an' in turn t.e in,ut 'ata -ontaine' in t.e re-eive' s-reen is analy<e' an' ,ro-esse'.
System an' user 'ialo7 ste,s are ,ro-esse' alternately. ".e t+o ,arts o* t.e 'ialo7 ste, *rom t.e
systemUs ,oint o* vie+ are -alle' 83 an' A1.
SA A! "A#$0 4%20
SAP AG 2003
Technical $tructure o) an $AP $!stem3 $ummar!
;ou are no* able to
,escribe the data structure o) $AP s!stems
(ame 'arious t!es o) $AP %5I
8eresent the basic structure o) a m!$AP&com
s!stem
/+lain the relationshis bet*een the rocesses on
the di))erent client/ser'er la!ers in $AP $!stems ()or
e+amle2 8/#)
SA A! "A#$0 4%2$
SAP AG 2003
0r"aniEational units and master data
Transactions and documents
Work)lo*
Contents3
Cross4$!stem Concets
SA A! "A#$0 5%$
SAP AG 2003
/nterrise $tructure3 Terminolo"!
Coman!
$ubsidiar!
Factor!
Warehouses
/nterrise
Client
Coman!
Code
Plant
$tora"e
7ocations
$ales
0r"aniEation
,i'ision ,eartment ,i'ision
Business
Area
$ales
0r"aniEation
$AP
$AP
".e stru-ture o* an enter,rise is ma,,e' to SA a,,li-ations by or7ani<ational units. 3r7ani<ational
units summari<e s,e-i*i- -or,orate *un-tions.
3r7ani<ational units -an belon7 to a sin7le a,,li-ation @a sales or7ani<ation -an belon7 to Sales an'
Distribution0 *or e:am,leA or t.ey be assi7ne' to several a,,li-ations @a *a-tory -an be assi7ne' to
Materials Mana7ement an' ro'u-tion lannin70 *or e:am,leA.
SA A! "A#$0 5%2
SAP AG 2003
/nterrise $tructures3 Tiers
%erman!
5&$&A&
Client
Coman!
Code
Plant
$tora"e
7ocation
$AP
9ambur" 1000 ,resden 1200
Ides 9oldin"
Berlin 1100
000# 0002 0001
The client is the superior element o# all or.ani9ational units. A -lient -orres,on's to a 7rou, +it.
several subsi'iaries. All -om,any 'ata in an R/3 installation are 'i**erentiate' at least by -lient0 but
usually also by 'ee,er or7ani<ational stru-tures.
=le:ible or7ani<ational elements in t.e R/3 System mean you also .ave t.e o,tion o* ma,,in7
-om,le: enter,rise stru-tures. Many or7ani<ational units are use' to re,resent t.e le7al an'
or7ani<ational stru-ture o* an enter,rise *rom 'i**erent ,oints o* vie+.
".e various enter,rise areas are Hoine' by lin(in7 t.e or7ani<ational units to7et.er an' t.e stru-ture
o* t.e total enter,rise is re,resente' in t.e R/3 System.
SA A! "A#$0 5%3
SAP AG 2003
6aster ,ata3 Customer 6aster
Client
Coman!
Code
$ales Area
$tora"e
7ocation
Customer 6aster 8ecord
(ame
Address
7an"ua"e&&&
$ales/$hiin"
Billin" Parameter
Partner
Pa!ment Parameters
%/7 Account
,unnin"&
Financial Accountin" Financial Accountin"
,ata ,ata
$ales ,ata $ales ,ata
%eneral ,ata %eneral ,ata
Master 'ata are 'ata re-or's t.at remain in t.e 'atabase *or a lon7 ,erio' o* time. Master 'ata
in-lu'e -ustomers0 su,,liers0 materials0 a--ounts an' so on.
Master 'ata are -reate' -entrally @*or all a,,li-ationsA .
Master 'ata .ave an or7ani<ational as,e-t. ".ey are assi7ne' to or7ani<ational units. A -ustomer
master re-or' -an be assi7ne' to t.e *ollo+in7 or7ani<ational units) -om,any -o'e0 sales
or7ani<ation0 'istribution -.annel an' 'ivision.
Master 'ata -an be use' *or all mo'ules. =or e:am,le0 -ustomer master 'ata .ave -ommon 'ata *or
a--ountin7 an' sales.
SA A! "A#$0 5%4
SAP AG 2003
6aster ,ata3 6aterial 6aster
$ales
0r"aniEation
,istribution
Channel
Client
Plant
$tora"e
7ocation
6aterial 6aster 8ecord
,eli'erin" Plant
Control T!es
$ales 5nit
&&&
6aterial (umber
$hort Te+t2
Holume2 Wei"ht
Basic 5nit o) 6easure
&&&
Haluation
Forecast
Plannin" Parameters
Purchasin" Parameters
&&&
8e.uirements Plannin"
Parameters
In'entor! 6ana"ement
Ph!sical In'entor!
&&&
".e material master is t.e -entral sour-e *or a -om,any to 'is,lay material%s,e-i*i- 'ata. 1t is use'
by all -om,onents o* t.e SA lo7isti-s system.
".e 'ata in t.e material master -an be use' by all areas su-. as ,ur-.asin70 inventory mana7ement0
materials ,lannin70 invoi-e veri*i-ation an' so on.
SA A! "A#$0 5%5
SAP AG 2003
6aterial 6aster3 ,atabase Con'ersion
6A8A
6A8C
6AFT 6A86 6HF/ 67A(
67%(
6A8,
67%T
6/A( 6B/W
6AP8 6H/8
".e in'ivi'ual tables -ontain t.e *ollo+in7 'ata)
MARA !eneral 'ata
MAK" S.ort te:ts
MARM &onversion *a-tors
M;K4 Sales 'ata *or ea-. sales or7ani<ation
M6A2 Sales 'ata *or ea-. -ountry
M4A2 4A2 'ata
M84# ;aluation 'ata
MAR& Material 'ata *or ea-. ,lant
M6!2 Material 'ata *or ea-. 6;S +are.ouse
M6!" Material 'ata *or ea-. 6;S stora7e ty,e
MARD Material 'ata *or ea-. stora7e lo-ation
M;4R &onsum,tion 'ata
MAR =ore-ast 'ata @in'i-atorsA
SA A! "A#$0 5%6
SAP AG 2003
Transaction3 5sin" 6aster ,ata and
0r"aniEational 5nits
Customer3 1000
Item
10
20
6aterial
9,41#00
P410#
Guantit!
1
2
6aterial
6aster 8ecord
$ales ,ocument
Customer
6aster 8ecord
Coman!
Code
,i'ision
$ales
0r"aniEation
,istribution
Channel
#.en a -ustomer or'er is -reate'0 t.e trans,ort a7reements0 terms o* 'elivery an' ,ayment an' so on
a7ree' +it. t.e business ,artner must be -onsi'ere'. So t.at you 'onYt .ave to enter t.is in*ormation
*or ea-. a-tivity -onne-te' +it. t.e business ,artner0 t.e 'ata t.at are relevant *or t.e a-tivity are
-o,ie' *rom t.e business ,artnerYs material master.
".e in*ormation store' in t.e material master re-or' @,ri-e ,er unit o* measure0 sto-( ,er stora7e
lo-ation an' so onA are ,ro-esse' in t.e or'er entry. ".is ,rin-i,le a,,lies to ,ro-essin7 t.e 'ata
*rom any master re-or' involve' in t.e a-tivity.
".e relevant or7ani<ation units must be assi7ne' +.en a transa-tion is e:e-ute'. ".is ensures t.at
t.e assi7nments to t.e -om,any stru-ture are retaine' in t.e 'o-ument t.at is -reate'0 in a''ition to
t.e in*ormation store' *or t.e -ustomer an' t.e material.
A 'o-ument is -reate' *or ea-. transa-tion t.at is e:e-ute' in t.e R/3 System.
".e 'o-ument t.at is -reate' *rom a transa-tion im,li-itly -ontains all o* t.e 'e*ault *eatures *or t.e
master 'ata an' or7ani<ational units.
SA A! "A#$0 5%B
SAP AG 2003
6essa"e T!e
6essa"e t!e
Printer Tele)a+ /4mail /,I
0nline
(screen outut)
Immediatel!
(creatin" orders)
0n re.uest
(rintin" acti'it!)
With ne+t selection run
or at a seci)ied time
(schedulin")
-n&oice -n&oice -n&oice
6essa"es
#.enever you save a Euery0 an or'er0 an outline a7reement0 a inEuiry -on*irmation0 a 'elivery note
an' so on0 an out,ut *ormat is -reate' *rom t.e 'o-ument -on-erne'. ".is out,ut *ormat is a messa7e
@messa7e ty,eA. ".e messa7e is t.en ,la-e' in t.e messa7e Eueue0 *rom +.ere it -an be release' *or
,rintin70 out,ut via 4D1 an' so on as reEuire'. ".e messa7e is release' eit.er manually or
automati-ally usin7 a messa7e -ontrol ,ro7ram.
Fou -an use t.e various sen' me'ia to out,ut in'ivi'ual messa7es 'urin7 ,ro-essin70 ,rovi'e' t.at
t.e -orres,on'in7 messa7e ty,es an' sen' me'ia +ere assi7ne' in &ustomi<in7. =or ea-. 'o-ument
ty,e0 you -an 'e*ine +.en an' .o+ t.e messa7es are sent.
".e messa7e -ontrol -an be store' as a 'e*ault value in t.e business ,artnerYs master re-or'.
SA A! "A#$0 5%C
SAP AG 2003
$AP Business Work)lo*
Work)lo* comleted
,ecision ,ecision
,ecision
7ea'e )orm
created
$uer'isor
$uer'isor
7ea'e )orm
rocessed
,ates not
aro'ed
Form
chan"ed
Form
re1ected
,ates aro'ed
/mlo!ee
/mlo!ee
,ates aro'ed
".e SA 8usiness #or(*lo+ is a tool t.at you -an use to o,timi<e t.e *lo+ o* business transa-tions.
1t -an e:e-ute -onse-utive +or( ste,s automati-ally0 or -oor'inate t.e *lo+ o* in*ormation.
#or(*lo+s -ontrol ,ro-esses a--or'in7 to a ,re'e*ine' mo'el an' are ,arti-ularly suitable *or
or7ani<ations t.at are stru-ture' an' base' on t.e ,rin-i,le o* 'ivision o* labor.
#or(*lo+ brin7s t.e Lri7.tL +or( in t.e Lri7.tL seEuen-e to t.e Lri7.tL ,ersons at t.e Lri7.tL time.
".is -an be 'one usin7 an automate' mail or a +or(*lo+ item.
SA A! "A#$0 5%9
SAP AG 2003
$!stem4Wide Concets3 5nit $ummar!
;ou are no* able to
(ame the main elements in a business scenario
,escribe the link bet*een the main elements in a
business scenario
SA A! "A#$0 5%$0
SAP AG 2003
Comle+3 ABAP Workbench Fundamentals
SA A! "A#$0 6%$
SAP AG 2003
Course Content3 ABAP Workbench
Fundamentals (1)
#nit ABAP Pro"ram Process
#nit Introduction to the ABAP
Workbench
#nit Introduction to the ABAP
,ictionar!
#nit Basic ABAP 7an"ua"e
/lements
#nit ,ata 8etrie'al
#nit Pro"ram4internal
6odulariEation *ith
$ubroutines
#nit The ABAP 8untime
$!stem
#nit 5ser ,ialo" 7ist
SA A! "A#$0 6%2

SAP AG 2003
Course Contents3 ABAP Workbench
Fundamentals (2)
#nit 5ser ,ialo" $election
$creen
#nit 5ser ,ialo" $creen
#nit %lobal 6odulariEation
#nit Callin" Pro"rams and
Trans)errin" ,ata
Aendi+
SA A! "A#$0 6%3
SAP AG 2003
In this course2 !ou *ill de'elo se'eral
ro"rams desi"ned to assist tra'el a"encies&
$ome o) their t!ical needs include3
,eterminin" )li"ht connections on seci)ic dates
Processin" bookin"s )or seci)ic )li"hts
/'aluatin" additional )li"ht in)ormation2 such as
Price
Caacit!
,earture cit!
,earture airort
,estination airort
,estination cit!
6ain Business $cenario
SA A! "A#$0 6%4
SAP AG 2003
Imortant ,atabase Tables )or the Fli"ht ,ata
6odel
SCARR SCARR CARRID3
CARRNAME:
CURRCODE:
Airline I,
Airline name
7ocal currenc! o) airline
SPFLI SPFLI CARRID3
CONNID:
COUNTRYFR:
CITYFROM:
AIRPFROM:
COUNTRYTO:
CITYTO:
AIRPTO:
Airline I,
Fli"ht connection I,
Countr! ke! )or dearture cit!
,earture cit!
,earture airort
Countr! ke! )or arri'al cit!
,estination cit!
,estination airort
SFLIGHT SFLIGHT CARRID3
CONNID:
FLDATE:
PRICE:
CURRENCY:
SEATSMAX:
SEATSOCC:
Airline I,
Fli"ht connection I,
Fli"ht date
Price
Currenc!
6a+imum number o) seats on )li"ht
Current number o) occuied seats on )li"ht
Fou +ill re*er to t.is in*ormation as you 'o t.e e:er-ises t.rou7.out t.is -ourse.
SA A! "A#$0 6%5
SAP AG 2003
$!stem Architecture and ABAP Pro"ram
/+amle Pro"ram *ith $election $creen and 7ist
Contents3
ABAP Pro"ram Process
SA A! "A#$0 B%$
SAP AG 2003
,escribe the architecture o) the 8/# $!stem
,escribe ho* to e+ecute a simle dialo" ro"ram
usin" the ABAP runtime s!stem
At the conclusion o) this unit2 !ou *ill be able to3
Pro"ram Flo* o) an ABAP Pro"ram3 5nit
0b1ecti'es
SA A! "A#$0 B%2
SAP AG 2003
$!stem Architecture and ABAP Pro"ram
$!stem Architecture and ABAP Pro"ram
$!stem Architecture and ABAP Pro"ram
/+amle Pro"ram *ith $election $creen and 7ist
/+amle Pro"ram *ith $election $creen and 7ist
SA A! "A#$0 B%3
SAP AG 2003
Client/$er'er Architecture
Presentation
$er'er
7a!er
Alication
$er'er
7a!er
,atabase
,isatcher
Work
Process
$AP%5I $AP%5I $AP%5I $AP%5I $AP%5I $AP%5I
Work
Process
Work
Process
Work
Process
,isatcher
Work
Process
Work
Process
Work
Process
Work
Process
".e R/3 System .as a mo'ular so*t+are ar-.ite-ture t.at *ollo+s so#t*are)oriente" -lient/server
,rin-i,les.
".e R/3 System allo-ates t.e ,resentation0 a,,li-ation lo7i-0 an' 'ata stora7e to 'i**erent -om,uters.
".is serves as t.e basis *or t.e scala&ility o* t.e R/3 System.
".e lo+est level is t.e "ata&ase le+el. >ere 'ata is mana7e' +it. a relational 'atabase mana7ement
system @RD8MSA. 1n a''ition to a,,li-ation 'ata0 t.e 'atabase -ontains t.e ,ro7rams an' t.e
meta'ata t.at t.e R/3 System reEuires *or sel*%mana7ement.
A8A ,ro7rams @bot. t.e a,,li-ations ,rovi'e' by SA an' t.e ones you 'evelo, yoursel*A run at
t.e application ser+er le+el. ".e A8A ,ro7rams rea' 'ata *rom t.e 'atabase level0 ,ro-ess t.e
'ata0 an' ,ossibly store 'ata t.ere.
".e presentation ser+er le+el -ontains t.e user inter*a-e t.rou7. +.i-. ea-. user -an a--ess t.e
,ro7ram0 enter ne+ 'ata0 an' 'is,lay t.e results o* a +or( ,ro-ess.
".e te-.ni-al 'istribution o* so*t+are is in'e,en'ent o* its ,.ysi-al lo-ation on t.e .ar'+are. All
levels -an be installe' verti-ally @on to, o* ea-. ot.er on one -om,uterA or ea-. level -an be installe'
on a se,arate -om,uter. ".e ,resentation an' a,,li-ation servers -an be 'ivi'e' .ori<ontally amon7
any number o* -om,uters. ".e .ori<ontal 'istribution o* 'atabase -om,onents0 .o+ever0 'e,en's on
t.e ty,e o* 'atabase installe'.
SA A! "A#$0 B%4
SAP AG 2003
/+cert )or an ABAP Pro"ram
Presentation
$er'er
7a!er
Alication
$er'er
7a!er
,atabase
Work Process
ABAP Pro"ram
".is 7ra,.i- -an be sim,li*ie' *or most to,i-s 'is-usse' 'urin7 t.is -ourse. ".e intera-tion bet+een
a sin.le user an' a sin.le A8A ,ro7ram +ill be o* ,rimary interest to us 'urin7 t.is -ourse.
".e e:a-t ,ro-esses involve' in user 'is,at-.in7 on an a,,li-ation server are se-on'ary to
un'erstan'in7 .o+ to +rite an A8A ,ro7ram. ".ere*ore0 +e +ill +or( +it. a sim,li*ie' 7ra,.i-
t.at 'oes not e:,li-itly s.o+ t.e 'is,at-.er an' t.e +or( ,ro-ess. &ertain sli'es +ill0 .o+ever0
in-lu'e t.ese 'etails +.enever t.ey are relevant to A8A ,ro7rammin7.
A8A ,ro7rams are ,ro-esse' on t.e a,,li-ation server. ".e 'esi7n o* user "ialo.s an' "ata&ase
"ialo.s is0 t.ere*ore0 o* ,arti-ular im,ortan-e +.en +ritin7 a,,li-ation ,ro7rams.
SA A! "A#$0 B%5
SAP AG 2003
Black Black Bo+ Bo+
Hie* )or the 5ser
Presentation
$er'er
7a!er
Alication
$er'er
7a!er
,atabase
$election $creen 7ist $creen
Most users are only intereste' in .o+ a business transa-tion *lo+s an' .o+ to enter 'ata into an'
'is,lay 'ata *rom a transa-tion. ".e te-.ni-al as,e-ts o* ,ro7rammin7 are less interestin7. ".e user
'oes not nee' to (no+ t.e ,re-ise *lo+ o* t.e A8A ,ro7ram on t.e a,,li-ation server. "o t.e
avera7e user0 t.e SA system is li(e a Lbla-( bo:.L
"e-.ni-ally s,ea(in70 t.ere are t.ree 'i**erent ty,es o* s-reens) 'ynami- s-reens or 'yn,ros0
sele-tion s-reens0 an' lists. 4a-. ty,e o* s-reen ,rovi'es 'i**erent servi-es. ".e 'evelo,erUs tas( is to
sele-t *or ea-. user 'ialo7 e:a-tly t.ose ty,es t.at are most suitable *or t.e a--om,lis.ment o* t.e
tas(s -on-erne'. =or t.is reason0 'evelo,ers s.oul' .ave ,re-ise (no+le'7e o* t.e te-.ni-al as,e-ts.
SA A! "A#$0 B%6
SAP AG 2003
Interaction Bet*een $er'er 7a!ers
Pro"ram
$tart
ABAP 8untime $!stem
ABAP Pro"ram
ABAP
Processin"
Block
ABAP
Processin"
Block
,atabase
Table
Time
3n-e t.e user ,er*orms a user a-tion @sele-tin7 Enter# a *un-tion (ey0 a menu *un-tion or a
,us.button0 *or e:am,leA0 -ontrol is ,asse' *rom t.e ,resentation server to t.e a,,li-ation server.
3nly -ertain ,arts o* t.e A8A ,ro7ram are ,ro-esse'.
1* a *urt.er user 'ialo7 is tri77ere' *rom +it.in t.e A8A ,ro7ram0 t.e system transmits t.e s-reen
an' ,asses -ontrol on-e a7ain to t.e ,resentation server.
SA A! "A#$0 B%B
SAP AG 2003
/+amle Pro"ram *ith $election $creen and 7ist
$!stem Architecture and ABAP Pro"ram
$!stem Architecture and ABAP Pro"ram
/+amle Pro"ram *ith $election $creen and 7ist
/+amle Pro"ram *ith $election $creen and 7ist
SA A! "A#$0 B%C
SAP AG 2003
Time
Pro"ram
$tart
Pro"ram $tart
,atabase
Table
8eositor!
#.enever a user lo7s on to t.e system0 a s-reen is 'is,laye'. =rom t.is s-reen0 t.e user -an start an
A8A ,ro7ram via a menu ,at. or by enterin7 a transa-tion -o'e.
SA A! "A#$0 B%9
SAP AG 2003
Time
Pro"ram
$tart
$!stem 7oads Pro"ram Conte+t
,ata 0b1ects
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
$election $creen
8eositor!
,atabase
Table
".e system *irst loa's t.e ,ro7ram -onte:t onto t.e a,,li-ation server. ".e ,ro7ram -onte:t -ontains
memory areas *or variables an' -om,le: 'ata obHe-ts0 in*ormation on t.e s-reens *or user 'ialo7s0
an' A8A ,ro-essin7 blo-(s. ".e runtime system 7ets t.e ,ro7ram in*ormation *rom t.e
Re,ository0 +.i-. is a s,e-ial ,art o* t.e 'atabase.
".e sam,le ,ro7ram .as a sele-tion s-reen as t.e user 'ialo70 a variable an' a stru-ture as 'ata
obHe-ts0 an' one A8A ,ro-essin7 blo-(. ".e list t.at is use' to 'is,lay t.e 'ata is -reate'
'ynami-ally at run time.
".e A8A runtime system -ontrols t.e subseEuent ,ro7ram *lo+.
SA A! "A#$0 B%$0
SAP AG 2003
Time
Pro"ram
$tart
8untime $!stem $ends $election $creen
,ata 0b1ects
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
,atabase
Table
8eositor!
8e-ause t.e ,ro7ram -ontains a sele-tion s-reen0 t.e A8A runtime system sen's it to t.e
,resentation server. ".e ,resentation server -ontrols t.e ,ro7ram *lo+ *or as lon7 as t.e user enters
'ata in t.e in,ut *iel's.
Sele-tion s-reens allo+ users to enter sele-tion -riteria reEuire' by t.e ,ro7ram.
SA A! "A#$0 B%$$
SAP AG 2003
Time
Pro"ram
$tart
Inut Halues Are Inserted into ,ata 0b1ects
,ata 0b1ects
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
,atabase
Table
8eositor!
As soon as t.e user .as *inis.e' enterin7 'ata on t.e sele-tion s-reen0 .e or s.e -an tri77er *urt.er
,ro-essin7 o* t.e ,ro7ram by sele-tin7 4:e-ute.
".e entere' 'ata is automati-ally ,la-e' in its -orres,on'in7 'ata obHe-ts in t.e ,ro7ram an' t.e
A8A runtime system resumes -ontrol o* ,ro-essin7.
1n our sim,le ,ro7ram e:am,le0 t.ere is only one A8A ,ro-essin7 blo-(. ".e A8A runtime
system tri77ers seEuential ,ro-essin7 o* t.is A8A ,ro-essin7 blo-(.
1* t.e entries ma'e by t.e user 'o not .ave t.e -orre-t ty,e0 an error messa7e is tri77ere'
automati-ally. ".e user must -orre-t t.e entries.
SA A! "A#$0 B%$2
SAP AG 2003
Time
Pro"ram
$tart
Pro"ram 8e.uests ,ata 8ecord )rom ,atabase
,atabase
Table
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
,ata 0b1ects
8eositor!
#it.in t.e A8A ,ro-essin7 blo-(0 a rea' a--ess to t.e 'atabase is ,ro7ramme'. ".e ,ro7ram
,asses to t.e 'atabase in*ormation about +.i-. 'atabase table to a--ess an' +.i-. line in t.e table to
rea'.
SA A! "A#$0 B%$3
SAP AG 2003
Time
Pro"ram
$tart
,atabase 8eturns ,ata 8ecord to Pro"ram
,atabase
Table
,ata 0b1ects
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
8eositor!
".e 'atabase returns t.e reEueste' 'ata re-or' to t.e ,ro7ram an' t.e runtime system ensures t.at
t.is 'ata is store' in t.e a,,ro,riate 'ata obHe-ts.
1* a sin7le re-or' is a--esse'0 t.is 'ata obHe-t is usually a stru-ture t.at -ontains -om,onents *or all
t.e reEuire' 'atabase *iel's.
SA A! "A#$0 B%$4
SAP AG 2003
Time
Pro"ram
$tart
8untime $!stem $ends 7ist
,atabase
Table
,ata 0b1ects
ABAP
Processin"
Block
ABAP 8untime $!stem
ABAP Pro"ram
8eositor!
".e layout o* t.e subseEuent list 'is,lay +as also ,ro7ramme' into t.e ,ro-essin7 blo-(. A*ter
-om,letion0 t.e runtime ,ro7ram sen's t.is list as a s-reen to t.e ,resentation server.
SA A! "A#$0 B%$5
SAP AG 2003
,escribe in basic terms the architecture o) the 8/#
$!stem
,escribe in basic terms the e+ecution o) a simle
dialo" ro"ram usin" the ABAP runtime s!stem
;ou are no* able to3
Pro"ram Flo* o) an ABAP Pro"ram3 5nit $ummar!
SA A! "A#$0 B%$6
SAP AG 2003
Introduction to the 8/# 8eositor!
Workin" *ith the 0b1ect (a'i"ator
0r"aniEin" ,e'eloments
,e'eloin" an ABAP Pro"ram
Contents3
Introduction to the ABAP Workbench
SA A! "A#$0 C%$
SAP AG 2003
,escribe the structure o) the 8/# 8eositor! and
its search tools
5se the 0b1ect (a'i"ator )or !our de'eloment
*ork
(ame and use the utilities )or orderl! so)t*are
de'eloment
Create de'eloment classes2 ABAP ro"rams2
and transaction codes
At the conclusion o) this unit2 !ou *ill be able to3
Introduction to the ABAP Workbench3
5nit 0b1ecti'es
SA A! "A#$0 C%2
SAP AG 2003
Introduction to the 8/# 8eositor!
Introduction to the 8/# 8eositor!
Introduction to the 8/# 8eositor!
Workin" *ith the 0b1ect (a'i"ator
Workin" *ith the 0b1ect (a'i"ator
0r"aniEin" ,e'eloments
0r"aniEin" ,e'eloments
,e'eloin" ABAP Pro"rams
,e'eloin" ABAP Pro"rams
SA A! "A#$0 C%3
SAP AG 2003
The 8/# 8eositor!
Presentation
$er'er
7a!er
Alication
$er'er
7a!er
,atabase
ABAP Pro"ram
8eositor!
CustomiEin" tables
Alication tables
Cross4client Client4seci)ic
".e 'atabase -ontains a,,li-ation an' &ustomi<in7 tables t.at are usually client)speci#ic.
".e 'atabase also -ontains t.e R/3 Re,ository. ".e A8A Di-tionary is ,art o* t.e R/3 Re,ository.
".e R:3 Repository -ontains all t.e 'evelo,ment obHe-ts0 *or e:am,le0 ,ro7rams0 'e*initions o*
'atabase tables0 or -entral 'ata ty,e 'e*initions. Develo,ment obHe-ts are t.ere*ore also (no+n as
Re,ository obHe-ts.
Re,ository obHe-ts are ne+er client)speci#icI t.ere*ore0 t.ey -an be vie+e' an' use' in all -lients.
SA A! "A#$0 C%4
SAP AG 2003
$tructure o) the 8/# 8eositor!
6 6
66
,e'eloment Classes
8eositor! 0b1ects
Function 6odules
Pro"rams
Tables
& & &
FI 98
66
$,
66
W6
Cust&
".e R/3 Re,ository is sub'ivi'e' a--or'in7 to a,,li-ation -om,onents.
4a-. a,,li-ation -om,onent is *urt.er 'ivi'e' into lo7i-al sub'ivisions -alle' "e+elopment classes.
Re,ository obHe-ts are o*ten ma'e u, o* sub%obHe-ts t.at are t.emselves Re,ository obHe-ts.
#.en you -reate a Re,ository obHe-t0 you must assi7n it to a 'evelo,ment -lass.
SA A! "A#$0 C%5
SAP AG 2003
$AP
$AP Alication 9ierarch!
Cross4Alication Comonents
Accountin" 4 %eneral
Financial Accountin"
&&&
FBA$ Financial Accountin" Basis
&&&
FI4%7 %eneral 7ed"er Acct"
FI47C Consolidation
&&&
Treasur!
Controllin"
1N
1N
Alication comonent
,e'eloment class
$elected subtree
In)ormation $!stem
1N
1N
1N
1N
1N
1N
CA
AC
FI
T8
C0
&&&
".e stru-ture o* t.e a,,li-ation -om,onents is s.o+n in t.e application hierarchy. =rom t.e SA
4asy A--ess menu0 you a--ess t.e a,,li-ation .ierar-.y by -.oosin7
Tools A'A$ %or(benc! Overview Application )ierarc!y.
".e a,,li-ation -om,onents are 'is,laye' in a tree stru-ture in t.e a,,li-ation .ierar-.y. 4:,an'in7
a -om,onent 'is,lays all t.e 'evelo,ment -lasses t.at are assi7ne' to t.at -om,onent.
Fou -an sele-t a subtree or bran-. an' navi7ate *rom t.e a,,li-ation .ierar-.y to t.e R/3 Re,ository
1n*ormation System. ".e system t.en -olle-ts all 'evelo,ment -lasses *or t.e bran-. sele-te' an'
,asses t.em to t.e Re,ository 1n*ormation System.
SA A! "A#$0 C%6
SAP AG 2003
8/# 8eositor! In)ormation $!stem
8eositor! In)ormation $!stem
Business en"ineerin"
ABAP ,ictionar!
Basic ob1ects
,atabase tables
Hie*s
,ata elements
$tructures
Table t!es
&&&
0ther ob1ects
Fields
Pro"rammin"
Function Builder
Pro"ram 7ibrar!
Pro"& en'ironment
Pro"ram sub4ob1ects
ABAP ob1ects
Class librar!
Comonents o) classes
Comonents o) inter)aces
/n'ironment
Fou -an use t.e Re,ository 1n*ormation System to sear-. *or s,e-i*i- Re,ository obHe-ts. Suitable
sear-. -riteria are available *or t.e various Re,ository obHe-ts.
#.i-. obHe-ts are to be *oun' usin7 t.e Re,ository 1n*ormation System 'e,en's on .o+ you 7et
t.ere)
=rom +it.in t.e a,,li-ation .iera-.y0 sele-t t.e +nformation system @'ouble%-li-( t.e sele-te'
a,,li-ation -om,onent or 'evelo,ment -lassA. ".is *ilters t.e t.e res,e-tive Re,ository obHe-ts.
=rom t.e SA 4asy A--ess menu0 -.oose %ools A,AP 3or-enc* Overview +nformation
system. ".e system lists all t.e Re,ository 3bHe-ts available *or sear-.in7.
SA A! "A#$0 C%B
SAP AG 2003
Workin" With the 0b1ect (a'i"ator
Introduction to the 8/# 8eositor!
Introduction to the 8/# 8eositor!
Workin" *ith the 0b1ect (a'i"ator
Workin" *ith the 0b1ect (a'i"ator
0r"aniEin" ,e'eloments
0r"aniEin" ,e'eloments
,e'eloin" ABAP Pro"rams
,e'eloin" ABAP Pro"rams
SA A! "A#$0 C%C
SAP AG 2003
Function Builder Function Builder
$creen Painter $creen Painter
ABAP ABAP ,ictionar! ,ictionar! ABAP /ditor ABAP /ditor
0b1ect
(a'i"ator
6enu Painter 6enu Painter
ABAP Workbench Tools
,ebu""er ,ebu""er
Class Builder Class Builder
FI 98
66
$,
66
W6
Cust&
".e A0A ;or'&ench -ontains 'i**erent tools *or e'itin7 Re,ository obHe-ts. ".ese tools -an be
use' t.rou7.out t.e entire so*t+are 'evelo,ment -y-le. ".e most im,ortant tools *or -reatin7 an'
e'itin7 Re,ository obHe-ts are as *ollo+s)
".e A0A !"itor *or e'itin7 sour-e te:t
".e A8A Di-tionary *or ,ro-essin7 'atabase table 'e*initions0 -entral 'ata ty,es0 an' more
".e S-reen ainter *or -on*i7urin7 s-reens @s-reens +it. *un-tions *or user 'ialo7sA
%enu ainter *or 'esi7nin7 t.e user inter*a-e @menu bar0 stan'ar' toolbar0 a,,li-ation toolbarA
@see +nterfaces/
".e Function 0uil"er *or ,ro-essin7 *un-tion mo'ules
".e &lass 8uil'er *or ,ro-essin7 -entral -lasses
Fou -an start t.ese tools in t.ree +ays)
Dire-tly *rom t.e 4asy A--ess menu.
9sin7 t.e 6&<ect -a+i.ator. ".is .as a tree 'ia7ram o* all obHe-ts +it.in a 'evelo,ment -lass or
,ro7ram. Double%-li-( on an obHe-t to start t.e res,e-tive tool.
8y 'ouble%-li-(in7 *rom one tool to t.e ne:t0 an' ba-( a7ain.
SA A! "A#$0 C%9
SAP AG 2003
$creen $tructure in the 0b1ect (a'i"ator
$iEe o) disla! area can be chan"ed
8i"ht4click
Conte+t menu
Full screen
on/o))
Conte+t menu
8i"ht4click
(a'i"ation area
Tool area
".e 3bHe-t 2avi7ator s-reen is 'ivi'e' into t+o areas)
A navi7ation area *or 'is,layin7 an obHe-t list as a .ierar-.y tree
A tool area *or 'is,layin7 an' e'itin7 a 'evelo,ment obHe-t usin7 t.e -orre-t tool
Fou -an 'is,lay or .i'e t.e .ierar-.y area.
Fou -an sele-t *un-tions *rom a -onte:t menu in bot. s-reen areas. Fou are 7iven a -.oi-e o* only
t.ose *un-tions t.at are ,rovi'e' *or 'is,layin7 or e'itin7 t.e obHe-t to +.i-. you are ,ointin7.
Ri7.t%-li-( on t.e obHe-t to o,en t.e -onte:t menu.
SA A! "A#$0 C%$0
SAP AG 2003
Workin" *ith the (a'i"ation Area
,ictionar! ob1ects
Pro"rams
$APBC@00WB,C%/TTI(%C$TA
$APBC@00WBTC%/TTI(%C$TA
Function "rous
BC@00
Classes
C7CBC@00
BC@00
Devel!"e#$ Cl%&&
'C())
5se o) na'i"ation
histor!
A!!l*+%$*# H*e,%,+-.
Devel!"e#$ Cl%&&
P,/,%"
F0#+$*# G,0!
Cl%&& / I#$e,1%+e
I#$e,#e$ Se,v*+e
L+%l O23e+$&
Fa'orites
8e)resh ob1ect list
,isla! hi"her4le'el
ob1ect list
,ouble4click on a
8eositor! ob1ect *ith
subob1ects3 7ist o)
subob1ects
,ouble4click on a
8eositor! ob1ect *ith
subob1ects3 7ist o)
subob1ects
,ouble4click on a
8eositor! ob1ect *ith
subob1ects3 7ist o)
subob1ects
".e Re,ository obHe-ts are or7ani<e' in a .ierar-.y)
An a,,li-ation -om,onent -an .ave 'i**erent 'evelo,ment -lasses.
A 'evelo,ment -lass -an -ontain 'i**erent Re,ository obHe-ts) ,ro7rams0 *un-tion 7rou,s0 A8A
Di-tionary obHe-ts0 an' so on.
4a-. Re,ository obHe-t -an .ave 'i**erent subobHe-ts assi7ne' to it)
SubobHe-ts belon7in7 to a ,ro7ram) 7lobal 'ata0 ty,es0 events0 sub,ro7rams0 an' so on
SubobHe-ts belon7in7 to a *un-tion 7rou,) 7lobal 'ata0 *un-tion mo'ules0 an' so on
Fou -an enter t.e ty,e o* obHe-t list an' t.e obHe-t name in t.e u,,er ,art o* t.e navi7ation area. ".e
obHe-t list is t.en 'is,laye' in t.e navi7ation area.
"o 'is,lay t.e subobHe-ts0 'ouble%-li-( an obHe-t +it.in t.e obHe-t list.
1* an obHe-t is not in an obHe-t list0 you -an 'is,lay it by usin7 t.e res,e-tive tool in t.e tool area.
Fou -an navi7ate bet+een obHe-t lists eit.er by eit.er history or hierarchy.
Fou -an a'' obHe-t lists t.at you e'it *reEuently to your *avorites.
SA A! "A#$0 C%$$
SAP AG 2003
(a'i"ation in the Tool Area
(a'i"ation stack
Functions o) the
current tool
$ho* na'i"ation
*indo*
9ide na'i"ation
*indo*
5se o) na'i"ation
histor!
5se o) na'i"ation
histor!
1n t.e tool area0 you -an 'is,lay a +in'o+ s.o+in7 your navi7ation .istory0 t.at is0 a list o* t.e
obHe-ts you .ave 'is,laye' sin-e you starte' t.e 3bHe-t 2avi7ator in t.e tool area.
".e obHe-t -urrently 'is,laye' in t.e tool area is .i7.li7.te' in a 'i**erent -olor.
SA A! "A#$0 C%$2
SAP AG 2003
$!nchroniEation o) (a'i"ation and Tool Areas
,isla!
Chan"e
&&&
,isla! ob1ect list
,ouble4click on a
8eositor! ob1ect
*ithout subob1ects or
choose conte+t menu3
,isla!/chan"e in tool
area
2avi7ation in t.e navi7ation area is lo7i-ally in"epen"ent #rom navi7ation in t.e tool area. ".is
allo+s *or s-reens to be use' in a *le:ible manner.
1* you +is.0 you -an syn-.roni<e t.e t+o areas)
Fou -an "isplay an o&<ect in t.e tool area by 'ouble%-li-(in7 it0 or by sele-tin7 t.e -onte:t menu
*rom +it.in t.e navi7ation area. ".e system automati-ally sele-ts t.e a,,ro,riate tool *or
,ro-essin7 t.e obHe-t you sele-te'.
"o "isplay the o&<ect list t.at belon7s to an obHe-t you are -urrently ,ro-essin7 in t.e tool area0
-.oose 'isplay o4ect list.
"o create o&<ects *rom an obHe-t list0 you -an use t.e -onte:t menu *or t.at obHe-t ty,e. 1* t.ere is no
entry in t.e obHe-t list *or t.e reEuire' obHe-t ty,e0 you -an -reate any number o* obHe-ts usin7 Edit
o4ect or Ot*er o4ect.
SA A! "A#$0 C%$3
SAP AG 2003
0r"aniEin" ,e'eloments
Introduction to the 8/# 8eositor!
Introduction to the 8/# 8eositor!
Workin" *ith the 0b1ect (a'i"ator
Workin" *ith the 0b1ect (a'i"ator
0r"aniEin" ,e'eloments
0r"aniEin" ,e'eloments
,e'eloin" ABAP Pro"rams
,e'eloin" ABAP Pro"rams
SA A! "A#$0 C%$4
SAP AG 2003
,e'eloment $!stem Production $!stem
Transortin" 8eositor! 0b1ects
FI 98
66
$,
66
W6
Cust&
Chan"e
8e.uest 8e.uest
FI 98
66
$,
66
W6
Cust&
Develo,ment ,roHe-ts are al+ays im,lemente' in a 'evelo,ment system an' t.en trans,orte' to t.e
ne:t system.
Re,ository obHe-ts are automati-ally assi7ne' to a trans,ort route base' on t.eir belon7in7 to a
,arti-ular 'evelo,ment -lass an' on t.eir a-tual *un-tion.
A 'e-isive -riterion *or -ombinin7 t.e 'evelo,ment ,roHe-ts is0 t.ere*ore0 +.i-. Re,ository obHe-ts
nee' to be trans,orte' to7et.er be-ause o* t.eir 'e,en'en-ies.
Fou s-.e'ule t.e .roup transport o* t.e Re,ository obHe-ts usin7 a chan.e re=uest.
SA A! "A#$0 C%$5
SAP AG 2003
$chedulin" a ,e'eloment Pro1ect
$chedule3 6onda!
8e.uest is released
Team3
Pro1ect 6ana"er3
F8;
F8;
BC@00400
BC@00401
BC@00402
BC@0040#
&&&
Frida! &&&
7ockin" 0b1ects )or (on 7ockin" 0b1ects )or (on4 4Pro1ect Pro1ect 6embers 6embers
S-.e'ulin7 a 'evelo,ment ,roHe-t usin7 a -.an7e reEuest -overs t.e *ollo+in7 as,e-ts)
All em,loyees in t.e ,roHe-t start t.eir +or( on a 'e*ine' 'ate.
4m,loyees .ave t.e -.an-e to *ollo+ u, an' -.e-( t.eir a-tivities se,arately.
".e res,e-tive Re,ository obHe-ts -an be ,ro-esse' by all em,loyees involve' in t.e ,roHe-t. =or
t.ose 'evelo,ers +.o 'o not belon7 to t.e team0 t.e Re,ository obHe-ts remain lo-(e' until t.e
,roHe-t is -om,lete'.
".e 7rou, tri77ers t.e trans,ort o* all t.e res,e-tive Re,ository obHe-ts.
SA A! "A#$0 C%$6
SAP AG 2003
Workbench 0r"aniEer3 Chan"e 8e.uests
Pro1ect 8eresentation in the
Workbench 0r"aniEer
Team3
Pro1ect 6ana"er3
F8;
F8;
BC@00400
BC@00401
BC@00402
BC@0040#
&&&
C'an0e reGuests in8ol8in0 user BC@00+00
C'an0ea$le
(ransporta$le
%(3K<000>3 CA.S7
%(3K<000>2 CA.S7
%(3K<000>3 BC@00+00
.eport source
FBC@00E00E/*%G:(*%S(
ABAP pro0ram
%(3K<000>@ BC@00+03
%(3K<000>> BC@00+02
%(3K<000>2 BC@00+03
%(3K<000>9 !!!
8e.uest number
Pro1ect
6ana"er
Task number
8eositor! ob1ects
created or corrected
b! emlo!ee
5ser
At t.e be7innin7 o* a 'evelo,ment ,roHe-t0 t.e pro<ect mana.er -reates a -.an7e reEuest in t.e
;or'&ench 6r.ani9er. ".e ,roHe-t mana7er assi7ns all ,roHe-t team members to t.e -.an7e
reEuest. ".e #or(ben-. 3r7ani<er t.en -reates a tas' *or ea-. ,roHe-t 'evelo,er.
=rom no+ on0 +.enever an em,loyee assi7ns a Re,ository obHe-t to t.is -.an7e reEuest0 t.e
Re,ository obHe-t is automati-ally entere' in t.e em,loyeeYs tas(. ".us all Re,ository obHe-ts t.at an
em,loyee +or(s on 'urin7 a 'evelo,ment ,roHe-t are -olle-te' +it.in .is or .er tas( *ol'er. ".e
Re,ository obHe-ts are t.ere*ore lo-(e' *or all 'evelo,ers +.o 'o not belon7 to t.is ,arti-ular
,roHe-t.
9nli(e t.e lo7i-al *un-tional 'ivisions t.at se,arate Re,ository obHe-ts t.rou7. t.e res,e-tive
'evelo,ment -lass0 -.an7e reEuests are ,roHe-t%relate' an'0 t.ere*ore0 are limite' to t.e time
sche"ule involve'. ".us0 alt.ou7. a ,ro7ram al+ays belon7s to only one 'evelo,ment -lass0 it -an
belon7 to 'i**erent -.an7e reEuests at 'i**erent times.
SA A! "A#$0 C%$B
SAP AG 2003
/+amle3 Creatin" ,e'eloment Classes
Create 4e8elopment Class
,e'eloment Class
$hort Te+t
Transort 7a!er
Person 8esonsible
$o)t*are Comonent
Alication Comonent
DBC@00C00
/+ercises "rou 00
D,/H
BC@00400
906/
CA
Where should the de'eloment ob1ects be transorted toA
To *hich alication
comonent does the
de'eloment class belon"A
Coml! *ith customer namesace
Fou -an -reate a 'evelo,ment -lass in t.e 3bHe-t 2avi7ator.
As o* Release 4.6&0 you -an -.oose t.e obHe-t ty,e 'evelopment (lass an' enter t.e name o* t.e
'evelo,ment -lass in t.e in,ut *iel'. Ma(e sure you -om,ly +it. t.e -ustomer names,a-e
-onventions. 1* t.e 'evelo,ment -lass 'oes not alrea'y e:ist0 t.e system 'is,lays t.e (reate
'evelopment (lass 'ialo7 bo:.
=or Release 4.6A an' 4.680 you must -.oose Edit o4ect or Ot*er o4ect in t.e initial s-reen. 4nter
t.e name o* t.e 'evelo,ment -lass in t.e in,ut *iel' on Ot*er tab ,a7e.
Fou s.oul' -.e-( t.e settin7s *or t.e *ollo+in7 attributes)
Transport layer ) 1* you -arry out your o+n 'evelo,ments0 you must set u, a trans,ort layer *or
-ustomer 'evelo,ments.
erson responsi&le % ".is ,erson .as *ull res,onsibility *or t.e obHe-ts in t.is 'evelo,ment -lass.
".e system automati-ally uses t.is user name as a 'e*ault value.
So#t*are component ) =or -ustomer 'evelo,ments you s.oul' enter HOME as t.e so*t+are
-om,onent. "o 7et 'etaile' in*ormation on t.e *iel'0 sele-t =$ .el,.
Application component ) 9se' to s,e-i*y t.e lo-ation o* t.e 'evelo,ment -lass +it.in t.e
a,,li-ation .ierar-.y.
SA A! "A#$0 C%$C
SAP AG 2003
Assi"nment to a Chan"e 8e.uest
,e'eloment class/&&
Promt )or transortable Workbench re.uest
DBC@00C00
My reGuests
Promt )or transortable Workbench re.uest
C'an0e reGuests in8ol8in0 user BC@00+00
C'an0ea$le
(ransporta$le
%(3K<000>3 /.C
%(3K<000>2 /.C
%(3K<000>3 BC@00+00
%(3K<000>@ BC@00+03
,ouble4click
re.uest number
8e.uest IT#FL00B1
/+ercises )or articiants o) BC@00
Workbench re.uest
All Re,ository obHe-ts t.at are -reate' or -.an7e' must be assi7ne' to t.e -.an7e reEuest o* t.e
res,e-tive ,roHe-t. =or t.is -ourse0 t.e trainer .as -reate' a -.an7e reEuest *or t.e ,roHe-t -alle'
L4:er-ises *or arti-i,ants o* 8&400L. 4a-. 7rou, .as a tas( +it.in t.is -.an7e reEuest.
"o 'is,lay all -.an7e reEuests in +.i-. you .ave a tas(0 sele-t Own re5uests.
#.en you assi7n all Re,ository obHe-ts @'evelo,ment -lasses0 ,ro7rams0 an' so onA to t.is -.an7e
reEuest0 t.e system ta(es -are o* t.e e:a-t assi7nment *or your tas(.
SA A! "A#$0 C%$9
SAP AG 2003
,e'eloin" ABAP Pro"rams
Introduction to the 8/# 8eositor!
Introduction to the 8/# 8eositor!
Workin" *ith the 0b1ect (a'i"ator
Workin" *ith the 0b1ect (a'i"ator
0r"aniEin" ,e'eloments
0r"aniEin" ,e'eloments
,e'eloin" ABAP Pro"rams
,e'eloin" ABAP Pro"rams
SA A! "A#$0 C%20
SAP AG 2003
Features o) the ABAP Pro"rammin" 7an"ua"e
There)ore2 it is desi"ned )or dialo"4based2 business alications&
The ABAP ro"rammin" lan"ua"e &&&
9as de)ined t!es
/nables multi4lan"ua"e alications
9as $G7 embedded *ithin it
9as been enhanced as an ob1ect4oriented lan"ua"e
Is lat)orm4indeendent
Is do*n*ards comatible
"o su,,ort 'ata ,ro-essin7 by ty,es0 A8A -ontains a systemati- ty,e .ierar-.y. "y,e -onversions
an' ty,e -astin7 are su,,orte'.
9sin7 translatable te:t elements0 you -an 'evelo, multi%lan7ua7e a,,li-ations.
".e 342 SQ6 stan'ar' embe''e' in A8A allo+s 'ire-t 'atabase a--esses.
A8A 3bHe-ts is t.e obHe-t%oriente' en.an-ement o* t.e A8A ,ro7rammin7 lan7ua7e.
".e A8A runtime system is one o* t.e R/3 8asis -om,onents an' is ,lat*orm%in'e,en'ent.
A8A -ontinues to evolve *rom release to release. 1* an ol' synta: statement is re,la-e' by a better
one0 you -an still run t.e ol' statement.
SA A! "A#$0 C%2$
SAP AG 2003
DATA 4%5&+%,, TYPE &+%,,.
START6OF6SELECTION.
SELECT * FROM &+%,,
INTO CORRESPONDING FIELDS OF 4%5&+%,,.
NE76LINE.
7RITE 4%5&+%,,6+%,,*8.
7RITE 4%5&+%,,6+%,,#%"e.
7RITE 4%5&+%,,60,l.
ENDSELECT.
%eneral ABAP $!nta+ I
Additions and oerands
(deendent on ke!*ords)
ABAP ABAP
ke!*ord ke!*ord
START START6 6OF OF6 6SELECTION. SELECTION.
SELECT SELECT
ENDSELECT. ENDSELECT.
7RITE 7RITE
. .
. .
. .
Period as s!mbol )or closin" Period as s!mbol )or closin"
the the ABAP ABAP statement statement
DATA DATA . .
NE7 NE76 6LINE. LINE.
7RITE 7RITE
7RITE 7RITE . .
A8A ,ro7rams -onsist u, o* in'ivi'ual statements.
4a-. statement en's +it. a ,erio'.
".e *irst +or' in a statement is -alle' a 'ey*or".
#or's must al+ays be se,arate' by at least one s,a-e.
Statements -an be in'ente'.
Statements -an ta(e u, more t.an one line.
A sin7le line -an -ontain multi,le statements.
".e A8A runtime system is not -ase sensitiveI t.at is0 it 'oes not 'istin7uis. bet+een lo+er-ase
an' u,,er-ase letters *or (ey+or's0 a''itions0 an' o,eran's. "o ma(e it easier to se,arate t.em
visually0 in t.is -ourse all (ey+or's an' t.eir a''itions are in u,,er-ase an' all o,eran's are in
lo+er-ase.
=or in'entations an' *or -onvertin7 u,,er-ase an' lo+er-ase letters0 use t.e retty ainter *un-tion.
&.oose &tilities Settings A,AP Editor Pretty Printer
SA A! "A#$0 C%22
SAP AG 2003
* +""e#$& ...
* +""e#$& ...
* +""e#$& ...
DATA 4%5&+%,, TYPE &+%,,.
START6OF6SELECTION.
SELECT * FROM &+%,, 9 +""e#$& ...
INTO CORRESPONDING FIELDS OF 4%5&+%,,.
NE76LINE.
7RITE 4%5&+%,,6+%,,*8:
4%5&+%,,6+%,,#%"e:
4%5&+%,,60,l.
ENDSELECT.
: :
: :
: :
. .
%eneral ABAP $!nta+ II
Chained Chained
$tatement $tatement
* *
* *
* *
9 9
Comments Comments
9se an asteris( @RA to intro'u-e comment lines. ".e A8A runtime system i7nores t.e -omment
line.
%* you +ant to enter a -omment in t.e mi''le o* a starte' line0 enter 'ouble Euotes.Fou -an -ombine
-onse-utive statements *ith an i"entical &e.innin. into a sin7le chaine" statement)
&lose t.e i'enti-al be7innin7 ,art +it. a -olon.
Se,arate in'ivi'ual elements t.at -ome a*ter t.e -olon by -ommas.
9se blan( s,a-es an' line brea(s be*ore an' a*ter t.e se,arators @-olons0 -ommas0 an' ,erio'sA.
".e A8A runtime system -onsi'ers t.e in'ivi'ual ,arts o* a -.aine' statement to be sin7le
statements.
SA A! "A#$0 C%23
SAP AG 2003
8eturn Halue A)ter ABAP $tatements
PARAMETERS !%5+%,, TYPE &+%,,6+%,,*8.
DATA 4%5&+%,, TYPE &+%,,.
START6OF6SELECTION.
SELECT SINGLE * FROM &+%,,
INTO CORRESPONDING FIELDS OF 4%5&+%,,
7HERE +%,,*8 ; !%5+%,,.
IF &.6&02,+ EQ ).
NE76LINE.
7RITE: 4%5&+%,,6+%,,*8:
4%5&+%,,6+%,,#%"e:
4%5&+%,,60,l.
ELSE.
7RITE <S,,.: # 8%$% 10#8=<.
ENDIF.
&. &.6 6&02,+ &02,+
#it. several A8A statements0 t.e A8A runtime system +rites a return -o'e into t.e system *iel'
sy)su&rc to in'i-ate .o+ su--ess*ully t.e statement +as e:e-ute'
".e return -o'e <ero @0A means t.at t.e statement +as su--ess*ul..
Rea' t.e 'o-umentation *or t.e res,e-tive statements to *in' out +.et.er an' .o+ t.is return -o'e is
set in in'ivi'ual -ases.
SA A! "A#$0 C%24
SAP AG 2003
With T0P Include
Create Pro"ram
Pro"ram
DBC@00C00C%$
Creatin" an ABAP Pro"ram
Attributes
ABAP3 Pro"ram Attributes &&&
Title
&&&
T!e
$tatus
Alication
Fi+ed oint arithmetic
/+ecutable ro"ram
Test ro"ram
Coml! *ith customer namesaceO
=rom t.e O4ect 6avigator# you -an -reate a ,ro7ram usin7 one o* t.e *ollo+in7 o,tions)
1n t.e navi7ation area0 -.oose Program as t.e obHe-t ty,e an' enter a ,ro7ram name. 8e sure to
-om,ly +it. t.e -ustomer names,a-e -onventions. 1* t.e ,ro7ram 'oes not e:ist0 t.e system
'is,lays t.e 'ialo7 seEuen-e t.at lets you -reate a ,ro7ram. @".is ,ro-e'ure is ,ossible only as o*
Release 4.6&.A
Dis,lay t.e 'evelo,ment -lass *or +.i-. you +ant to -reate t.e ,ro7ram. Start t.e 'ialo7 seEuen-e
*or -reatin7 a ,ro7ram usin7 t.e 'evelo,ment -lass -onte:t menu or t.e Program no'e.
Sele-t Ot*er o4ect""" or Edit o4ect. Sele-t t.e Program o4ects tab an' enter t.e name. Sele-t
(reate"
1n t.is -ourse0 'esele-t 3it* %op +nclude @by removin7 t.e -.e-( mar( *rom t.e -.e-(bo:A. @1* you
'onUt 'o t.is0 your sour-e te:t +oul' be 'istribute' to several ,ro7rams.A
&.an7e t.e title to a meanin7*ul s.ort te:t.
&.oose %est program as t.e ,ro7ram status *or all A8A -ourses.
SA A! "A#$0 C%25
SAP AG 2003
Fe!*ord ,ocumentation in the ABAP /ditor
START6OF6SELECTION.
SELECT SINGLE * FROM &+%,,
INTO 4%5&+%,,
7HERE +%,,*8 ; !%5+%,.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&+%,,
TO &2+())5+%,,*e,.
CALL SCREEN ?)).
MO>E6CORRESPONDING &2+())5+%,,*e,
TO 4%5&+%,,.
7RITE: 4%5&+%,,6+%,,*8:
4%5&+%,,6+%,,#%"e:
4%5&+%,,6+0,,+8e.
ENDIF.
7RITE 7RITE
/ditor 9el
ABAP 0'er'ie*
ABAP Term
ABAP (e*s
ABAP ,ocu and /+amles
:elp
i
7RITE
F1
Fe!*ord
,ocumentation
Fou -an lo-ate (ey+or' 'o-umentation *or an A8A statement by)
ointin7 to a statement an' sele-tin7 F to 7o 'ire-tly to t.e 'o-umentation *or t.e statement
Sele-tin7 +nformation to 7o to a sele-tion +in'o+ *or t.e various vie+s o* t.e (ey+or'
'o-umentation.
&.oose Help SAP Lirary ,( ,asis (omponents to a--ess e:tensive online 'o-umentation on
all t.e tools an' to,i-s t.at relate to t.e A8A #or(ben-..
SA A! "A#$0 C%26
SAP AG 2003
Inacti'e and Acti'e ,e'eloment 0b1ects
Pro"ram 12
inacti'e 'ersion
$a'ed2
)or de'eloment
and testin"
Acti'el! inte"rated2
)or s!stem4*ide
usa"e
Pro"ram #2
inacti'e 'ersion
Pro"ram 22
acti'e 'ersion
Pro"ram #2
acti'e 'ersion
Pro"ram 12
acti'e 'ersion
Acti'ate
#.enever you -reate a 'evelo,ment obHe-t0 or -.an7e an' t.en save it0 t.e system stores an inacti+e
+ersion only in t.e R/3 Re,ository.
8e*ore a Re,ository obHe-t is available on a system%+i'e basis0 it must *irst be available as an acti+e
+ersion. ".is a-tive version o* your ,ro7ram +ill be use' +.enever a user +ants to e:e-ute your
,ro7ram.
1* your ,ro7ram is available in bot. versions0 you -an s+it-. *rom one version to t.e ot.er in 'is,lay
mo'e.
#.enever you a-tivate a ,ro7ram0 t.e system *irst 'is,lays a list o* all ina-tive obHe-ts t.at you .ave
,ro-esse'. ".is is -alle' t.e *or'list. 1* you -ontinue to a-tivate t.e ,ro7ram0 t.e *ollo+in7
.a,,ens)
".e system saves t.e ,ro7ram0 t.at is0 it stores or over+rites t.e ina-tive version.
".e system ,er*orms a synta: -.e-(.
".e system stores t.e a-tive version or over+rites it.
SA A! "A#$0 C%2B
SAP AG 2003
%eneratin" 8untime 0b1ects
sa'ed2
)or de'eloment/testin"
acti'el! inte"rated2
)or s!stem4*ide usa"e
Pro"ram #2
inacti'e 'ersion
Pro"ram 12
acti'e 'ersion
Pro"ram 22
acti'e 'ersion
Pro"ram #2
acti'e 'ersion
For s!stem4*ide usa"e
Pro"ram Pro"ram #2 #2
"enerated 'ersion "enerated 'ersion
%enerate
(automaticall!)
Pro"ram Pro"ram #2 #2
temorar! temorar!
"enerated 'ersion "enerated 'ersion
%enerate
(automaticall!)
#.en you 7enerate a 'evelo,ment obHe-t0 t.e system -reates @-om,ilesA a se,arate runtime obHe-t
@63ADA an' stores it in t.e R/3 Re,ository.
".is 7enerate' version is t.en t.e version t.at is e:e-ute' @inter,rete'A.
!eneration ta(es ,la-e automati-ally0 but it -an be tri77ere' e:,li-itly.
1*0 *or e:am,le0 a user +ants to e:e-ute your ,ro7ram an' t.ere is still no 7enerate' version0 t.e
system +ill use t.e a-tive version *or 7eneration.
Fou -an0 .o+ever0 'etermine +.i-. version you +ant to e:e-ute)
"o e:e-ute t.e a-tive version0 start your ,ro7ram *rom t.e navi7ation area.
"o e:e-ute t.e ina-tive version0 test an e:e-utable ,ro7ram *rom t.e A8A 4'itor. ".e system
tem,orarily -reates a 7enerate' version.
1n t.is +ay0 'evelo,ment -an -ontinue *ithout chan.in. the current system status. All -.an7es to
t.e 'evelo,ment obHe-t be-ome visible system +i'e only +.en t.e ,ro7ram is a-tivate' a7ain. #it.
ina-tive versions0 you .ave a lo-al0 se,arate vie+ o* t.e R/3 Re,ository0 +.i-. ,rovi'es t.e basis *or
a local runtime system.
SA A! "A#$0 C%2C
SAP AG 2003
Creatin" Transaction Codes
$!stem $!stem 9el 9el
DBC@00C00C%$
!reate Report Transaction
Transaction code D00%$
,e'eloment class DBC@00C00
Transaction te+t
Pro"ram
&&&
&&&
DBC@00C00C%$
Classi)ication
Pro)essional 5ser Transaction
/as! Web transaction
&&&
&&&
1* you +ant to in-lu'e a ,ro7ram in role menus or in t.e Favorites in your SA 4asy A--ess menu0
you must assi7n a transa-tion -o'e to it.
1n t.e 3bHe-t 2avi7ator0 'is,lay t.e obHe-t list *or your ,ro7ram. Ri7.t%-li-( t.e ,ro7ram name an'
-.oose (reate %ransaction. &om,ly +it. t.e -ustomer names,a-e -onventions.
&.oose Program and Selection Screen 78eport %ransaction/ i* t.e ,ro7ram is an e:e-utable
,ro7ram"
3n t.e ne:t s-reen0 enter t.e name o* t.e ,ro7ram. &.oose Professional &ser %ransaction.
Save t.e transa-tion -o'e.
Sin-e ea-. transa-tion -o'e is a Re,ository obHe-t0 you must assi7n it to a 'evelo,ment -lass an' to a
-.an7e reEuest on t.e *ollo+in7 s-reens.
SA A! "A#$0 C%29
SAP AG 2003
$!stem $!stem 9el 9el
Addin" a Transaction Code to the
$AP /as! Access 6enu
Fa'orites
$AP 6enu
SAP Easy Access
0b1ect (a'i"ator
Add transaction
/nter Transaction 6anuall!
Transaction code
D00%$
"o in-lu'e a transa-tion -o'e in t.e your role menu *avorites)
Dis,lay t.e initial s-reen @SA 4asy A--ess menuA.
&.oose Favorites +nsert transaction.
4nter a transa-tion -o'e in t.e 'ialo7 bo: .
".e transa-tion -o'e s.ort te:t a,,ears un'er t.e Favorites no'e. Fou -an start t.e a,,ro,riate
,ro7ram *rom t.e -onte:t menu *or t.is ne+ no'e.
SA A! "A#$0 C%30
SAP AG 2003
,escribe the structure o) the 8/# 8eositor! and
its search tools
5se the 0b1ect (a'i"ator )or !our de'eloment
*ork
(ame and use the utilities )or orderl! so)t*are
de'eloment
Create de'eloment classes2 ABAP ro"rams2 and
transaction codes
;ou are no* able to3
Introduction to the ABAP Workbench3
5nit $ummar!
SA A! "A#$0 C%3$
A0A ;or'&ench !(ercises
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ 6r.ani9in. >e+elopments
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate a 'evelo,ment -lass
Assi7n -.an7es in Re,ository obHe-ts to a -.an7e reEuest
As a 'evelo,er *or an airline 7rou,0 you are 7iven t.e tas( o* 'evelo,in7
evaluation ,ro7rams *or several airline -om,anies.
"o 7rou, t.e Re,ository obHe-ts to7et.er lo7i-ally an' trans,ort t.em0
you must -reate a 'evelo,ment -lass.
9ser name) #ill be announ-e' by t.e instru-tor.
Develo,ment -lass) @'C())5AA
&.an7e reEuest) #ill be announ-e' by t.e instru-tor.
## stan's *or t.e t+o%'i7it 7rou, number.
$%$ 6o7 on to t.e o,eratin7 system an' t.en to t.e s,e-i*ie' SA R/3 trainin7 system usin7
t.e user name t.e instru-tor .as 7iven you. 4nter a ne+ ,ersonal ,ass+or'.
$%2 &reate t.e 'evelo,ment -lass @'C())5AA. Assi7n it to t.e -.an7e reEuest t.e
instru-tor .as 7iven you.
$%3 =rom no+ on0 assi7n all your Re,ository obHe-ts in t.e *ollo+in7 e:er-ises to t.is
'evelo,ment -lass an' t.is -.an7e reEuest.
SA A! "A#$0 C%32
!(ercises
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ >e+elopin. A0A ro.rams
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate0 e'it0 save0 an' ,ro-ess A8A ,ro7rams
&.e-( A8A ,ro7rams *or -orre-t synta:
"est an' a-tivate A8A ,ro7rams
&reate an A8A ,ro7ram t.at lists a''itional in*ormation on all e:istin7
*li7.t 'e,arture times.
!et t.e 'ata *rom t.e 'atabase table SFLIGHT.
ro7ram) @'C())5AA5GS5LIST
Mo'el solution) SAPBC400WBS_GS_LIST
## stan's *or t.e t+o%'i7it 7rou, number.
2%$ &reate t.e e:e-utable ,ro7ram @'C())5AA5GS5LIST
+it.out "3 1n-lu'e.
2%2 De*ine a +or( area *or t.e 'ata retrieval an' 'ata 'is,lay @name su77estion)
4%51l*/-$A)
DATA 4%51l*/-$ TYPE &1l*/-$.
2%3 ro7ram a loo, a--ess to all t.e 'ata re-or's in t.e 'atabase table SF8543T)
SELECT * FROM &1l*/-$
INTO 4%51l*/-$.
...
ENDSELECT.
2%4 For each "ata recor"0 'is,lay t.e -ontents o* t.e *iel's +%,,*80 +##*80 1l8%$e0
&e%$&++: an' &e%$&"%B in t.e list)
NE76LINE. 7RITE 4%51l*/-$6+%,,*8. 7RITE ...
2%5 &.e-( your ,ro7ram *or synta: errors0 test it0 an' a-tivate it
SA A! "A#$0 C%33
!(ercises
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ Transaction Co"es
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
Assi7n transa-tion -o'es to A8A ,ro7rams
A'' transa-tion -o'es to your =avorites list in t.e SA 4asy A--ess
menu
!ive your *irst A8A ,ro7ram a transa-tion -o'e0 in a''ition to its
te-.ni-al name0 +.i-. you use to e:e-ute it.
"ransa-tion -o'e) @'C())5AA5GS
ro7ram) @'C())5AA5GS5LIST
Mo'el solution) SAPBC400WBS_GS LIST
## stan's *or t.e t+o%'i7it 7rou, number.
3%$ &reate transa-tion -o'e @'C())5AA5GS *or t.e e:e-utable ,ro7ram
@'C())5AA5GS5LIST.
+nitial o4ect) program and selection screen 7report transaction/
4:e-ute your ,ro7ram by enterin7 t.e ne+ transa-tion -o'e.
3%2 1n-lu'e t.e transa-tion -o'e @'C())5AA5GS in your *avorites in t.e SA%4asy%
A--ess%menu.
4:e-ute your ,ro7ram by 'ouble%-li-(in7 t.e ne+ *avorite entry.
=rom no+ on0 it is best i* you al+ays +or( +it. t.e Ob*ect
+avigator. 1t ,rovi'es you +it. an overvie+ o* all Re,ository
obHe-ts in your 'evelo,ment -lass. =rom .ere0 you -an e'it ea-.
obHe-t 'ire-tly by sele-tin7 it *rom t.is list.
SA A! "A#$0 C%34
A0A ;or'&ench Solutions
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ 6r.ani9in. >e+elopments
$ =ollo+ t.e instru-tions as 7iven in t.e notes an' *i7ures on ,a7e 3%$C an' 3%$90
&reatin7 Develo,ment &lasses an' Assi7nment to a &.an7e ReEuest,
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ >e+elopin. A0A ro.rams
2 %o"el solution$
REPORT &%!2+())42&5/&5l*&$.
DATA 4%51l*/-$ TYPE &1l*/-$.
SELECT * FROM &1l*/-$
INTO 4%51l*/-$.
NE76LINE.
7RITE:
4%51l*/-$6+%,,*8:
4%51l*/-$6+##*8:
4%51l*/-$61l8%$e:
4%51l*/-$6&e%$&++:
4%51l*/-$6&e%$&"%B.
ENDSELECT.
SA A! "A#$0 C%35
/nit$ 5ntro"uction to the A0A ;or'&ench
Topic$ Transaction Co"es
3%$ =ollo+ t.e instru-tions as 7iven in t.e notes an' *i7ure on ,a7e 3%290 &reatin7
"ransa-tion &o'es.
3%2 =ollo+ t.e instru-tions as 7iven in t.e notes to t.e *i7ure0 A''in7 a "ransa-tion &o'e
to t.e SA 4asy A--ess Menu.
SA A! "A#$0 C%36
SAP AG 2003
$AP Fli"ht ,ata 6odel
Transarent Tables
$tructures
5sin" Transarent Tables and $tructures in an ABAP
Pro"ram
Contents3
Introduction to the ABAP ,ictionar!
SA A! "A#$0 9%$
SAP AG 2003
,escribe the $AP )li"ht data model
,escribe the structure o) a transarent table
,escribe the structure o) a structure
7ist the ossible uses o) transarent tables and
structures in ABAP ro"rams
At the conclusion o) this unit2 !ou *ill be able to3
Introduction to the ABAP ,ictionar!3
5nit 0b1ecti'es
SA A! "A#$0 9%2
SAP AG 2003
,ata 6odelin"
8eal *orld
,ata model
ABAP ,ictionar!
8elational
database
1n t.e 'evelo,ment o* business a,,li-ation so*t+are0 t.e real +orl' must be ,artly ma,,e' in t.e
*orm o* 'ata. An entity re,resents a business unit.
4ntities all relate to ea-. ot.er. ".e entities an' relations.i,s are -ontaine' in t.e 'ata mo'el or
entity relations.i, mo'el @4RMA.
".e -onversion o* t.e table 'e*initions an' t.eir relations.i,s in t.e A8A Di-tionary are base' on
t.is 'ata mo'el.
".e a-tual a,,li-ation 'ata is ,.ysi-ally store' in t.e 'atabase itsel*.
SA A! "A#$0 9%3
SAP AG 2003
,earture airort
,estination airort
,estination cit!
,earture cit!
T!ical in.uiries at the tra'el a"enc!3
$uitable airorts
$uitable )li"ht connections
$uitable )li"ht times
Additional )li"ht in)ormation such as3 rice2
a'ailabilit!
Fli"ht ,ata 6odel )or ABAP Trainin" Courses
A8A trainin7 -ourses0 online 'o-umentation0 an' A8A (ey+or' 'o-umentation all use t.e same
*li7.t 'ata mo'el. All Re,ository obHe-ts in t.e *li7.t 'ata mo'el are lo-ate' in t.e 'evelo,ment
-lass BC_DATAMODEL!
".is trainin7 -ourse 'emonstrates one sim,le e:-er,t *rom t.is 'ata mo'el0 +.i-. t.e instru-tor -an
re*ine i* ne-essary. 1* a ,erson +ants to travel *rom one ,la-e to anot.er0 s.e as(s t.e travel a7en-y
t.e *ollo+in7 Euestions)
#.at -onne-tion o**ers me t.e best an' most 'ire-t *li7.tP
At +.at times are *li7.ts o**ere' on t.e 'ate +.en 1 +ant to travelP
>o+ -an 1 o,timi<e t.e travel -on'itions to *in' t.e best solutionP #.at is t.e -.ea,est *li7.t0 t.e
*astest -onne-tion0 t.e -onne-tion t.at 7ets me t.ere -losest to t.e time +.en 1 +ant to arriveP
".e ,assen7erUs vie+ 'i**ers *rom t.at o* a travel a7en-y. 1n t.e 'ata mo'el0 +.i-. is tailore' to suit
mana7ement o* t.e ne-essary 'ata0 all 'ata is store'0 or7ani<e' by te-.ni-al -riteria0 in tables on a
-entral 'atabase. ".e amount o* 'ata store' *ar e:-ee's t.e 'eman's o* t.e ,assen7er.
As a ,ro7rammer0 you must be able to -om,ile t.e 'ata in ,ro7rams to suit t.e reEuirements o* t.e
travel a7ent.
SA A! "A#$0 9%4
SAP AG 2003
8elational ,ata 6odel
BCEP*A7/*% (
Timetable
BCECA..%E. (
Airline
Fli"ht
BCEBK%7G (
Fli"ht bookin"
9
9
9
8 8 BCEC%(A%.P (
Cit!4airort
assi"nment
Airort
BCEGEC%(C (
Cit!
A A
BCEC#S(M (
Customer
BCEC#7(E. (
$ales o))ice
BCEA%.P.( (
BCE(.A,*AG (
Tra'el a"enc!
8 C8 C8
BCES/*%G:( (
".e *li7.t 'ata mo'el -ontains entities *or all business in*ormation t.at is lo7i-ally -onne-te'0 su-.
as)
&ities
Air,orts
Airlines
=li7.ts
".ese entities all relate to ea-. ot.er in -ertain +ays)
4a-. *li7.t s-.e'ule -ontains e:a-tly one airline0 one 'e,arture air,ort0 an' one 'estination
air,ort.
8oo(able *li7.ts al+ays belon7 to e:a-tly one e:istin7 *li7.t s-.e'ule ea-..
Fou -an assi7n -ities to nearby air,orts.
Fou -an mana7e all ne-essary 'ata +it.out re'un'an-ies0 usin7 t.ese relations.i,s. At t.e same
time0 t.e travel a7en-y is able to obtain all 'ata reEueste' by t.e -ustomer.
SA A! "A#$0 9%5
SAP AG 2003
Con'ertin" 5sin" Transarent Tables
BCEP*A7/*% (
Timetable
BCECA..%E. (
Airline
BCES/*%G:( (
Fli"ht
BCEBK%7G (
Fli"ht bookin"
MA74( CA..%4 C77%4 /*4A(E BK%4 C#S(M%4 C#7(E. !!!
$B00F $B00F
MA74( CA..%4 C77%4 /*4A(E SEA(SMAM SEA(SCC !!!
$F7I%9T $F7I%9T
MA74( CA..%4 C77%4 A%.P/.M A%.P( 4EP(%ME !!!
$PF7I $PF7I
MA74( CA..%4 CA..7AME C#..C4E #.*
$CA88 $CA88
9
9
9
A trans,arent table -ontains 'i**erent -olumns0 to allo+ you to mana7e 'ata re-or's in a stru-ture'
+ay.
Fou 'e*ine trans,arent tables in t.e A8A Di-tionary. 1n t.is -onte:t0 t.e ta&le 'ey is es,e-ially
si7ni*i-ant.
".e table (ey o* a table com&ines (ey *iel's0 +.i-. are also -alle' primary 'ey #iel"s.
".e values in t.e (ey *iel's allo+ t.e system to i'enti*y all 'ata re-or's uni=uely.
=iel's t.at lin( to ot.er tables are -alle' #orei.n 'ey #iel"s. #it. t.ese *orei7n (ey relations.i,s you
-an mana7e t.e 'ata .ierar-.i-ally an' -onsistently.
SA A! "A#$0 9%6
SAP AG 2003
uses
uses
Table includin" data
Technical $tructure o) a Transarent Table
Transarent table Transarent table
,ata element
,omain
Field
Fou normally use a 'ata element to assi7n a ty,e to a table *iel'.
Semanti- ,ro,erties0 su-. as *iel' labels0 are store' in t.e 'ata element.
Fou normally use a 'omain *or t.e te-.ni-al ,ro,erties. ".e 'ata ty,e0 amon7 ot.er t.in7s0 is store'
in t.e 'omain.
".e A8A Di-tionary -ontains t.e ,lat*orm%in'e,en'ent 'es-ri,tion o* t.e relevant 'atabase table.
".e 'atabase table .as t.e same name as t.e trans,arent table in t.e A8A Di-tionary. ".e *iel's
also .ave t.e same names in bot. t.e 'atabase an' t.e A8A Di-tionary.
SA A! "A#$0 9%B
SAP AG 2003
Transarent Tables in the ABAP ,ictionar!
Table /dit %oto 5tilities /n'ironment $!stem 9el
Dictionary Display Table
Transparent table SPFLI Active
Indexes
Attributes
/+tras
Short text Flight schedule
Currency/Quantity Fields Fields
Fields Key Field type Data type Length Dec places Short text
!A"DT S#!A"DT Client $or training
CA%%ID S#CA%%#ID Airline Carrier
CL"T & '

C(A% & '


C)""ID S#C)""#ID Flight connection "*!C & +
C)*"T%,F% LA"D#- Country .ey C(A% & '
CIT,F%)! S#F%)!#CIT City o$ departure C(A% & /&
AI%0F%)! S#F%)!AI%0 Airport o$ departure C(A% & '
C)*"T%,T) LA"D#- Country .ey C(A% & '
CIT,T) S#T)#CIT, Arrival city C(A% & /&

".e #iel"s ma(e u, t.e -olumns o* t.e trans,arent table. A -.e-( mar( in t.e $ey -olumn in'i-ates
t.at t.e -orres,on'in7 *iel' is a (ey *iel'.
Fou normally assi7n a type to a *iel' usin7 a 'ata element @un'er Field typeA. ".e S*ort text store'
+it. t.e 'ata element is liste' .ere. ".e te-.ni-al attributes o* t.e *iel' are liste' a7ain un'er 'ata
type0 Lengt*0 an' 'ec" places. @A 'ata element normally uses a 'omain.A
".is is a lo.ical +ie* o* t.e table. 1t is a ,urely te-.ni-al 'es-ri,tion. #.en it is ,.ysi-ally
-onverte'0 t.e table is in t.e "ata&ase0 +.ere you also *in' t.e ta&le content or t.e a-tual
a,,li-ation 'ata.
SA A! "A#$0 9%C
SAP AG 2003
$tructures in the ABAP ,ictionar!
$tructure /dit %oto 5tilities /n'ironment $!stem 9el
Dictionary Display Structure
Structure SBC400FOCC Active
Attributes
/+tras
Short text Percentage Occupancy of Flights
1ntry help/chec. Co2ponents
Co2ponent Co2ponent type DTyp Length Dec places Short text
CA%%ID S#CA%%#ID Airline C(A% & '
C)""ID S#C)""#ID Flight connection "*!C & +
FLDAT1 S#DAT1 Flight date DATS & 3
S1ATS!A4 S#S1ATS!A4 !axi2u2 capacity I"T+ & -&
S1ATS)CC S#S1ATS!A4 )ccupied seats I"T+ & -&
01%C1"TA51 S#FL5(T)CC Flight )ccupancy D1C / 6
Currency/7uantity $ields
A *lat stru-ture is 'e*ine' in almost t.e same +ay as a trans,arent table0 e:-e,t t.at you -annot
-onvert *iel's to (ey *iel's. ".is +oul' be ,ointless *or stru-tures. Stru-tures 'o not re,resent a
'atabase table in t.e A8A Di-tionary0 but are a pure type "e#inition instea'.
#.en 'e*inin7 a *lat stru-ture0 .o+ever0 +e re*er to component an' component type as o,,ose' to
*iel' an' *iel' ty,e0 be-ause0 in -ontrast to trans,arent tables0 you -an 'e*ine -om,le: stru-tures.
".is means t.at0 it is ,ossible to store a stru-ture or substru-ture un'er a -om,onent name.
SA A! "A#$0 9%9
SAP AG 2003
5sin" %lobal $tructures )or ,ata 0b1ects
DATA 4%51++ TYPE &2+())1++.
TA'LES &!1l*.
PARAMETERS !%5+%,, TYPE &!1l*6+%,,*8.
TYPE &2+())1++ TYPE &2+())1++
&!1l* &!1l*
TYPE &!1l* TYPE &!1l*6 6+%,,*8 +%,,*8
waEfocc
carrid seatsma"
7 9 @ B 0
connid
@00
fldate
200112#1
seatsocc
1 P 0
percenta0e
@ 0
spfli
carrid cityfrom
A A (e* ;ork
connid
?@
countryfr
5$
airpfrom
JFF
mandt
@ 0 0
!!!
&&&
countryto
5$
paEcarr
7 9
A stru-ture is use' to -entrally ,rovi'e a 'ata type in +.i-. #iel"s #rom "i##erent ta&les are
compile".
1n t.e A8A ,ro7ram0 you -an 'e*ine 'ata o&<ects usin7 t.e @Di-tionaryA stru-ture.
A trans,arent table merely re,resents a te-.ni-al 'es-ri,tion in t.e A8A Di-tionary. ".ere*ore you
-an use it as a -entral 'ata ty,e 'e*inition0 as +it. a stru-ture. ".is means t.at0 similarly to t.e 'ata
obHe-t 'e*initions liste' above0 t.e *ollo+in7 variants are also ,ossible)
DATA 4%5&!1l* TYPE &!1l* ,rovi'es a 'ata obHe-t0 ty,e' li(e t.e line in t.e trans,arent table
SPFLI.
TA'LES &2+())1++ ,rovi'es a 'ata obHe-t0 ty,e' li(e t.e stru-ture SBC400FOCC.
PARAMETERS !%5+%,, TYPE &2+())1++6+%,,*8 ,rovi'es an in,ut *iel'0 ty,e' li(e t.e
CARRID -om,onent o* t.e stru-ture SBC400FOCC.
SA A! "A#$0 9%$0
SAP AG 2003
5sin" %lobal $tructures )or ,ialo"s
$hort descrition o) the
airline
('e field contains t'e %4 of t'e airline!
,ocumentation
Per)ormance Assistant
Airline
F1
$hort descrition &&&
%4
AA
AB
AC
A/
Inut hel
PARAMETERS !%5+%,,
TYPE &!1l*6+%,,*8.
TA'LES &!1l*.
,ict/Pro"ram )ields
Screen Painter
Airline
American Airlines
Air Berlin
Air Canada
Air /rance
1* you use an elementary stru-ture to 'e*ine an input #iel" on a sele-tion s-reen0 you -an use
semanti- attributes or te-.ni-al attributes. 3n reEuest0 t.e system automati-ally 7enerates a
"ocumentation "ialo. an' an input help "ialo. *or t.e user. ".e ne-essary in*ormation *or t.is is
ta(en *rom t.e A8A Di-tionary.
".e same a,,lies to *iel's o* trans,arent tables.
1* you use an elementary stru-ture -om,onent to assi7n a ty,e to an input:output #iel" on a s-reen0
you -an use t.e same attributes as +it. sele-tion s-reens.
1* you .ave 'e*ine' a *orei7n (ey relations.i,0 t.e resultin7 value -ombinations a,,ear in t.e in,ut
.el, on t.e s-reen. 1* an error o--urs0 t.e system ,ro-esses an automati- error "ialo..
".e same a,,lies to *iel's o* trans,arent tables.
9se t.e TA'LES statement to 'e*ine t.e 'ata obHe-t *or t.e 'ata trans,ort bet+een s-reen an'
,ro7ram.
SA A! "A#$0 9%$$
SAP AG 2003
,escribe the $AP )li"ht data model
,escribe the structure o) a transarent table
,escribe the structure o) a structure
7ist the ossible uses o) transarent tables and
structures in ABAP ro"rams
;ou are no* able to3
Introduction to the ABAP ,ictionar!3
5nit $ummar!
SA A! "A#$0 9%$2
A0A >ictionary !(ercises
/nit$ 5ntro"uction to the A0A >ictionary
Topic$ /sin. 4lo&al Structures
#or >ata 6&<ects an" >ialo.s
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
4stablis. t.e te-.ni-al names o* 'ata ty,es an' 'ata obHe-ts t.at are
use' in user 'ialo7s.
Run +.ere%use' lists +it.in an A8A ,ro7ram.
Fou .ave to e:amine a s,e-i*ie' A8A ,ro7ram to see +.et.er 7lobal
'ata ty,es are use' in it0 an' i* so0 +.i-. ones.
ro7ram) SAPBC400WBT_GETTING_STARTED
$%$ 3,en t.e obHe-t list *or 'evelo,ment -lass 8&400. =in' t.e ,ro7ram
SAP'C())7'T5GETTING5STARTED0 an' o,en its obHe-t list. ".rou7.out t.e
e:er-ise0 ma(e sure t.at you remain in "isplay mo"e.
$%2 Run t.e ,ro7ram to *in' out .o+ it +or(s.
$%3 ".ere is an in,ut *iel' on t.e sele-tion s-reen.
$%3%$ #.at in*ormation must you ,ass to t.e ,ro7ramP
@9se X=$J *or *iel' .el,.A
$%3%2 #.at values -an you enterP
@9se X=4J *or in,ut .el,.A
$%3%3 #.at in*ormation 'oes t.e ,ro7ram ,rovi'eP
$%3%4 #.at is t.e te-.ni-al name o* t.e in,ut *iel'P
@9se t.e %ec*nical information in X=$J *iel' .el,.A
SA A! "A#$0 9%$3
$%4 "+o 'is,lay *iel's a,,ear on t.e s-reen.
$%4%$ =in' out t.e s-reen number.
@&.oose System Status.A
$%4%2 #.at in*ormation is 'is,laye'P
@9se X=$J*iel' .el,.A
$%4%3 #.at are t.e te-.ni-al names o* t.e 'is,lay *iel'sP Do t.e *iel's belon7 to a
stru-ture +it. a 7lobally 'e*ine' ty,eP
@9se t.e %ec*nical information in X=$J *iel' .el,.A
$%5 9se t.e obHe-t list to analy<e t.e sour-e -o'e o* t.e ,ro7ram.
$%5%$ #.at 'ata obHe-ts are t.ereP #.ere are t.ey 'e*ine' in t.e ,ro7ramP
$%5%2 #.ere in t.e ,ro7ram are t.ey use'P
@9se t.e +.ere%use' list in t.e A8A 4'itor.A
$%5%3 #.at 'ata obHe-t -orres,on's to t.e in,ut *iel' on t.e sele-tion s-reenP
@Sear-. t.e obHe-t list *or a 'ata obHe-t +it. t.e same name as t.e *iel' t.at you
*oun' in ste, $%3%4.A
SA A! "A#$0 9%$4
A0A >ictionary Solutions
/nit$ 5ntro"uction to the A0A >ictionary
Topic$ /sin. 4lo&al Structures
#or >ata 6&<ects an" >ialo.s
$%3 Analy<in7 by e:e-utin7 a ,ro7ram)
$%3%$ Fou nee' to enter an airline -o'e.
$%3%2 ".e values ,ermitte' .ere 'e,en' on t.e -ontents o* 'atabase table SCARR.
$%3%3 ".e ,ro7ram 'is,lays 'etaile' in*ormation on t.e airline sele-te'. ".is
in*ormation is *irst 'is,laye' on a s-reen an' t.en as a list.
$%3%4 ".e te-.ni-al name o* t.e in,ut *iel' is !%5+%,.
$%4 Analy<in7 by e:e-utin7 a ,ro7ram)
$%4%$ ".e s-reen number is ?)).
$%4%2 ".e system a7ain 'is,lays t.e airline -o'e an' t.e -urren-y -o'e.
$%4%3 ".e out,ut *iel's are &2+())5+%,,*e,6+%,,*8 an' &2+())5+%,,*e,6
+0,,+8e. Double%-li-( in t.e Structure *iel' to 7o to t.e A8A Di-tionary
an' analy<e t.e 7lobal ty,e more -losely.
$%5 Analy<in7 usin7 t.e ,ro7ramYs obHe-t list)
$%5%$ ".e ,ro7ram .as t.e stru-tures &2+())5+%,,*e, an' 4%5&+%,, an' t.e
elementary 'ata obHe-t !%5+%,.
$%5%2 ".e elementary 'ata obHe-t !%5+%, belon7s to t.e in,ut *iel'0 +it. t.e same
name0 on t.e sele-tion s-reen.
SA A! "A#$0 9%$5
SAP AG 2003
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith Internal Tables
Contents3
Basic ABAP 7an"ua"e /lements
SA A! "A#$0 $0%$
SAP AG 2003
,e)ine elementar! and structured data ob1ects
5se basic ABAP statements
/+ecute and anal!Ee ro"rams in debu""in"
mode
At the conclusion o) this unit2 !ou *ill be able to3
Basic ABAP 7an"ua"e /lements3 5nit 0b1ecti'es
SA A! "A#$0 $0%2
SAP AG 2003
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith $tructures
Workin" *ith Internal Tables
Workin" *ith Internal Tables
SA A! "A#$0 $0%3
SAP AG 2003
5sin" ,ata T!es
ABAP ro"ram
$ubroutine
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n

m
o
d
u
l
e
0b1ect
6ethod
Inter)ace
Inter)ace
,ata t!es describe the attributes o)3
Q Inut / outut )ields
Q ,ata ob1ects
&&& Inter)ace arameters &&& Inter)ace arameters Q Inter)ace arameters
".e ty,e o* a 'ata obHe-t 'e*ines its te-.ni-al attributes.
".e ty,e o* an inter*a-e ,arameter 'e*ines t.e ty,e o* t.e values @a-tual ,arametersA t.at are
trans*erre' +.en t.e mo'ulari<ation unit is -alle'.
1n a''ition to t.e te-.ni-al attributes0 t.e ty,e o* an in,ut or out,ut *iel' -an ,rovi'e *urt.er
in*ormationI *or e:am,le0 you -an use it to -ontrol t.e value or in,ut .el,.
SA A! "A#$0 $0%4
SAP AG 2003
7ocal and %lobal ,ata T!es
ABAP ro"ram
$ubroutine
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n

m
o
d
u
l
e
0b1ect
6ethod
Inter)ace
Inter)ace
ABAP
,ictionar!
7ocal data t!es3 Technical
attributes onl!
Central data t!es3 Technical and
semantic attributes
Fou -an 'e*ine 'ata ty,es in an A8A ,ro7ram @lo-al0 (ey+or' TYPESA or in t.e A8A Di-tionary
@7lobalA. 9sin7 7lobal 'ata ty,es .as several a'vanta7es)
!lobal ty,es are mana.e" centrally an' you -an use t.em in all re,ository obHe-ts. ".is in-reases
t.e -onsisten-y o* t.e system an' si7ni*i-antly re'u-es t.e amount o* maintenan-e.
1n t.e A8A Di-tionary0 you -an ,er*orm an environment analysis @w*ere-used listA.
!lobal 'ata ty,es -an be lin(e' to business variables by -ontent0 an' t.ere*ore -ontain semanti- an'
te-.ni-al in*ormation.
Fou -an use 7lobal 'atat ty,es to 'esi7n s-reens.
#.en sear-.in7 *or 7lobal 'ata ty,es0 ma(e sure you ta(e bot. t.e te-.ni-al an' semanti- attributes
into a--ount. 3nly t.en +ill you be able to ma(e *ull use o* t.e maintenan-e an' robustness
a'vanta7es o* your ,ro7ram.
SA A! "A#$0 $0%5
SAP AG 2003
,e)inin" ,ata 0b1ects
Prede)ined
ABAP t!es
B
7ocal t!es
*
1
&$,*#/
B&$,*#/
$
8
%lobal
t!es
+
#
!
TYPES $.!e5#%"e TYPE ...
DATA 85#%"e TYPE $.!e5#%"e. DATA DATA
DATA 85#%"e5#e4 LICE 85#%"e. DATA DATA
Fou -an use a ,re'e*ine' A8A ty,e0 a lo-al0 or a 7lobal ty,e to ty,e a 'ata obHe-t.
".e *ollo+in7 ,re'e*ine' A8A ty,es are -om,lete)
8 >ate @*ormat) ????%%>>A
$ Time @*ormat) 33%%SSA
* 5nte7er
1 Floatin7 ,oint number
&$,*#/ Strin7 @o* variable len7t.A
B&$,*#/ 8yte seEuen-e @.e@a'e-imal strin70 o* variable len7t.A
Fou must 'e*ine t.e len7t. *or t.ese ,re'e*ine' ty,es)
+ C.ara-ter
# -umeri- -.ara-ter
B 8yte @.e@a'e-imalA
! a-(e' number @W binary -o'e' 'e-imalsA. Fou must enter t.e number o* 'e-imal
,la-es.
=or more in*ormation on ,re'e*ine' A8A ty,es0 re*er to t.e (ey+or' 'o-umentation on TYPES or
DATA.
Fou -an use LIKE to re*er to t.e ty,e o* a ,re'e*ine' 'ata obHe-t.
SA A! "A#$0 $0%6
SAP AG 2003
,e)inin" /lementar! ,ata 0b1ects
S5CARR5ID
,ata
element
TYPES $5!e,+e#$%/eD3E TYPE ! DECIMALS 2.
DATA: #0"2e, TYPE * >ALUE ?F:
!e,+e#$%/e TYPE $5!e,+e#$%/e:
+%,,*8 TYPE &5+%,,5*8:
+##*8 TYPE &2+())1++6+##*8.
num$er
percenta0e
carrid
L
connid
S'C())FOCC
$tructure
39
".e ,re'e*ine' A8A ty,es @80 $0 *0 10 &$,*#/0 an' B&$,*#/A are -om,lete. ".is means t.ey
-an 'e*ine an elementary 'ata obHe-t o* t.ese ty,es as *ollo+s)
DATA do_name TYPE pede!"ned_ABAP_#$pe%
=or t.e ,re'e*ine' A8A ty,es -0 n0 ,0 an' :0 you must 'e*ine t.e len7t.. ".is means you s.oul'
*irst 'e*ine an elementary ty,e)
"F4S ty,eOname@len7t.A "F4 ,re'e*ine'OA8AOty,e.
Fou use it to 'e*ine t.e 'ata obHe-t)
DA"A 'oOname "F4 ty,eOname.
=or ty,e ,0 you -an also 'e*ine t.e number o* 'e-imal ,la-es usin7 t.e D4&1MA6S a''ition.
Fou -an use t.e ;A694 a''ition to ,re%assi7n t.e value o* an elementary 'ata obHe-t.
=or -om,atibility reasons0 you -an still -onstru-t 'ata obHe-ts in t.e DA"A statement +it.out *irst
.avin7 to 'e*ine t.e ty,e lo-ally in t.e ,ro7ram +it. a "F4S statement.
1n t.e -ase o* in-om,letely ,re'e*ine' A8A ty,es0 t.e system a''s stan'ar' values to ma(e u, t.e
missin7 ty,e in*ormation.
1* t.ere is no ty,e s,e-i*i-ation at all0 t.e system 'e*ines a ty,e - 'ata obHe-t +it. a len7t. o* one.=or
t.e stan'ar' len7t.s an' *or more in*ormation0 re*er to t.e (ey+or' 'o-umentation *or "F4S an'
DA"A.
".e same synta: a,,lies to 7lobal ty,es as to user%'e*ine' ty,es)
DA"A 'oOname TYPE &'o(a'_#$pe_name
SA A! "A#$0 $0%B
SAP AG 2003
Fi+ed ,ata 0b1ects
7iteral3 7iteral3
Constant3 Constant3 Fi+ed data ob1ect *ith I, code
Fi+ed data ob1ect *ithout I, code
(umeric literal3
Positi'e inte"ers3 12#
(e"ati'e inte"ers3 412#
(umeric literal3 T!e i or (umeric literal3 T!e i or
Te+t literal
Character strin"3 :aBcd/:
,ecimal numbers3 :12#&@B:
Floatin" oint numbers3 :12#&@B/01:
Te+t literal3 T!e c Te+t literal3 T!e c
CONSTANTS +#&$5#%"e TYPE $.!e5#%"e >ALUE G l*$e,%l H IS INITIAL I. CONSTANTS CONSTANTS
Fou assi7n a value to ea-. *i:e' 'ata obHe-t in t.e sour-e -o'e. ".ere*ore0 it -annot be -.an7e' at
run time.
Fou -an use literals to trans*er *i:e' values to A8A statements. ".ere are numeri- literals an' te:t
literals. ".e latter are al+ays en-lose' in inverte' -ommas)
Fou -an 'is,lay inte7ers as numeric literals @in t.e -ase o* ne7ative numbers0 +it. a ,re-e'in7
si7nA. ".e system t.en ma,s t.em onto t.e 'ata ty,e i0 i* t.ey are +it.in t.e value ran7e o* 4%
byte inte7ers. >i7.er numeri- literals are ma,,e' onto 'ata ty,e !.
Fou must 'is,lay all ot.er literals @su-. as -.ara-ter sets0 numbers +it. 'e-imal ,la-es0 *loatin7
,oint numbersA as te(t literals. ".ey are ma,,e' onto 'ata ty,e + an' -onverte' later0 i*
ne-essary.
1* you +ant to in-lu'e an inverte' -omma in a te:t literal0 you must enter it t+i-e.
Fou 'e*ine -onstants usin7 t.e CONSTANTS statement. ".eir ty,e is 'e*ine' similarly to t.e ty,e o*
an elementary 'ata obHe-t +it. t.e DATA statement. ".e )AL*E a''ition is reEuire' *or -onstants
Recommen"ation$ Avoi' literals +.en usin7 statements. &reate -onstants instea'. ".is si7ni*i-antly
im,roves ,ro7ram maintenan-e.
SA A! "A#$0 $0%C
SAP AG 2003
Basic ABAP $tatements
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith $tructures
Workin" *ith Internal Tables
Workin" *ith Internal Tables
SA A! "A#$0 $0%9
SAP AG 2003
Halue Assi"nments
ABAP runtime s!stem
MO>E +5J1 TO +%,,*8?.
+%,,*82 ; +%,,*8?.
ADD ? TO +0#$e,.
CLEAR: +%,,*8?:
+%,,*82:
+0#$e,.
Time
CONSTANTS +5J1 TYPE &5+%,,5*8 >ALUE <QF<.
DATA: +%,,*8? TYPE &5+%,,5*8:
+%,,*82 TYPE &5+%,,5*8 >ALUE <LH<:
+0#$e, TYPE *.
Pro"ram start Pro"ram start
,ata declarations
MO>E MO>E
CLEAR CLEAR
cEGf
N/
carrid3 carrid2
*:
counter
0
ABAP ro"ram
N/ *: 0
N/ N/ 0
N/ N/ 3
0
#.en a ,ro7ram is starte'0 t.e ,ro7ram -onte:t is loa'e' into a stora7e area o* t.e a,,li-ation server
an' ma'e available *or all t.e 'ata obHe-ts.
4very elementary 'ata obHe-t is ,reassi7ne' t.e ty,e%relate' initial value0 e:-e,t i* you ,reassi7ne' a
'i**erent value usin7 t.e )AL*E a''ition.
Fou -an use t.e MO)E statement to -o,y t.e -ontents o* 'ata obHe-ts. "+o statements are available
*or t.is ,ur,ose)
MO)E +o,-e TO #a&e#.
#a&e# ; +o,-e.
1* t.e t+o 'ata obHe-ts .ave 'i**erent ty,es0 t.e ty,e is automati-ally -onverte' i* t.ere is a
-onversion rule.
=or 'etaile' in*ormation about -o,yin7 an' t.e -onversion rules0 re*er to t.e (ey+or' 'o-umentation
*or t.e MO)E statement.
".e CLEAR statement resets t.e -ontents o* a 'ata obHe-t to t.e ty,e%relate' initial value. =or
'etaile' in*ormation about t.e initial values *or a ,arti-ular ty,e0 re*er to t.e (ey+or' 'o-umentation
*or t.e CLEAR statement.
SA A! "A#$0 $0%$0
SAP AG 2003
Calculations
COMPUTE !e,+e#$%/e ; ++ * ?)) / "%B.
DATA: "%B TYPE &2+())1++6&e%$&"%B:
++ TYPE &2+())1++6&e%$&++:
!e,+e#$%/e TYPE &2+())1++6!e,+e#$%/e.
,ata declarations
COMPUTE COMPUTE
The ke!*ord is otional3
!e,+e#$%/e ; ++ * ?)) / "%B.
ABAP ro"ram
* * / /
1n A8A you -an ,ro7ram arithmetic e(pressions neste" to any 'e,t.. 2ote t.at ,arent.eses an'
o,erators are (ey+or's an' must be se,arate' by at least one blan( -.ara-ter.
".e *ollo+in7 are vali' o,erators)
K A''ition
6 Subtra-tion
* Multi,li-ation
/ Division
** o+er
DI> 1nte7er 'ivision +it.out remain'er
MOD 1nte7er 'ivision +it. remain'er
".ere are several *un-tions *or 'i**erent 'ata ty,es in t.e A8A runtime environment.
=or e:am,le0 t.e *ollo+in7 statement returns t.e -urrent len7t. o* t.e -ontents o* a -.ara-ter set)
le#/$- ; STRLEND +*$.1," E.
#it. *un-tions t.e o,enin7 ,arent.esis is ,art o* t.e 1D. ".e rest must a7ain be se,arate' by at least
one s,a-e.
1n 7eneral0 t.e usual al7ebrai- rules a,,ly *or t.e processin. se=uence) e:,ressions in ,arent.eses
-ome *irst0 t.en ,o+ers0 t.en multi,li-ation/'ivision0 an' *inally a''ition/subtra-tion.
=or 'etaile' in*ormation about t.e available o,erations an' *un-tions0 re*er to t.e (ey+or'
'o-umentation *or COMP*TE..
SA A! "A#$0 $0%$$
SAP AG 2003
CASE 8%$%523e+$5?.
7HEN 8%$%523e+$52.
7HEN 8%$%523e+$53 OR 8%$%523e+$5(.
7HEN OTHERS.
ENDCASE.
$tatements
$tatements
$tatements
IF Ll/*+%l5eB!,e&&*#M.
ELSEIF Ll/*+%l5eB!,e&&*#M.
ELSE.
ENDIF.
$tatements
$tatements
$tatements
Conditional Branchin"
CASE CASE
7HEN 7HEN
7HEN 7HEN
7HEN OTHERS 7HEN OTHERS
ENDCASE ENDCASE
IF IF
ELSEIF ELSEIF
ELSE ELSE
ENDIF ENDIF
OR OR
1n A8A you .ave t+o +ays to e:e-ute 'i**erent seEuen-es o* statements0 'e,en'in7 on -ertain
-on'itions.
#it. t.e &AS4%42D&AS4 -onstru-tion t.e -riterion *or t.e e:e-ution o* a statement blo-( is t.e
similarity o* t.e 'ata obHe-ts. 1* no -om,arison is su--ess*ul0 t.en t.e system e:e-utes t.e 3">4RS
bran-.0 i* it is available.
4:-e,t *or t.e *irst #>42 bran-.0 all *urt.er a''itions are o,tional.
#it. t.e 1=%42D1= -onstru-tion0 you -an use any lo7i-al e:,ressions. 1* t.e -on'ition is met0 t.e
system e:e-utes t.e relevant statement seEuen-e. 1* no -om,arison is su--ess*ul0 t.en t.e system
e:e-utes t.e OTHERS bran-.0 i* it is available. 4:-e,t *or t.e *irst Euery0 all *urt.er bran-.es are
o,tional.
=or bot. -onstru-tions0 t.e system e:e-utes only one statement seEuen-e an' al+ays *or t.e #irst
+ali" -ase.
Recommen"ation)
1*0 in every -on'ition0 you -.e-( t.at a variable is eEual to a 7iven value0 use t.e CASE.ENDCASE
-onstru-tion. 1t is -learer an' less runtime intensive.
3utsi'e o* loo,s you -an also use C/ECK instea' o* IF. ".is Euery sets t.e e:e-ution o* all
statements up to the en" o# the current processin. &loc' un'er one -on'ition. 1* t.is is
unsu--ess*ul0 t.e system -ontinues +it. t.e *irst statement in t.e ne:t ,ro-essin7 blo-(.
SA A! "A#$0 $0%$2
SAP AG 2003
7oos
DO G # TIMES I G...I.
ENDDO.
7HILE Ll/*+%l5eB!,e&&*#M.
END7HILE.
LOOP AT ...
ENDLOOP.
SELECT ...
ENDSELECT.
DO.
IF L%2,$5+#8*$*#M.
EXIT.
ENDIF.
ENDDO.
7oo counter3
s!4inde+
7oo counter3
&.6*#8eB
$tatements
$tatements
$tatements
$tatements
$tatements
1n A8A t.ere are *our loo, -onstru-tions0 +.ereby LOOP6ENDLOOP an' SELECT6ENDSELECT
re,resent s,e-ial -ases. 1n t.e DO an' 7HILE loo,s0 t.e system stores t.e number o* t.e -urrent loo,
,ass in t.e +$."nde0 *iel'. 1* t.ese loo,s are neste'0 +$."nde0 -ontains t.e number o* t.e
-urrent @t.at is0 innerA loo,.
/ncon"itional:in"e( controlle" loops
".e statements bet+een DO an' ENDDO are e:e-ute' until t.e loo, is le*t over ot.er statements. Fou
also .ave t.e o,tion o* s,e-i*yin7 t.e ma:imum number o* loo, ,assesI ot.er+ise0 you may 7et an
en'less loo,.
3ea"er controlle" loops
".e statements bet+een 7HILE an' END7HILE are e:e-ute' only i* t.e -on'ition
1'o&"-a'_e0pe++"on2 .as been met.
Fou -an use t.e statements CHECC an' EXIT *or 'i**erent e**e-ts on t.e +ay t.e loo, is ,ro-esse'.
=or e:am,le0 you -an -onstru-t a #ooter)controlle" loo,.
SA A! "A#$0 $0%$3
SAP AG 2003
,ialo" 6essa"es
MESSAGE #nnnDme++a&e_-'a++E G 7ITH 34 G 35 I G 36 I G 34 I I.
T!e
$
Beha'ior 6essa"e aears in
&
*
4
e
%
B
Pro"ram continues *ithout
interrution
Pro"ram continues a)ter
interrution
Conte+t deendent
Conte+t deendent
Pro"ram aborted
8untime error MESSAGE5TYPE5X
is tri""ered
$tatus line in ne+t screen
6odal dialo" bo+
$tatus bar
$tatus bar
6odal dialo" bo+
$hort dum
6eanin"
$tatus messa"e
In)ormation
Warnin"
/rror
Termination
$hort dum
Fou -an use t.e MESSAGE statement to sen' 'ialo7 messa7es. Fou must s,e-i*y t.e t.ree%'i7it
messa7e number an' t.e messa7e -lass.
=urt.ermore0 you -an use t.e 7ITH a''ition to in-lu'e u, to *our values. ".e system0 'e,en'in7 on
t.e messa7e te:t0 inserts t.ese values into t.e messa7e te:t.
Fou -ontrol t.e 'ialo7 be.avior usin7 t.e ty,e abbreviation StT. ".ere are si: 'i**erent ty,es o*
messa7e)
% Abort ".e ,ro7ram is en'e' a*ter a 'ialo7 bo:.
B 4(it ".e ,ro7ram en's in a s.ort 'um,.
e !rror Runtime be.avior is -onte:t 'e,en'ent.
4 ;arnin7 Runtime be.avior is -onte:t 'e,en'ent.
* 5n*ormation ".e ,ro7ram -ontinues a*ter a 'ialo7 bo:.
& Su--ess".e messa7e a,,ears in t.e status bar on t.e subseEuent s-reen.
=or *urt.er in*ormation about t.e synta-ti- alternatives o* t.e MESSAGE statement0 re*er to t.e
(ey+or' 'o-umentation.
SA A! "A#$0 $0%$4
SAP AG 2003
8untime Beha'ior o) ,ialo" 6essa"es
/ditor 9el
ABAP 0'er'ie*
ABAP Term
ABAP (e*s
ABAP ,ocu and /+amles
:elp
i
ABAP ,ocumentation and /+amles
A
A
A
A
A
BC 4 ABAP Pro"rammin"
ABAP Introduction
ABAP Pro"rammin" 7an"ua"e
ABAP 5ser ,ialo"s
$creens
$election $creens
7ists
6essa"es
$imle e+amle )or messa"es
,emonstration )or all messa"e t!es
&&&
A
A
A
A
De,en'in7 on t.e -onte:t in +.i-. t.ey a,,ear0 some messa7e ty,es s.o+ 'i**erent 'ialo7 be.avior.
Fou -an *in' a ,ro7ram *or testin7 t.e resultin7 o,tions in t.e A8A 'o-umentation. "o a--ess
t.ese e:am,le ,ro7rams0 -.oose &tilities Help onA,AP doc" and examples @in t.e *ollo+in7
'ialo7 bo:A
SA A! "A#$0 $0%$5
SAP AG 2003
5sin" the ABAP ,ebu""er
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith $tructures
Workin" *ith Internal Tables
Workin" *ith Internal Tables
SA A! "A#$0 $0%$6
SAP AG 2003
/+ecutin" a Pro"ram in ,ebu""in" 6ode
Pro"ram
DBC@00C00C%$
DBC@00C00C%$
REPORT &%!2+())42$5/e$$*#/5&$%,$e8.
TA'LES &2+())5+%,,*e,.
DATA 4%5&+%,, TYPE &+%,,.
PARAMETERS !%5+%, TYPE &+%,,6+%,,*8.
START6OF6SELECTION.
SELECT SINGLE * FROM &+%,,
INTO CORRESPONDING
7HERE +%,,*8 ; !%5+%,.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&+%,, TO &2+(
CALL SCREEN ?)).
MO>E6CORRESPONDING &2+())5+%,,*e, T
7RITE:/ 4%5&+%,,6+%,,*8:
4%5&+%,,6+%,,#%"e:
/+ecute
,ebu""in"
5se the conte+t menu
0r3
$et a breakoint and
e+ecute the ro"ram
Fou -an start a ,ro7ram in Debu77in7 mo'e *rom t.e 3bHe-t 2avi7ator0 +it.out .avin7 to -.an7e
t.e ,ro7ram in t+o +ays)
1n t.e navi7ation area0 -.oose Execute 'eugging *or t.e sele-te' ,ro7ram.
1n t.e e'itin7 area0 sele-t t.e 'esire' ,ro7ram line an' -.oose Set9delete rea-point.
".en start t.e ,ro7ram by -.oosin7 Execute 'irect processing @=CA
SA A! "A#$0 $0%$B
SAP AG 2003
$*itchin" to ,ebu""in" 6ode at 8untime
/h
$!stem 9el $!stem 9el
5tilities ,ebu" screen
,ebu" ABAP
/nter R/hS into the command
)ield and then select T/nterU
0r3
Choose menu Syste#
1* you +ant to 'ebu7 only -ertain ,arts o* a ,ro7ram0 start t.e ,ro7ram *irst an' t.en s+it-. to
'ebu77in7 mo'e be*ore a s-reen -.an7e. Fou -an 'o t.is in t+o +ays)
&.oose SystemZ 9tilitiesZ Debu7 A8A or Debu7 s-reen.
4nter /- in t.e -omman' *iel' an' sele-t Enter.
SA A! "A#$0 $0%$C
SAP AG 2003
,ebu""in" 6ode3 $in"le $te and Field Contents
/ield 7ame
FIIE/.MS
3 @
+ /ield ,alue

SELECT SINGLE * FROM &+%,,


INTO CORRESPONDING FIELDS OF 4%5&+%,,
7HERE +%,,*8 ; !%5+%,,.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&+%,, TO &2+())5+%,,*e,.
CALL SCREEN ?)).
MO>E6CORRESPONDING &2+())5+%,,*e, TO 4%5&+%,,.
/i"ed point arit'metic
3> 30 +

M
$AP
;atc'point
A.AP Debugger

ch*s ch*s
r
SC+S#B.C SC+(AB%M SC+4BC7( 0 0 3
,ouble4click the
data ob1ect
aCcarr 79
Current statement
$in"le ste
1n 'ebu77in7 mo'e0 you -an -.oose Single step to e:e-ute t.e ,ro7ram statement by statement.
Fou -an 'is,lay t.e -ontents o* u, to ei7.t 'ata obHe-ts. 4nter t.e names in t.e le*t in,ut *iel' or
'ouble%-li-( t.e name in t.e 'is,laye' sour-e -o'e.
SA A! "A#$0 $0%$9
SAP AG 2003
,ebu""in" 6ode3 Breakoints
,ariant 3 @
+
,ariant
SELECT SINGLE * FROM &+%,,
INTO CORRESPONDING FIELDS OF 4%5&+%,,
7HERE +%,,*8 ; !%5+%,,.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&+%,, TO &2+())5+%,,*e,.
CALL SCREEN ?)).
MO>E6CORRESPONDING &2+())5+%,,*e, TO 4%5&+%,,.
/i"ed point arit'metic
3> 30 +

M
$AP
;atc'point
A.AP Debugger

ch*s ch*s

SC+S#B.C SC+(AB%M SC+4BC7( 0 0 3


Continue
"o set a brea(,oint0 'ouble%-li-( in *ront o* a line o* sour-e -o'e.
"o set a brea(,oint *or a s,e-i*i- A8A statement0 -.oose) [[8rea(,ointZ[8rea(,oint atZ Statement.
1* you -.oose &ontinue0 t.e ,ro7ram is e:e-ute' u, to t.e ne:t brea(,oint.
1* you Save t.e brea(,oints0 t.ey remain inta-t +.ile you are lo77e' on to t.e system.
#it. brea(,oints0 t.e A8A #or(ben-. s+it-.es to 'ebu77in7 mo'e only *or t.e 'evelo,er +.o set
t.e brea(,oints. All ot.er users -an e:e-ute t.e ,ro7ram 'ire-tly or set t.eir o+n brea(,oints
SA A! "A#$0 $0%20
SAP AG 2003
,ebu""in" 6ode3 Tracin" ,ata Chan"es
Watchoint
Create/Chan"e Watchoint
7ocal *atchoint (onl! in seci)ied ro"ram)
Pro"ram
Field name
8elational oerator
Com& )ield/'alue
Comarison )ield (Comarison 'alue i) not selected)
!%5+%,,
;
LH
1
2
#
&&&
10
08 A(,
aCcarr
79 <
(o& 7ocal Pro"ram Field name Field 0erator Com& )ield/'alue
7o"ical oerator bet*een *atchoints
Watchoints
#at-.,oints are brea(,oints t.at 'e,en' on t.e *iel' -ontent. Fou -an -reate t.e *ollo+in7 ty,es o*
+at-.,oints)
Fiel" name$
".e ,ro7ram is e:e-ute' until t.e -ontent o* t.e *iel' .as -.an7e'.
Fiel" nameA relational operatorA comparison +alue$
".e ,ro7ram is e:e-ute' until t.e -ontent o* t.e *iel' .as -.an7e' so t.at t.e 'e*ine' lo7i-al
-on'ition0 relative to a value0 is met.
Fiel" nameA relational operatorA comparison +alue$
".e ,ro7ram is e:e-ute' until t.e -ontent o* t.e *iel' .as -.an7e' so t.at t.e 'e*ine' lo7i-al
-on'ition0 relative to t.e -ontent o* a *iel'0 is met.
Fou -an set u, to $0 +at-.,oints an' lin( t.em usin7 t.e lo7i-al o,erators AND or OR.
SA A! "A#$0 $0%2$
SAP AG 2003
Workin" *ith $tructures
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith $tructures
Workin" *ith Internal Tables
Workin" *ith Internal Tables
SA A! "A#$0 $0%22
SAP AG 2003
,e)inition o) $tructures *ith %lobal T!es
DATA 4%51++ TYPE &2+())1++.
TA'LES &!1l*.
DATA DATA
TA'LES TA'LES
waEfocc
carrid seatsma" connid fldate seatsocc percenta0e
spfli
carrid cityfrom connid countryfr airpfrom mandt !!! countryto
S'C())FOCC
$tructure
SPFLI
Transarent
table
1n A8A0 you -an 'e*ine stru-ture' 'ata obHe-ts @sim,ly -alle' stru-turesA. ".is allo+s you to
-ombine values t.at belon7 to7et.er lo7i-ally into one obHe-t.
Stru-tures -an be neste'. ".is means t.at -om,onents -an -onsist o* more stru-tures or even tables.
".ere are t+o +ays to 'e*ine stru-tures)
=or DATA +#,-_name TYPE +#,-_#$pe7 you -an use local or .lo&al #$pe+
+#,-_#$pe.
TA'LES &'o(a'_+#,-_#$pe 'e*ines a stru-ture t.at is te-.ni-ally mana7e' in a s,e-ial
memory area. 1t .as t.e same name as t.e 7lobal stru-ture0 &'o(a'_+#,-_#$pe.
=or t.is variant0 t.e 7lobal stru-ture must be *lat0 t.at is0 all -om,onents must .ave an
elementary ty,e. Sin-e Release 4.00 TABLES stru-tures serve only as inter*a-es *or s-reen
*iel's..
SA A! "A#$0 $0%23
SAP AG 2003
,e)inition o) $tructures *ith 7ocal T!es
TYPES: 'EGIN OF &$51l*/-$*#1:
+%,,*8 TYPE &5+%,,5*8:
+##*8 TYPE &5+##5*8:
1l8%$e TYPE &58%$e:
&e%$&"%B TYPE &1l*/-$6&e%$&"%B:
&e%$&++ TYPE &1l*/-$6&e%$&++:
!e,+e#$%/eD3E TYPE ! DECIMALS 2:
END OF &$51l*/-$*#1 .
DATA 4%51l*/-$*#1 TYPE &$51l*/-$*#1.
'EGIN OF 'EGIN OF
waEfli0'tinfo
carrid seatsma" connid fldate seatsocc percenta0e
END OF END OF
Fou -an also 'e*ine stru-ture ty,es lo-ally usin7 t.e "F4S statement. ".e -om,onents are
en-lose' by t.e *ollo+in7 statements as s.o+n in t.e 7ra,.i-)
84!12 3= stru-tureOty,eOname.
...
42D 3= stru-tureOty,eOname.
4a-. in'ivi'ual -om,onent -an in turn be assi7ne' any ty,e you +is..
=or more in*ormation0 re*er to t.e (ey+or' 'o-umentation *or "F4S.
Fou 'e*ine t.e 'ata obHe-t itsel* in t.e usual +ay.
=or -om,atibility reasons0 you -an also 'ire-tly 'e*ine a stru-ture' 'ata obHe-t)
DA"A) 84!12 3= stru-tureOname
...
42D OF +#,-#,e_#$pe_name
SA A! "A#$0 $0%24
SAP AG 2003
Addressin" $tructure Comonents
DATA: 4%5&+%,, TYPE &+%,,.
4%5&+%,, 6+%,,*8 ; <LH<.
SELECT SINGLE * FROM &+%,,
INTO 4%5&+%,,
7HERE +%,,*8 ; 4%5&+%,, 6+%,,*8.
7RITE:/ 4%5&+%,, 6+%,,*8:
4%5&+%,, 6+%,,#%"e:
4%5&+%,, 60,l.
6 6
waEscarr
mandt currcode carrid carrname url
6 6
6 6
6 6
6 6
&om,onents o* a stru-ture are al+ays a''resse' usin7 a .y,.en)
+#,-#,e_name6-omponen#_name%
=or t.is reason0 'o not use .y,.ens in names.
SA A! "A#$0 $0%25
SAP AG 2003
Co!in" $tructure Comonents *ith the $ame (ame
DATA: 4%5&1l*/-$ TYPE &1l*/-$:
4%51++ TYPE &2+())1++.
MO>E6CORRESPONDING 4%5&1l*/-$ TO 4%51++. MO>E MO>E6 6CORRESPONDING CORRESPONDING
waEfocc
carrid seatsma" connid fldate seatsocc percenta0e
waEsfli0't
carrid !!! connid fldate seatsma" mandt !!! seatsocc
TO TO
".e statement M3;4%&3RR4S32D12! sour-eOstru- "3 tar7etOstru- -o,ies t.e -ontents o* t.e
stru-ture sour-eOstru- into t.e stru-ture tar7etOstru- -om,onent by -om,onent. ".e value
assi7nment +or(s only i* t.e -om,onents .ave i'enti-al names.
All ot.er -om,onents remain un-.an7e'.
SA A! "A#$0 $0%26
SAP AG 2003
$tructures in ,ebu""in" 6ode
,ariant
Main pro0ram
Source code of

SELECT SINGLE * FROM &+%,,


INTO CORRESPONDING FIELDS OF 4%5&+%,,
7HERE +%,,*8 ; !%5+%,,.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&+%,, TO &2+())5+%,,*e,.
CALL SCREEN ?)).
MO>E6CORRESPONDING &2+())5+%,,*e, TO 4%5&+%,,.
/i"ed point arit'metic
+

M
$AP
;atc'point
A.AP Debugger

ch*s ch*s
/ields
SC+S#B.C 0
*aCsbc@00
(o& Comonent name T!e 7en"th Contents
1
2
#
@
B
?
V
P
6A(,T
CA88I,
CA88(A6/
C588C0,/
6A8F
5(A6/
5D/IT
,AT/
C
C
C
C
C
C
T
,
#
#
20
B
1
12
?
P
100
AA
American Airlines
5$,
000000
00000000
$tructured )ield
7en"th (in b!tes)
*aCsbc@00
BP
,ouble4click the
data ob1ect
Fou -an tra-e t.e *iel' -ontents o* a stru-ture by enterin7 t.e name o* t.e stru-ture in t.e le*t
-olumn. Double%-li-( t.is entry to see t.e -om,onent 'is,lay.
SA A! "A#$0 $0%2B
SAP AG 2003
Workin" *ith Internal Tables
,ata T!es and ,ata 0b1ects
,ata T!es and ,ata 0b1ects
Basic ABAP $tatements
Basic ABAP $tatements
5sin" the ABAP ,ebu""er
5sin" the ABAP ,ebu""er
Workin" *ith $tructures
Workin" *ith $tructures
Workin" *ith Internal Tables
Workin" *ith Internal Tables
SA A! "A#$0 $0%2C
SAP AG 2003
Internal Tables
Table can be
e+tended d!namicall!
1nternal tables are 'ata obHe-ts t.at allo+ you to retain several 'ata re-or's +it. t.e same stru-ture in
memory. 1n ,rin-i,le0 t.e number o* 'ata re-or's is unlimite'. 1t is restri-te' only by t.e -a,a-ity
limits o* s,e-i*i- system installations.
".e A8A runtime system 'ynami-ally mana7es t.e len7t. o* internal tables. ".is eliminates any
+or( -on-ernin7 +or(in7 memory mana7ement.
".e in'ivi'ual 'ata re-or's in an internal table are (no+n as ta&le lines or table entries. =or t.is
reason0 t.e in'ivi'ual -om,onents in a line are re*erre' to as columns o* t.e internal table.
".e line ty,e o* an internal table -an be any A8A 'ata ty,e0 elementary or stru-ture'0 or it -an be
anot.er internal table.
1nternal tables are a sim,le +ay o* ,ro-essin7 lar7e 'ata re-or's in a stru-ture' *orm +it.in a
,ro7ram. "y,i-al uses in-lu'e)
"em,orarily storin7 'ata *rom 'atabase tables *or *uture ,ro-essin7
Stru-turin7 an' *ormattin7 'ata *or out,ut
=ormattin7 'ata *or use by ot.er servi-es
SA A! "A#$0 $0%29
SAP AG 2003
Attributes o) Internal Tables
AA 001V 22BV2
79 0@00 ?21?2
GF 000B 102000
Inde+ access Inde+ access
79 0@00 V22V#
B
Fe! access Fe! access
5A 000V
7ine t!e 7ine t!e 7ine t!e
Fe! de)inition Fe! de)inition Fe! de)inition
,ata access t!e ,ata access t!e ,ata access t!e
CA88I, C0((I, ,I$TA(C/ CA88I, C0((I, ,I$TA(C/
$G 0P?? 12?2B
5A 000V 22BV2
- - Comonents Comonents
- - $e.uence $e.uence
- - 5ni.ue / non 5ni.ue / non4 4uni.ue ke! uni.ue ke!
7ine inde+ 7ine inde+
B
@
#
2
1
?
".e 'ata ty,e o* an internal table is -om,letely s,e-i*ie' by t.e *ollo+in7 attributes)
8ine type
".is is t.e sour-e o* t.e attributes o* t.e in'ivi'ual -olumns. Fou normally s,e-i*y a stru-ture ty,e
but any 'ata ty,es are ,ossible.
2ey "e#inition
".e (ey -olumns an' t.eir or'er 'e*ine t.e -riteria by +.i-. t.e tables are i'enti*ie'. De,en'in7 on
t.e a--ess ty,e0 t.e (ey -an be 'e*ine' as uni=ue or non)uni=ue. #it. uniEue (eys t.ere are no
multi,le entries +it. i'enti-al values in t.e (ey.
>ata access type
#it. a 'ey access D as +it. 'atabase tables D you a--ess usin7 t.e *iel' -ontents.
!(ample) A rea' a--ess usin7 t.e sear-. term <UA )))F< to an internal table +it. t.e uniEue
(ey CARRID CONNID an' t.e 'ata ,i-ture' above returns e:a-tly one 'ata re-or'.
5n"e( access) 9nli(e 'atabase tables0 +it. internal tables t.e system may number t.e lines an'
7ive t.e line an in'e:. Fou -an use t.is i'e: to a--ess a s,e-i*i- table line.
!(ample) A rea' a--ess to a 'ata re-or' +it. in'e: 5 returns t.e *i*t. 'ata re-or' o* t.e internal
table
SA A! "A#$0 $0%30
SAP AG 2003
Inde+ access
Fe! access
5ni.ue / (0(4 5(IG5/ 5(IG5/ W (0(45(IG5/ 5(IG5/
(on45ni.ue Fe!
Access 5sin" 6ainl! inde+ 6ainl! ke!s Fe!s onl!
:AS:E4 (AB*E :AS:E4 (AB*E
S(A74A.4 (AB*E S(A74A.4 (AB*E S.(E4 (AB*E S.(E4 (AB*E
Connection Bet*een Table Find and Access T!e
Inde+ tables 9ashed table
Table t!e
n
n
Anot.er internal table attribute is t.e ta&le type. 1nternal tables -an be 'ivi'e' into t.ree table ty,es
a--or'in7 to t.e res,e-tive a--ess ty,es)
\ #it. stan"ar" ta&les t.e line numberin7 is maintaine' internally. 8ot. in'e: an' (ey a--esses
are ,ossible.
\ #it. sorte" ta&les t.e 'ata re-or's are al+ays sorte' a--or'in7 to (ey an' save'. >ere too0 t.e
in'e: is maintaine' internally. 8ot. in'e: an' (ey a--esses are ,ossible.
\ #it. hashe" ta&les t.e 'ata re-or's are mana7e' o,timi<e' at run time. A uniEue (ey is a
reEuirement. #it. .as.e' tables only (ey a--esses are ,ossible.
#.i-. table ty,e you use in ea-. -ase0 'e,en's on .o+ t.at tableYs entries are 7enerally 7oin7 to be
a--esse')
\ =or in'e: a--esses you s.oul' normally use stan'ar' tables.
\ Sorte' tables are best *or uniEue (eys an' *i:e' sortin7.
\ #it. .as.e' tables t.e runtime o,timi<ation is noti-eable only i* t.e a--esses are o* t.e rea'
ty,e +it. a uniEue (ey.
".is -ourse 'eals +it. stan'ar' tables only. A,art *rom a *e+ s,e-ial -ases0 t.e synta: is i"entical
#or all three ta&le types.
SA A! "A#$0 $0%3$
SAP AG 2003
,e)inition o) Internal Tables *ith %lobal T!es
7ine t!e and access
Fe!
Fe! de)inition
Fe! cate"or!
Fe! comonents
7ine t!e
,ata access t!e
$BC@00F0CC
$tandard table
Fe! comonents
(on4uni.ue
CA88I,
C0((I,
F7,AT/
S'C())5T5S'C())FOCC S'C())5T5S'C())FOCC
Table t!e Table t!e
DATA *$%251l*/-$*#1 TYPE &2+())5$5&2+())1++. DATA DATA
ita$Efli0'tinfo
carrid seatsma" connid fldate seatsocc percenta0e
"able ty,es -an be 'e*ine' lo-ally in a ,ro7ram or 7lobally in t.e A8A Di-tionary.
=or DATA "#a(_name TYPE "#a(_#$pe you -an use local or .lo&al ty,es "#a(_#$pe.
=or 'etaile' in*ormation on t.e 'e*inition o* 7lobal table ty,es in t.e A8A Di-tionary0 re*er to t.e
SA 6ibrary un'er ,asis A,AP 3or-enc* ,(-A,AP 'ictionary %ypes %ale types.
SA A! "A#$0 $0%32
SAP AG 2003
,e)inition o) Internal Tables *ith 7ocal T!es
TYPES: $$51l*/-$*#1
TYPE STANDARD TA'LE OF &2+())1++
7ITH NON6UNIQUE CEY +%,,*8 +##*8 1l8%$e.
DATA *$%251l*/-$*#1 TYPE $$51l*/-$*#1.
STANDARD TA'LE OF STANDARD TA'LE OF
ita$Efli0'tinfo
carrid seatsma" connid fldate seatsocc percenta0e
7ITH NON 7ITH NON6 6UNIQUE CEY UNIQUE CEY
Fou -an also 'e*ine internal table ty,es lo-ally usin7 t.e "F4 statement.
".e table ty,e is s,e-i*ie' bet+een "F4 an' "A864 3=.
".e line ty,e -omes a*ter "A864 3=.
".e (ey *iel's are liste' a*ter t.e #1"> a''ition. 2ote t.at t.e or'er o* t.e (ey *iel's ,lays a ,art
.ere.
=or 'etaile' in*ormation about 'e*inin7 lo-al table ty,es0 re*er to t.e (ey+or' 'o-umentation on
"F4S.
Fou 'e*ine t.e 'ata obHe-t itsel* in t.e usual +ay.
=or -om,atibility reasons0 you -an also 'ire-tly 'e*ine an internal table as *ollo+s)
DA"A itabOname TYPE #a('e_8"nd TA'LE OF +#,-_#$pe 7ITH 8e$_de!.
SA A! "A#$0 $0%33
SAP AG 2003
0'er'ie*3 T!in" $tructured ,ata 0b1ects
DATA 4% TYPE &!1l*.
SELECT ... FROM &!1l*
INTO 4% ...
TA'LES &2+())1++.
DATA 4% TYPE
&2+())1++.
DATA *$ TYPE
&2+())5$5&2+())1++.
ABAP ro"ram ABAP ,ictionar! ,atabase
SPFLI SPFLI
Transarent table Transarent table
(,escrition)
S'C())FOCC S'C())FOCC
$tructure $tructure
S'C())FOCC S'C())FOCC
$tructure $tructure
S'C())5T5S'C())FOCC S'C())5T5S'C())FOCC
Table t!e Table t!e
AA 1V &&&
AA ?@ &&&
&&& &&& &&&
79 @00 &&&
79 @02 &&&
AA 1V &&&
AA ?@ &&&
&&& &&& &&&
79 @00 &&&
79 @02 &&&
$PF7I
SA A! "A#$0 $0%34
SAP AG 2003
0'er'ie*3 Accessin" $in"le 8ecords
Aend
Insert
8ead
Chan"e
,elete
APPEND 4% TO *$%2.
INSERT 4% INTO TA'LE *$%2 L+#8*$*#M.
READ TA'LE *$%2 INTO 4% L+#8*$*#M.
MODIFY TA'LE *$%2 FROM 4% G L+#8*$*#M I.
DELETE *$%2 L+#8*$*#M.
APPEND APPEND
INSERT INSERT
READ TA'LE READ TA'LE
MODIFY MODIFY
DELETE DELETE
".e *ollo+in7 sin7le re-or' o,erations are available *or internal tables) 1n ea-. -ase 4% re,resents a
stru-ture t.at must .ave t.e same ty,e as t.e line ty,e o* t.e internal table *$%2.
APPEND A,,en's t.e -ontents o* a stru-ture to an internal table. ".is o,eration s.oul'
be use' +it. stan'ar' tables only.
INSERT 1nserts t.e -ontents o* a stru-ture into an internal table. 1n a stan'ar' table it is
a,,en'e'0 in a sorte' table it is inserte' in t.e ri7.t ,la-e0 an' in a .as.e' table it is inserte'
a--or'in7 to t.e .as. al7orit.m.
READ &o,ies t.e -ontents o* a line in an internal table to a stru-ture.
MODIFY 3ver+rites a line in an internal table +it. t.e -ontent o* a stru-ture.
DELETE Deletes a line o* an internal table.
COLLECT A--umulates t.e -ontents o* a stru-ture into an internal table. ".is statement
may be use' only *or tables +.ose non%(ey *iel's are all numeri-. ".e numeri- values
are summari<e' *or i'enti-al (eys
=or 'etaile' in*ormation about t.e A8A statements 'es-ribe' .ere0 re*er to t.e relevant (ey+or'
'o-umentation.
SA A! "A#$0 $0%35
SAP AG 2003
0'er'ie*3 Processin" $ets o) 8ecords
7oo3 For all sin"le
record oerations
700P AT itab I(T0 *a TconditionU&
/(,700P&&
DELETE *$%2 L+#8*$*#M.
INSERT LINES OF *$%22
L+#8*$*#2M
INTO *$%2? L+#8*$*#?M.
,elete
Insertin" se'eral
lines )rom another
internal table
LOOP LOOP
ENDLOOP ENDLOOP
DELETE DELETE
INSERT INSERT
Aendin" se'eral
lines )rom another
internal table
INSERT LINES OF *$%22
L+#8*$*#?M TO *$%2?.
APPEND APPEND
".e *ollo+in7 set o,erations are available *or internal tables) 1n ea-. -ase 4% re,resents a stru-ture
t.at must .ave t.e same ty,e as t.e line ty,e o* t.e internal table *$%2.
LOOP ... ENDLOOP
".e LOOP ,la-es t.e lines o* an internal table one by one into t.e stru-ture s,e-i*ie' in t.e
INTO -lause. All sin7le re-or' o,erations -an be e:e-ute' +it.in t.e loo,. 1n t.is -ase0 *or t.e
sin7le re-or' o,erations0 t.e system i'enti*ies t.e line to be ,ro-esse'.
DELETE
Deletes t.e lines o* t.e internal table t.at satis*y t.e -on'ition L+#8*$*#M.
INSERT
&o,ies t.e -ontents o* several lines o* an internal table to anot.er internal table.
APPEND
A,,en's t.e -ontents o* several lines o* an internal table to anot.er stan'ar' table.
=or 'etaile' in*ormation about t.e A8A statements 'es-ribe' .ere0 re*er to t.e relevant (ey+or'
'o-umentation.
SA A! "A#$0 $0%36
SAP AG 2003
$!nta+ /+amle3 Fillin" 7ine b! 7ine
* 1*ll &$,0+$0,e 4*$- v%l0e&:
4%51l*/-$*#16+%,,*8 ; ... .
4%51l*/-$*#16+##*8 ; ... .
4%51l*/-$*#161l8%$e ; ... .
4%51l*/-$*#16&e%$&"%B ; ... .
4%51l*/-$*#16&e%$&++ ; ... .
4%51l*/-$*#16!e,+e#$%/e ; ... .
* *#&e,$ &$,0+$0,e *#$ *#$e,#%l $%2le:
INSERT 4%51l*/-$*#1 INTO TA'LE *$%251l*/-$*#1.
* 8e1*#e *#$e,#%l $%2le %#8 4,N%,e%:
DATA: *$%251l*/-$*#1 TYPE &2+())5$5&2+())1++:
4%51l*/-$*#1 LICE LINE OF *$%251l*/-$*#1.
ita$Efli0'tinfo
waEfli0'tinfo
Fou -an insert lines into an internal table by *irst *illin7 a stru-ture +it. t.e reEuire' values an' t.en
insertin7 it into t.e internal table usin7 t.e INSERT statement.
=or stan'ar' tables0 t.is means t.at t.e line is a,,en'e' to t.e table. =or sorte' tables an' .as.
tables0 t.e system inserts t.e line a*ter re*errin7 to t.e (ey.
SA A! "A#$0 $0%3B
SAP AG 2003
$!nta+ /+amle3 8eadin" Contents 5sin" a 7oo
LOOP AT *$%251l*/-$*#1 INTO 4%51l*/-$*#1.
7RITE: / 4%51l*/-$*#16+%,,*8:
4%51l*/-$*#16+##*8:
4%51l*/-$*#161l8%$e:
4%51l*/-$*#16&e%$&"%B:
4%51l*/-$*#16&e%$&++:
4%51l*/-$*#16!e,+e#$%/e:
<O<.
ENDLOOP.
* 8e1*#e *#$e,#%l $%2le %#8 4,N%,e%:
DATA: *$%251l*/-$*#1 TYPE &2+())5$5&2+())1++:
4%51l*/-$*#1 LICE LINE OF *$%251l*/-$*#1.
ita$Efli0'tinfo
waEfli0'tinfo
Fou -an rea' an' ,ro-ess t.e -ontents o* an internal table usin7 a LOOP by a--essin7 t.e stru-ture
-om,onent +it.in t.e loo,.
1n t.is e:am,le0 t.e WRITE statement is use' to -reate a list *rom t.e *iel' -ontents.
1* you +ant to -.an7e t.e -ontents o* t.e internal table0 *irst -.an7e t.e value o* t.e -om,onents
+it.in t.e loo, an' t.en over+rite t.e line o* t.e internal table usin7 t.e MODIFY statement.
SA A! "A#$0 $0%3C
SAP AG 2003
0erations on the Whole Internal Table
$ort
,elete the entire
content o) the
internal table
SORT *$%2 L+#8*$*#&M.
REFRESH *$%2. REFRESH REFRESH
SORT SORT
".e *ollo+in7 o,erations a**e-t t.e *hole internal table.
SORT
Fou -an use t.is to sort any number o* -olumns in a stan'ar' or .as.e' table in as-en'in7 or
'es-en'in7 or'er. Fou may +ant to ta(e -ulture%s,e-i*i- sort rules into a--ount.
REFRESH
".is 'eletes t.e entire -ontents o* an internal table. A ,art o* t.e ,reviously use' +or(in7 memory
remains available *or *uture insertions.
FREE
".is 'eletes t.e entire -ontents o* t.e internal table an' releases t.e ,reviously use' +or(in7
memory.
CLEAR
9nli(e all ot.er 'ata obHe-ts0 t.is statement .as t.e same e**e-t as t.e REFRES/ statement on
internal tables +it. no .ea'er line.
SA A! "A#$0 $0%39
SAP AG 2003
$!nta+ /+amle3 $ortin" a $tandard Table
SORT *$%251l*/-$*#1 'Y !e,+e#$%/e DESCENDING.
* 8e1*#e *#$e,#%l $%2le %#8 4,N%,e%:
DATA: *$%251l*/-$*#1 TYPE &2+())5$5&2+())1++:
4%51l*/-$*#1 LICE LINE OF *$%251l*/-$*#1.
ita$Efli0'tinfo
waEfli0'tinfo
'Y 'Y DESCENDING DESCENDING
(ame o) column(s)
b! *hich to sort
Ascendin"
or
descendin"A
Fou -an sort stan'ar' tables by any -olumn0 sim,ly by enterin7 t.e -olumn name a*ter t.e 'Y
a''ition to t.e SORT statement.
S3R" "#a( G ASCENDING H DESCENDING I
G 'Y !4 G ASCENDING H DESCENDING I
.%%
!n G ASCENDING H DESCENDING I I
G AS TEXT I
G STA'LE I.
Sortin7 t.e internal table by t.e table (ey or s,e-i*ie' *iel' or'er) #it.out an a''ition t.e system
sorts in as-en'in7 or'er.
1* you use t.e AS TEXT a''ition0 t.e system +ill0 +.ile sortin7 by -.ara-ter%ty,e *iel's0 ta(e t.e
-ulture%s,e-i*i- sort rule into a--ount.
6nly i* you use t.e STA'LE a''ition +ill t.e relative or'er o* 'ata re-or's0 +.i-. are i'enti-al in
t.e sort (ey0 remain inta-t 'urin7 sortin7.
1n t.is e:am,le0 t.e 'ata re-or's o* t.e internal table are sorte' in 'es-en'in7 or'er by t.e
,er-enta7e o--u,an-y o* *li7.ts.
=or more 'etails0 re*er to t.e (ey+or' 'o-umentation *or SORT.
SA A! "A#$0 $0%40
SAP AG 2003
Internal Tables in ,ebu""in" 6ode
,ariant

LOOP AT *$51l*/-$*#1 INTO 4%51l*/-$*#1.


7RITE: / 4%51l*/-$*#16+%,,*8:
4%51l*/-$*#16+##*8:
/i"ed point arit'metic
3> 30 +

M
$AP
;atc'point
A.AP Debugger

ch*s ch*s
(a$le
SC+S#B.C 0
itC)li"htin)o
,ouble4click the
data ob1ect
1
2
#
@
B
?
V
P
AA
AA
AA
AA
79
79
79
79
Internal table
itC)li"htin)o
T!e
$TA(,A8,
CA88I,
001V
001V
001V
001V
0@00
0@00
0@00
0@00
C0((I,
20000B12
20000V2@
20000P2P
2000122@
20000?2?
20000V1B
2000111#
20001212
F7,AT/
&&&
&&&
&&&
&&&
&&&
&&&
&&&
&&&
&&&
??
120
B?0
@V0
2@0
12#
2V#
2P0
P/8C/(TA%/
Table
Fou -an tra-e t.e line -ontents o* an internal table by enterin7 t.e name in t.e le*t -olumn. "o see
t.e table 'is,lay0 'ouble%-li-( t.is entry.
SA A! "A#$0 $0%4$
SAP AG 2003
,e)ine elementar! and structured data ob1ects
5se basic ABAP statements
/+ecute and anal!Ee ro"rams in debu""in"
mode
;ou are no* able to3
Basic ABAP 7an"ua"e /lements3 5nit $ummar!
SA A! "A#$0 $0%42
A0A 8an.ua.e !lements !(ercises
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ 0asic A0A Statements
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
De*ine elementary 'ata obHe-ts
Assi7n values
1m,lement -on'itional bran-.in7
er*orm -al-ulations
&reate an A8A ,ro7ram *or t.e *our basi- -al-ulation ty,es. Fou must
be able to enter t.e values an' arit.meti- o,erator on a sele-tion s-reen.
Dis,lay t.e result in a list.
ro7ram) @'C())5AA5COMPUTE
Mo'el solution) SAPBC400TSS_COMP*TE
## stan's *or t.e t+o%'i7it 7rou, number.
$%$ &reate t.e e:e-utable ,ro7ram @'C())5AA5COMPUTE
*ithout L"3 1n-lu'eL.
$%2 De*ine t.e in,ut ,arameters *or t+o inte7ers @name su77estion) !%5*#$?0
!%5*#$2A an' an arit.meti- o,erator @name su77estion) !%5!A. A''itionally0
'e*ine an elementary 'ata obHe-t *or t.e result ty,e) ,a-(e' number +it. t+o
'e-imal ,la-es @name su77estion) ,e&0l$A.
$%3 4:e-ute t.e -al-ulation in -onne-tion +it. t.e s,e-i*ie' arit.meti- o,erator.
9se t.e CASE statement to 'o t.is.
$%4 Dis,lay t.e result in a list.
$%5 1* t.e user .as s,e-i*ie' an invali' arit.meti- o,erator on t.e sele-tion s-reen0 +rite
an a,,ro,riate statement on t.e list s-reen..
9se t.e IF statement to 'o t.is.
SA A! "A#$0 $0%43
$%6 1* t.e user tries to 'ivi'e by <ero0 'is,lay an a,,ro,riate statement on t.e list
s-reen.
1n a later unit you +ill learn .o+ you -an im,lement t.e error
.an'lin7 +it. a more ele7ant user 'ialo7.
SA A! "A#$0 $0%44
!(ercises
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ ;or'in. *ith Structures
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
9se t.e Debu77er to tra-e t.e 'ata *lo+ an' un'erstan' t.e
-onne-tions bet+een ,ro-essin7 blo-(s.
9se t.e MO>E6CORRESPONDING statement to assi7n values bet+een
stru-tures.
Fou .ave to e:amine a s,e-i*ie' A8A ,ro7ram to as-ertain +.en an'
.o+ -ertain 'ata is trans,orte' bet+een -ertain stru-ture' 'ata obHe-ts.
ro7ram) SAPBC400WBS_GETTING_STARTED
2%$ Start t.e ,ro7ram SAP'C())7'S5GETTING5STARTED. 3n t.e sele-tion s-reen0
enter t.e airline -o'e ]LHU. 1n t.e -omman' *iel'0 enter Y/-Y an' t.en e:e-ute t.e
,ro7ram. Fou are no+ in 'ebu77in7 mo'e.
2%2 Ma(e sure t.at all o* t.e 'ata obHe-ts are initial. "rans*er all o* t.e 'ata obHe-ts
'e*ine' in t.e ,ro7ram to t.e *iel' vie+. =in' out about t.e stru-ture an' ty,e o* t.e
in'ivi'ual -om,onents.
2%3 Ste, t.rou7. t.e ,ro7ram0 one statement at a time0 by -.oosin7 Single step @=5A.
#.i-. *iel's o* t.e stru-ture 9a_+-a 'oes t.e SELECT statement *illP #.at is
t.e value o* system *iel' +$.+,(- a*ter t.e statementP
2%4 2o+ observe .o+ *iel's are -o,ie' *rom t.e stru-ture 9a_+-a to t.e stru-ture
+(-400_-a"e. #.i-. *iel' values are -o,ie'P
2%5 ".e statement CALL SCREEN 400 ,ro-esses s-reen $00. 3n t.e s-reen0 enter
a,,ro,riate values *or t.e user name0 'ate0 an' time0 an' -ontinue +it. t.e
,ro7ram. 2o+ observe .o+ *iel's are -o,ie' *rom t.e stru-ture
+(-400_-a"e to t.e stru-ture 9a_+-a.
2%6 =inally0 observe .o+ t.e WRITE statement -onstru-ts t.e list.
SA A! "A#$0 $0%45
A*ter t.e *irst WRITE statement0 an e:tra button a,,ears in t.e
a,,li-ation toolbar0 +.i-. allo+s you to 'is,lay t.e -urrent -ontents
o* t.e list bu**er at any time.
2%B Restart t.e ,ro7ram in Debu77in7 mo'e. Set a brea(,oint at t.e MO)E.
CORRESPONDING statement. 8e*ore t.e s-reen is ,ro-esse'0 assi7n a name to t.e
stru-ture -om,onent +(-400_-a"e.,name in t.e Debu77er.
".e button use' to -.an7e t.e *iel' values at runtime is ne:t to t.e
in,ut/out,ut *iel'.
2%C Re,eat ste, 2%$. 2o+ set a brea(,oint at t.e CALL SCREEN statement.
A''itionally0 set a *iel' -ontent%'e,en'ent +at-.,oint *or t.e -on'ition t.at a *iel'
value o* t.e stru-ture 9a_+-a -.an7es. &.oose (ontinue @=CA to -ontinue t.e
,ro7ram an' -.e-( +.y t.e 'ebu77in7 o* t.e ,ro7ram is sto,,e' in ea-. -ase.
SA A! "A#$0 $0%46
!(ercises
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ ;or'in. *ith 5nternal Ta&les
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
Sear-. *or suitable table (in's in t.e A8A Di-tionary
De*ine internal tables base' on a 7lobal table (in'
=ill internal tables usin7 array *et-.
ro-ess t.e -ontent o* internal tables usin7 a loo,.
&reate an A8A ,ro7ram t.at lists a''itional in*ormation on all e:istin7
*li7.t 'e,arture times.
!et t.e 'ata *rom t.e 'atabase table SPFLI.
ro7ram) @'C())5AA5ITA'5LOOP
Mo'el solution) SAPBC400TSS_ITAB_LOOP
## stan's *or t.e t+o%'i7it 7rou, number.
3%$ &reate t.e e:e-utable ,ro7ram @'C())5AA5ITA'5LOOP
*ithout L"3%1n-lu'eL.
3%2 8u**er t.e 'ata *rom t.e 'atabase table SPFLI in an internal table. De*ine an internal
table +it. a line ty,e t.at is -om,atible +it. t.e line stru-ture o* SPFLI.
1n t.e A8A Di-tionary0 sear-. *or all internal table (in's t.at mat-. t.is
-on'ition.
@9se t.e 3*ere-used list in t.e A8A 4'itor.A
3%3 De*ine an internal table @name su77estion) *$5&!1l*A base' on one o* t.e 7lobal
table ty,es you .ave *oun'.
3%4 De*ine a +or( area t.at -orres,on's to t.e internal table @name su77estion)
4%5&!1l*A.
3%5 ro7ram an array *et-. a--ess to all t.e 'ata re-or's in t.e 'atabase table SPFLI)
SELECT * FROM &!1l*
INTO TA'LE *$5&!1l*.
SA A! "A#$0 $0%4B
3%6 Dis,lay t.e bu**ere' 'ata in a list.
9se t.e LOOP statement to 'o t.is.
SA A! "A#$0 $0%4C
A0A 8an.ua.e !lements Solutions
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ 0asic A0A Statements
$ %o"el solution$
REPORT &%!2+())$&&5+"!0$e.
PARAMETERS:
!%5*#$? TYPE *:
!%5!D?E TYPE +:
!%5*#$2 TYPE *.
DATA ,e&0l$ TYPE ! DECIMALS 2.
IF NOT D !%5! ; <K< OR
!%5! ; <6< OR
!%5! ; <*< OR
!%5! ; </< E.
7RITE: <I#v%l*8 !e,%$,=<D*!E.
ELSEIF !%5! ; </< AND !%5*#$2 ; ).
7RITE: <D*v*&*# 2. Pe,=<D82PE.
ELSE.
CASE !%5!.
7HEN <K<.
,e&0l$ ; !%5*#$? K !%5*#$2.
7HEN <6<.
,e&0l$ ; !%5*#$? 6 !%5*#$2.
7HEN <*<.
,e&0l$ ; !%5*#$? * !%5*#$2.
7HEN </<.
,e&0l$ ; !%5*#$? / !%5*#$2.
ENDCASE.
7RITE: <Re&0l$:<D,e&E: ,e&0l$.
ENDIF.
SA A! "A#$0 $0%49
Solutions
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ ;or'in. *ith Structures
2%3 #.i-. -om,onents are *ille' by t.e SELECT statement &P
"%#8$0 +%,,*80 +%,,#%"e0 +0,,+8e0 0,l.
#.at is t.e value o* t.e system *iel' +$.+,(- a*ter t.e SELECT statementP
8e-ause t.ere is a 'ata re-or' *or t.e airline 83 @6u*t.ansaA in t.e 'atabase table
SCARR0 &.6&02,+ is set to <ero.
2%4 #.i-. *iel' values are -o,ie'P
"%#8$0 +%,,*80 +%,,#%"e0 +0,,+8e.
SA A! "A#$0 $0%50
Solutions
/nit$ 0asic A0A 8an.ua.e !lements
Topic$ ;or'in. *ith 5nternal Ta&les
3 %o"el solution$
REPORT &%!2+())$&&5*$%25l!.
DATA: *$5&!1l* TYPE &2+())5$5&!1l*.
DATA: 4%5&!1l* TYPE &!1l*.
SELECT * FROM &!1l* INTO TA'LE *$5&!1l*.
: a# 'ea+# one da#a+e# +e'e-#ed
IF &.6&02,+ ; ).
: mo3e ea-; +"n&'e da#a+e# !om "n#ena' #a('e #o
: +#,-#,e WA_SPFLI "n ode #o 9"#e da#a on '"+#
LOOP AT *$5&!1l* INTO 4%5&!1l*.
7RITE: / 4%5&!1l*6+%,,*8:
4%5&!1l*6+##*8:
4%5&!1l*6+*$.1,":
4%5&!1l*6+*$.$:
4%5&!1l*68e!$*"e:
4%5&!1l*6%,,$*"e.
ENDLOOP.
ENDIF.
SA A! "A#$0 $0%5$
,
SAP AG 2003
,ata 8etrie'al )or ,atabase Tables
Guer!in" the ,atabase
8eadin" ,atabase Tables
AuthoriEation Checks
Pre'ie*
Contents3
,ata 8etrie'al
SA A! "A#$0 $$%$
,.2
SAP AG 2003
7ist 'arious *a!s o) )indin" database tables
Pro"ram read access to seci)ic columns and
lines *ithin a articular database table
Imlement authoriEation checks
7ist the read access otions )or multile database
tables
At the conclusion o) this unit2 !ou *ill be able to3
,ata 8etrie'al3 5nit 0b1ecti'es
SA A! "A#$0 $$%2
,.3
SAP AG 2003
ABAP
Processin"
block
ABAP runtime s!stem
ABAP ro"ram
Guer!in" the ,atabase
,ata ob1ects
*aCscarr
,atabase
inter)ace
$/7/CT &&&
scarr
,atabase ,atabase $G7 $G7
,atabase ,atabase4 4
seci)ic seci)ic
con'ersion con'ersion
aCcar
$CA88
SELECT SELECT
FROM FROM
0en 0en $G7 $G7
,atabase
table
6pen S78 statements are a subset o* Stan"ar" S78 t.at is *ully inte7rate' in t.e A8A
lan7ua7e. @SQ6 stan's *or stan'ar' Euery lan7ua7e.A
3,en SQ6 statements allo+ you to a--ess t.e 'atabase in a uni*orm +ay *rom your ,ro7rams0
re7ar'less o* t.e 'atabase system installe'. ".e 'atabase inter*a-e -onverts 3,en SQ6 statements
to 'atabase%s,e-i*i- SQ6 statements.
SA A! "A#$0 $$%3
,.4
SAP AG 2003
$earchin" )or ,atabase Tables
$earchin" *ithin a articular alication comonent3
Alication hierarch!&
$earchin" usin" a ro"ram 3
$earch in the ABAP /ditor )or the $/7/CT statement
Chan"e to debu""in" mode durin" ro"ram e+ecution and
set breakoint in the $/7/CT statement
I) the ro"ram transmits a screen2 disla! the structure )ield
usin" F1 and technical in)ormation or na'i"ate directl! to the
data element (double4click)2 or "o directl! to the data element
(b! double4clickin" it) and oen the *here4used list in the
tables
Fou -an sear-. *or 'atabase tables via t.e A,,li-ation >ierar-.y or t.e Re,ository 1n*ormation
System"
1* you .ave t.e name o* a ,ro7ram t.at a--esses t.e 'atabase table you are sear-.in7 *or)
>e&u..er$
Start t.is ,ro7ram in 'ebu77in7 mo'e an' set a &rea'point at t.e SELECT statement.
A0A !"itor$
Sear-. *or t.e SELECT statement in t.e sour-e te:t.
1* you (no+ a ,ro7ram t.at -ontains a s-reen +it. in,ut *iel's -onne-te' to t.e table you are
loo(in7 *or0 -.oose F: %ec*nical info. Double%-li-( t.e te-.ni-al name o* t.e s-reen *iel' to
7o to t.e A8A Di-tionary. ".is is o*ten a stru-ture *iel'. Double%-li-( t.e "ata element an'
t.en use t.e +.ere%use' list to sear-. *or trans,arent tables +it. t.e *iel' ty,e
SA A! "A#$0 $$%4
,.5
SAP AG 2003
8eadin" ,atabase Tables
8eadin" ,atabase Tables
8eadin" ,atabase Tables
AuthoriEation Checks
AuthoriEation Checks
Pre'ie*
Pre'ie*
SA A! "A#$0 $$%5
,.6
SAP AG 2003
Which columnsA Which table(s)A
Whereto WheretoA A
Which linesA
$/7/CT TresultU F806 TtableU
I(T0 Ttar"etU
W9/8/ TconditionU
Particular
column
O
6ultile lines X
$in"le line
Pro"rammin" ,atabase 8ead Access
"o ,ro7ram 'atabase rea' a--ess0 use t.e 3,en SQ6 statement SELECT.
".e SELECT statement -ontains a series o* -lauses0 ea-. o* +.i-. .as a 'i**erent tas()
".e SELECT -lause 'es-ribes0 amon7 ot.er t.in7s0 +.et.er t.e result o* t.e sele-tion +ill be
several lines or a sin7le 'ata re-or' an' +.i-. *iel's o* t.e table are to be rea'.
".e FROM -lause names t.e sour-e @'atabase table or vie+A *rom +.i-. t.e 'ata is to be
sele-te'.
".e INTO -lause 'etermines t.e internal 'ata obHe-ts into +.i-. t.e sele-te' 'ata is to be
,la-e'.
".e 7HERE -lause s,e-i*ies t.e -on'itions t.at t.e sele-tion results must *ul*ill. 1t t.us
'etermines t.e lines to be sele-te' *rom t.e table.
=or in*ormation about ot.er -lauses0 re*er to t.e (ey+or' 'o-umentation *or SELECT.
SA A! "A#$0 $$%6
,.7
SAP AG 2003
8eadin" b! $in"le 8ecord Access
aCcar
SELECT SINGLE *
FROM &+%,,
INTO 4%5&+%,,
7HERE +%,,*8 ; !%5+%,.
IF &.6&02,+ ; ).
...
SINGLE SINGLE
,atabase
inter)ace
*aCscarr
INTO INTO
7HERE 7HERE
$CA88
,atabase
table
".e SELECT SINGLEB statement allo+s you to rea' a sin.le recor" *rom t.e 'atabase table. "o
ensure t.at you rea' a uniEue entry0 all o* t.e (ey *iel's must be *ille' by t.e 7HERE -lause. ".e
asteris( R a*ter S12!64 tells t.e 'atabase inter*a-e to rea' all -olumns in t.at line o* t.e 'atabase
table. 1* you +ant only a s,e-i*i- sele-tion o* -olumns0 you -an list t.e reEuire' *iel's instea'.
1n t.e INTO -lause0 enter t.e 'estination +.ere t.e 'atabase inter*a-e is to -o,y t.e 'ata. ".e tar7et
area s.oul' be stru-ture' le*t Husti*ie' Hust li(e t.e reEuire' -olumns o* t.e 'atabase table.
1* you use t.e &3RR4S32D12! =146DS 3= a''ition in t.e 12"3 -lause0 you -an *ill t.e tar7et
area -om,onent by -om,onent. ".e system *ills only t.ose -om,onents t.at .ave i'enti-al names to
-olumns in t.e 'atabase table. 2ote) 1* you 'o not use t.is a''ition0 t.e system *ills t.e tar7et area
le*t Husti*ie'0 irres,e-tive o* its stru-ture.
1* t.e system *in's a table entry mat-.in7 your -on'itions0 SF%S98R& .as t.e value <ero @0A.
".e S12!64 a''ition tells t.e 'atabase t.at only one line nee's to be rea'. ".e 'atabase -an t.en
terminate t.e sear-. as soon as it .as *oun' t.at line. ".ere*ore0 S464&" S12!64 ,ro'u-es better
,er*orman-e *or sin7le%re-or' a--ess t.an a S464&" loo, i* you su,,ly values *or all (ey *iel's
SA A! "A#$0 $$%B
,.8
SAP AG 2003
8eadin" $e'eral 7ines 5sin" a 7oo
aCcar
*aCsbc@00)occ
,atabase
inter)ace
SELECT +%,,*8 +##*8 1l8%$e
&e%$&++ &e%$&"%B
FROM &1l*/-$
INTO 4%5&2+())1++
7HERE +%,,*8 ; !%5+%,.
ENDSELECT.
IF &.6&02,+ ; ).
...
ENDSELECT ENDSELECT
SELECT SELECT
$tatements )or e'er! record read
$F7I%9T
,atabase
table
1* you 'o not use t.e a''ition SINGLE +it. t.e SELECT statement0 t.e system rea's multi,le
re-or's *rom t.e 'atabase. ".e *iel' list 'etermines t.e columns +.ose 'ata is to be rea' *rom t.e
'atabase.
".e number o* reEueste' lines to be rea' -an be restri-te' usin7 t.e 7HERE -lause.
1n t.e W/ERE -lause you may enter only t.e #iel" names o* t.e 'atabase table. ".e name o* t.e
'atabase table you +ant to a--ess is *oun' in t.e FROM -lause.
Multi,le lo7i-al -on'itions -an be a''e' to t.e W/ERE -lause usin7 ANDA NOT or OR statements.
".e 'atabase 'elivers 'ata to t.e 'atabase inter*a-e in ,a-(a7es. ".e A8A runtime system -o,ies
t.e 'ata re-or's to t.e tar7et area line by line usin7 a loo,. 1t also enables seEuential ,ro-essin7 o* all
t.e statements bet+een SELECT an' ENDSELECT.
A*ter t.e ENDSELECT statement0 you -an -.e-( t.e return -o'e *or t.e SELECT loo,. sy)su&rc +ill
.ave t.e value <ero @0A i* t.e 'atabase inter*a-e .as *oun' at least one re-or'.
A*ter t.e ENDSELECT statement0 &.682+#$ -ontains t.e total number o* lines rea'!
SA A! "A#$0 $$%C
,.C
SAP AG 2003
8eadin" $e'eral 7ines 5sin" an Arra! Fetch
aCcar
itabC)occ
,atabase
inter)ace
SELECT +%,,*8 +##*8 1l8%$e
&e%$&"%B &e%$&++
FROM &1l*/-$
INTO TA'LE *$%251++
7HERE +%,,*8 ; !%5+%,.
IF &.6&02,+ ; ).
...
TA'LE TA'LE
$F7I%9T
,atabase
table
".e a''ition INTO TA'LE *$%2 -auses t.e A8A runtime system to -o,y t.e -ontents o* t.e
'atabase inter*a-e 'ire-tly to t.e internal table *$%2. ".is is -alle' an array #etch%
Sin-e t.e array *et-. is not e:e-ute' as a loo,0 'o not ,ro7ram any ENDSELECT statement.
1* you +ant to a'' lines to t.e en' o* an internal table t.at is alrea'y *ille'0 instea' o* over+ritin7 it0
use t.e APPENDING TA'LE *$%2 a''ition.
&.6&02,+ .as t.e value 0 i* t.e system +as able to rea' at least one re-or'.
SA A! "A#$0 $$%9
,.,0
SAP AG 2003
ABAP ro"ram
DATA 4%5&2+())1++ TYPE &2+())1++.
SELECT SINGLE +%,,*8 +##*8 1l8%$e &e%$&"%B &e%$&++
FROM &1l*/-$
INTO 4%5&2+())1++
7HERE +%,,*8 ; !%5+%,
AND +##*8 ; !%5+#
AND 1l8%$e ; !%58%$e.
I(T0 Clause3 Tar"et $tructure $uitable )or
Field 7ist
$ame t!e as
column read
INTO INTO 4% 4%5&2+())1++ 5&2+())1++
+%,,*8 +##*8 1l8%$e &e%$&"%B &e%$&++ +%,,*8 +##*8 1l8%$e &e%$&"%B &e%$&++
*aCsbc@00)occ
".e ,ro7ram must -ontain a 'ata obHe-t +it. a suitable ty,e *or ea-. -olumn t.at is reEuire' *rom a
'atabase table. =or ,ro7ram maintenan-e reasons0 you must use t.e -orres,on'in7 Di-tionary obHe-ts
to assi7n ty,es to t.e 'ata obHe-ts. ".e INTO -lause s,e-i*ies t.e 'ata obHe-t into +.i-. you +ant to
,la-e t.e 'ata *rom t.e 'atabase table. Fou -an use t.e INTO -lause in t+o 'i**erent +ays)
/sin. a #lat structure D Fou 'e*ine a stru-ture in your ,ro7ram t.at .as t.e same *iel's in t.e
same seEuen-e as t.e *iel' list in t.e SELECT -lause. Fou -an enter t.e name o* t.e stru-ture in
t.e INTO -lause. ".e -ontents are -o,ie' le*t Husti*ie'. ".e *iel' names o* t.e stru-ture are
'isre7ar'e' .ere.
/sin. in"i+i"ual "ata o&<ects DFou -an enter a set o* 'ata obHe-ts in t.e INTO -lause. =or
e:am,le)
DATA< &d_-a"d TYPE +!'"&;#.-a"d7
&d_-onn"d TYPE +!'"&;#.-onn"d7
&d_!'da#e TYPE +!'"&;#.!'da#e7
&d_+ea#+ma0 TYPE +!'"&;#.+ea#+ma07
&d_+ea#+o-- TYPE +!'"&;#.+ea#+o--%
START.OF.SELECTION%
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o--
FROM +!'"&;#
INTO D/85+%,,*8: /85+##*8: /851l8%$e: /85&e%$&"%B:
/85&e%$&++E
W/ERE %%%
SA A! "A#$0 $$%$0
,.,,
SAP AG 2003
I(T0 Clause3 $ame4(ame Fields o) Field 7ist in the
Tar"et $tructure
ABAP ro"ram
DATA 4%5&8.#5+## TYPE &8.#5+##.
SELECT SINGLE +%,,*8 +##*8 8e!$*"e
FROM &!1l*
INTO CORRESPONDING FIELDS OF 4%5&8.#5+##
7HERE +%,,*8 ; !%5+%,
AND +##*8 ; !%5+#.
6A(,T CA88I, C0((I, &&& ,/PTI6/
mandt carrid connid &&& detime
INTO CORRESPONDING FIELDS OF INTO CORRESPONDING FIELDS OF 4% 4%5 5&8.# &8.#5 5+## +##
+%,,*8 +##*8 8e!$*"e +%,,*8 +##*8 8e!$*"e
$ame t!e as
column read
1* you use t.e INTO CORRESPONDING FIELDS -lause0 t.e 'ata is ,la-e' in t.e *iel's +it. t.e
same name in t.e tar7et stru-ture.
A'vanta7es o* t.is -onstru-tion)
".e tar7et stru-ture 'oes not .ave to be stru-ture' le*t Husti*ie' in t.e i'enti-al +ay as t.e *iel'
list.
".is -onstru-tion is easy to maintain0 be-ause e:ten'in7 t.e *iel' list 'oes not reEuire ot.er
-.an7es to t.e ,ro7ram0 as lon7 as t.ere is a *iel' in t.e tar7et stru-ture t.at .as t.e same name
an' ty,e.
"o ,la-e 'ata in internal table -olumns o* t.e same name usin7 an array *et-.0 use t.e INTO
CORRESPONDING FIELDS OF TA'LE *$%2 statement.
SA A! "A#$0 $$%$$
,.,2
SAP AG 2003
$electin" ,ata From Client4$eci)ic Tables
CA..%4 C%(C/.M
AA
AA
!!!
!!!
AA
AA
!!!
!!!
AA
AA
7E; C.K
/.A7K/#.(
!!!
!!!
7E; C.K
/.A7K/#.(
!!!
!!!
7E; C.K
/.A7K/#.(
Transarent table $PF7I
C77%4
0039
002@
!!!
!!!
0039
002@
!!!
!!!
0039
002@
MA74(
@00
@00
!!!
!!!
@03
@03
!!!
!!!
@02
@02
SELECT * FROM &!1l*
INTO ...
7HERE +%,,*8 ; <AA<.
...
ENDSELECT.
SELECT * FROM &!1l*
CLIENT SPECIFIED
INTO ...
7HERE "%#8$ IN D()?: ()2E
AND +%,,*8 EQ <AA<.
...
ENDSELECT.
7o""ed on in client @003
CLIENT SPECIFIED CLIENT SPECIFIED
"%#8$ "%#8$
#it. -lient%s,e-i*i- 'atabase tables0 t.e *irst (ey+or' must al+ays be MA2D" or -lient @'ata ty,e
&62"A.
1* you sele-t 'ata *rom -lient%s,e-i*i- tables0 t.e system al*ays rea's t.e 'ata re-or's o* t.e lo.on
client0 unless ot.er+ise s,e-i*ie'. @".e A8A runtime system automati-ally -onverts t.e SELECT
statement.A
1* you +is. to e:,li-itly in-lu'e t.e -lient *iel' in t.e W/ERE -lause0 you must set t.e CLIENT
SPECIFIED a''ition a*ter t.e FROM -lause.
Sin-e t.is s,e-ial -ase is not relevant *or t.is -ourse0 t.e -lient *iel' is 7enerally omitte' *rom t.e
7ra,.i-s.
SA A! "A#$0 $$%$2
,.,3
SAP AG 2003
CA..%4 C%(C/.M C%(C(
AA
AA
!!!
!!!
*:
*:
!!!
!!!
#A
#A
!!!
7E; C.K
/.A7K/#.(
!!!
!!!
/.A7K/#.(
/.A7K/#.(
!!!
!!!
/.A7K/#.(
SA7 /.A7C%SC
!!!
Transarent table $PF7I
Per)ormance3 $econdar! Inde+
C77%4
0039
002@
!!!
!!!
0@00
0@02
!!!
!!!
0<@3
3>0@
!!!
SA7 /.A7C%SC
7E; C.K
!!!
!!!
7E; C.K
7E; C.K
!!!
!!!
SA7 /.A7C%SC
/.A7K/#.(
!!!
...
SELECT * FROM &!1l*
INTO ...
7HERE +*$.1," ; <FRANCFURT<.
...
C%(C/.M
$econdar! inde+
BE.*%7
BE.*%7
!!!
/.A7K/#.(
/.A7K/#.(
/.A7K/#.(
/.A7K/#.(
!!!
7E; C.K
7E; C.K
!!!
#.en you 7o to t.e 'e*inition o* a 'atabase table in t.e A8A Di-tionary0 you +ill see in*ormation
on all t.e te-.ni-al attributes o* t.e 'atabase table.
".e *ollo+in7 in*ormation is use*ul *or im,rovin7 t.e ,er*orman-e o* 'atabase a--esses)
2ey #iel"s D 1* t.e lines reEueste' *rom t.e 'atabase are retrieve' a--or'in7 to (ey *iel's0 t.e
Database 3,timi<er -an ,er*orm a--ess usin7 a ,rimary in'e:.
Secon"ary in"e( D 1* t.e lines reEueste' *rom t.e 'atabase are retrieve' a--or'in7 to *iel's0 t.e
Database 3,timi<er -an ,er*orm a--ess usin7 a se-on'ary in'e:. Se-on'ary in'e:es are
'is,laye' in a 'ialo7 bo: +.enever you sele-t +ndexes. Fou -.oose an in'e: *rom t.e 'ialo7
bo: by 'ouble%-li-(in7 it. ".e system t.en 'is,lays a s-reen +it. a''itional in*ormation about
t.at in'e:.
SA A! "A#$0 $$%$3
,.,4
SAP AG 2003
AuthoriEation Checks
8eadin" ,atabase Tables
8eadin" ,atabase Tables
AuthoriEation Checks
AuthoriEation Checks
Pre'ie*
Pre'ie*
SA A! "A#$0 $$%$4
,.,5
SAP AG 2003
AuthoriEation Checks in ABAP Pro"rams
AUTHORITY
CHECC
/es
(o
SELECT
5ser master
records
BC@00400
Pro)ile 1
Pro)ile 2
Pro)ile $CCA88I,
Pro)ile @
AuthoriEation )or
authoriEation
ob1ect $CCA88I,
AuthoriEation )or
authoriEation
ob1ect $CCA88I,
AuthoriEation )or
authoriEation
ob1ect $CTC0,/
SY6SU'RC
; )
?
$election
screen
(ote
Fou s.oul' ,ro7ram an aut.ori<ation -.e-( be*ore a--essin7 t.e 'atabase. ".e AUTHORITY6
CHECC statement *irst -.e-(s +.et.er t.e user .as t.e aut.ori<ation -ontainin7 all t.e reEuire'
values. A*ter t.e aut.ori<ation -.e-( is -om,lete'0 -.e-( t.e return -o'e. 1* it is 00 t.e user .as t.e
reEuire' aut.ori<ation an' t.e ,ro7ram -an be -ontinue'. 1* t.e value is not 00 t.e user 'oes not .ave
t.e reEuire' aut.ori<ation an' you s.oul' issue an a,,ro,riate messa7e.
6ater in t.is -ourse0 you +ill learn .o+ to ma(e *iel's on t.e sele-tion s-reen rea'y *or in,ut a7ain i*
you ,er*orm t.e aut.ori<ation -.e-( ri7.t a*ter t.e sele-tion s-reen an' .o+ to sen' a messa7e i* t.e
user 'oes not .ave t.e reEuire' aut.ori<ation
SA A! "A#$0 $$%$5
,.,6
SAP AG 2003
AuthoriEation 0b1ects and AuthoriEations
=,isla!= authoriEation
)or ob1ect $CCA88I,
*
)3
=Chan"e= authoriEation
)or ob1ect $CCA88I,
LH
)2
0b1ect $CCA88I,
CA88I, (Airline)
ACTHT (Acti'it!)
Acti'ities3
Create
Chan"e
,isla!
< 01
< 02
< 0#
All 'ata in t.e SA system must be ,rote-te' *rom unaut.ori<e' a--ess by users +.o 'o not
e:,li-itly .ave ,ermission to a--ess it.
".e system a'ministrator assi7ns user aut.ori<ations +.en maintainin7 user master 'ata. Durin7 t.is
,ro-ess0 you s.oul' 'etermine e:a-tly *hich "ata users are allo+e' to a--ess an' *hat 'in" o#
access s.oul' be allo+e'. =or e:am,le0 you mi7.t +ant to allo+ users to 'is,lay 'ata *or all airlines0
but allo+ t.em to -.an7e 'ata *or only -ertain ones. 1n t.is -ase0 t.e system must loo( *or a
-ombination o* t.e a-tivity @A&";"A an' airline -arrier @&ARR1DA *iel's ea-. time it ,er*orms an
aut.ori<ation -.e-(. 8ot. *iel's must be *ille' +it. values 'urin7 aut.ori<ation -reation as +ell @in
t.is e:am,le0 a-tivity (*ange an' airline -arrier LH or a-tivity 'isplay an' airline -arrier RA. Fou
-an ensure t.is by -reatin7 an authori9ation o&<ect -om,ose' o* t.e A&";" an' &ARR1D *iel's
t.at must be a--esse' bot. 'urin7 t.e aut.ori<ation assi7nment ,ro-ess an' +.enever your ,ro7ram
,er*orms an aut.ori<ation -.e-(.
Aut.ori<ation obHe-ts sim,ly 'e*ine t.e -ombination o* *iel's t.at nee' to be a''resse'
simultaneously an' serve as tem,lates *or bot. aut.ori<ations an' aut.ori<ation -.e-(s. ".ey are
or7ani<e' into obHe-t -lasses to ma(e it easier to *in' an' mana7e t.em. 3ne or more obHe-t -lasses
may be assi7ne' to ea-. a,,li-ation.
SA A! "A#$0 $$%$6
,.,7
SAP AG 2003
$!nta+3 AuthoriEation Check
8eort
results
01
02
0#
AA AD ,7 79 5A
+ + + + +
ACTHT
CA88I,
AuthoriEations
)or ob1ect $CCA88I,
AUTHORITY5CHECC AUTHORITY5CHECC
O'QECT <S5CARRID< O'QECT <S5CARRID<
ID <CARRID< FIELD <LH< ID <CARRID< FIELD <LH<
ID <ACT>T< FIELD <)2<. ID <ACT>T< FIELD <)2<.
Check
+ IF IF s! s!4 4subrc subrc (/ 0& (/ 0&
ENDIF. ENDIF.
Conte+t4deendent reaction to missin" authoriEation
#.en you -.e-( aut.ori<ations in ,ro7rams0 you s,e-i*y t.e obHe-t an' values t.e user nee's in a
,arti-ular aut.ori<ation to be able to a--ess t.e obHe-t in Euestion.
1n t.e above e:am,le0 t.ere is a -.e-( to 'etermine +.et.er t.e user .as aut.ori<ation *or t.e obHe-t
SDCARR5>A +.i-. .as t.e value E83E in t.e &ARR1D *iel' an' t.e value E02E @-.an7eA in t.e
A&";" *iel'. ".e abbreviations *or t.e ,ossible a-tivities are 'o-umente' in t.e table "A&" an'
also in t.e a,,ro,riate aut.ori<ation obHe-ts.
".e AUTHORITY6CHECC statement e:e-utes t.e aut.ori<ation -.e-( *or t.e user master re-or' an'
also issues t.e return -o'e. #.en evaluatin7 t.e return -o'e0 you -an s,e-i*y t.e -onseEuen-es o*
la-(in7 aut.ori<ation @*or e:am,le0 ,ro7ram terminates or s(i,s some in,ut linesA.
SA A! "A#$0 $$%$B
,.,8
SAP AG 2003
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< FIELD <5555555555<
ID <ACT>T< FIELD <5555555555<.
IF SY6SU'RC NE ).
ENDIF.
Imlementin" AuthoriEation Checks
&&&
&&&
A5T908IT;CC9/CF
&&&
&&&
%nsert pattern
$CCA88I,
IF IF &. &.6 6&02,+ &02,+ NE ). NE ).
Pattern
Insert
'alues
/'aluate
return code
Fou must s,e-i*y all *iel's o* t.e obHe-t in an A*T/ORITY.C/ECK statementI ot.er+ise you
re-eive a return -o'e not eEual to <ero. 1* you 'o not +ant to -arry out a -.e-( *or a ,arti-ular *iel'0
enter >/%%? a*ter t.e aut.ori<ation *iel'.
4:am,le) #.en a -.an7e transa-tion is -alle'0 it is a 7oo' i'ea to -.e-( +.et.er t.e user may
-.an7e t.e entries *or a ,arti-ular airline)
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< DUMMY
ID <ACT>T< FIELD <)2<.
".e most im,ortant return -o'es *or AUTHORITY6CHECC are)
0? ('e user 'as aut'oriDation containin0 t'e reGuired 8alues!
4) ".e user 'oes not .ave t.e reEuire' aut.ori<ation.
C) ".e -.e-( +as not su--ess*ul be-ause not all *iel's o* t.e aut.ori<ation obHe-t +ere
s,e-i*ie'.
".e (ey+or' 'o-umentation *or AUTHORITY6CHECC -ontains a -om,lete list o* ".e -.e-( +as
not su--ess*ul be-ause not all *iel's o* t.e aut.ori<ation obHe-t +ere s,e-i*ie'return -o'es.
SA A! "A#$0 $$%$C
,.,C
SAP AG 2003
Pre'ie*
8eadin" ,atabase Tables
8eadin" ,atabase Tables
AuthoriEation Checks
AuthoriEation Checks
Pre'ie*
Pre'ie*
SA A! "A#$0 $$%$9
,.20
SAP AG 2003
8eadin" 7inkable ,atabase Tables
MA74( CA..%4 C77%4 C%(C/.M
!!!
$PF7I
!!!
MA74( CA..%4CA..7AME
!!!
$CA88
!!! !!! !!!
!!! !!! !!!
!!! !!! !!!
Whick link condition should al! to a
common lineA
&!1l*6"%#8$ ; &+%,,6"%#8$
&!1l*6+%,,*8 ; &+%,,6+%,,*8
Which link condition Which link condition
Which columns are to be read2 and )rom *hich database tableA Which columns Which columns
Which database tables should be taken into accountA Which database tables Which database tables
$PF7I and $CA88
&!1l*6"%#8$
&!1l*6+%,,*8
&!1l*6+##*8
&!1l*6+*$.1,"
&+%,,6+%,,#%"e
Fou -an a--ess se+eral 'atabase tables usin7 one 'atabase Euery0 i* t.e 'atabse tables are lo7i-ally
relate'. "o 'o so0 you must s,e-i*y t.e *ollo+in7 in*ormation)
#.i-. 'atabase tables s.oul' be a--esse'P
#.at s.oul' t.e lin( -on'ition loo( li(eP 1n t.e 7ra,.i-0 -olumns *rom bot. 'atabase tables are
lin(e'. 1* all t.e *iel' values o* t.e lin(e' -olumns mat-.0 a re-or' is ,la-e' in a -ommon line in
t.e results table.
#.i-. -olumns are to be rea'P 1* a -olumn a,,ears in more t.an one 'atabase table0 you must
s,e-i*y t.e table *rom +.i-. t.is -olumn is to be rea'.
SA A! "A#$0 $$%20
,.2,
SAP AG 2003
ABAP ro"ram
,ictionar! Hie* and ABAP Join
7ink in the ABAP ro"ram usin" ABAP Join
7ink in 7ink in the ,ictionar! the ,ictionar!
ABAP ,ictionar! Hie*
7ink in 7ink in the Pro"ram the Pro"ram
SELECT ...
FROM &!1l* INNER QOIN &+%,,
ON &!1l*R+%,,*8 ; &+%,,R+%,,*8
7HERE ...
FROM INNER QOIN
ON
SELECT
Fou -an 'e*ine t.e lin( -on'itions eit.er stati-ally or 'ynami-ally.
Fou 'e*ine a static lin' or vie+ in t.e A8A Di-tionary. ".ere are several (in's o* vie+s. Fou
-an *in' in*ormation about vie+s in t.e SA 6ibrary un'er ,asis (omponents A,AP
3or-enc* ,( A,AP 'ictionary ;iews"
Fou im,lement a "ynamic lin' or an A8A Hoin usin7 A8A statements. ".e system 7enerates
an a,,ro,riate 'atabase Euery in t.e 'atabase inter*a-e at run time. =or more in*ormation0 see t.e
(ey+or' 'o-umentation *or t.e SELECT statement.
SA A! "A#$0 $$%2$
,.22
SAP AG 2003
Pre'ie*3 8eusable Comonents )or ,ata 8etrie'al
Business
0b1ect
7o"ical
,atabase
0b1ect
I
n
t
e
r
)
a
c
e
F
u
n
c
t
i
o
n
m
o
d
u
l
e
Function
"rou
%lobal
class
methods
BAPIs
1* reusable -om,onents t.at en-a,sulate -om,le: 'ata retrieval statements are available0 you s.oul'
use t.em. ".ere are *our te-.niEues *or reusin7 'ata retrieval -om,onents).
&allin7 met.o's o* 7lobal -lasses
&allin7 met.o's o* business obHe-ts
&allin7 *un-tion mo'ules
1n-lu'in7 lo7i-al 'atabases D 6o7i-al 'atabases are 'ata retrieval ,ro7rams t.at return lo7i-ally%
-onne-te' 'ata in a .ierar-.i-al seEuen-e.
Fou -an *in' in*ormation on t.ese te-.niEues in t.e a,,ro,riate units"
=or 'etaile' in*ormation on .o+ to in-lu'e lo7i-al 'atabases0 re*er to t.e SA 6ibrary un'er)
,asis (omponents A,AP Programming and 8untime Environment A,AP 'ataase Accesses
Logical 'ataases"
SA A! "A#$0 $$%22
,.23
SAP AG 2003
Pre'ie*3 ,atabase Accesses Initiatin" Chan"es
$/7/CT $/7/CT
INSERT INSERT
UPDATE UPDATE
DELETE DELETE
MODIFY MODIFY
1n a''ition to t.e S464&" statement0 3,en SQ6 -ontains t.e UPDATE7 INSERT7 DELETE0 an'
MODIFY statements.
Do not use t.ese 'ata base a--esses0 +.i-. initiate -.an7es in t.e 'atabase0 unless you un'erstan'
t.e SA transa-tion -on-e,t.
All 3,en SQ6 statements su,,ort t.e return -o'e sy)su&rc. 1* a 'atabase a--ess +as su--ess*ul0 t.e
return -o'e in t.e system *iel' sy)su&rc is 0I i* it +as not su--ess*ul0 t.e return -o'e is not 0.
=or more in*ormation about 3,en SQ6 statements0 re*er to t.e res,e-tive (ey+or' 'o-umentation.
SA A! "A#$0 $$%23
,.24
SAP AG 2003
7ist 'arious *a!s o) )indin" database tables
Pro"ram read access to seci)ic columns and
lines *ithin a articular database table
Imlement authoriEation checks
7ist the read access otions )or multile database
tables
(o* !ou are able to3
,ata 8etrie'al3 $ummar!
SA A! "A#$0 $$%24
,.25 >ata Retrie+al !(ercises
/nit$ >ata Retrie+al
Topic$ Rea"in. Se+eral Recor"s /sin. a 8oop
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
ro7ram loo, 'atabase a--esses
6imit t.e Euantity o* sele-te' 'ata in a--or'an-e +it. an in,ut
,arameter
4n.an-e your A8A ,ro7ram to issue *li7.t s-.e'ules so t.at only t.e
s-.e'ules o* t.e airline -arriers sele-te' by t.e user are 'is,laye'.
".e list s.oul' also in-lu'e t.e ,er-enta7e o--u,an-y o* ea-. *li7.t
s-.e'ule'.
"em,late) @'C())5AA5GS5LIST or
SAPBC400WBS_GS_LIST
ro7ram) @'C())5AA5SELECT5SFLIGHT
Mo'el solution) SAPBC400DDS_SELECT_SFLIG/T
## stan's *or t.e t+o%'i7it 7rou, number.
$%$ &o,y your e:e-utable ,ro7ram @'C())5AA5GS5LIST
@solution *or e:er-ise 2 in unit 30 1ntro'u-tion to t.e A8A #or(ben-.A or t.e
tem,late SAPBC400WBS_GS_LIST to t.e ne+ name
@'C())5AA5SELECT5SFLIGHT.
$%2 &.an7e t.e +or( area ty,e name @name su77estion) 4%51l*/-$A. 2o+ use t.e
7lobal stru-ture S0C400F6CC.
=in' out in*ormation on t.e -om,onents @*iel'sA o* t.is stru-ture.
$%3 De*ine an in,ut ,arameter *or t.e airline abbreviation.
$%4 2o+ sele-t only t.e *li7.ts *rom t.e 'atabase table SF8543T t.at belon7 to t.e
sele-te' airline.
Sele-t only t.ose *iel's t.at .ave a tar7et *iel' in t.e +or( area.
$%5 #it.in t.e loo, statement0 -al-ulate t.e ,er-enta7e o--u,an-y *or ea-. *li7.t.
Assi7n t.e result to t.e PERCENTAGE *iel' in your +or( area.
$%6 4:ten' your list out,ut to in-lu'e t.e ,er-enta7e o--u,an-y.
SA A! "A#$0 $$%25
$%B #.at is t.e *irst (ey *iel' in t.e trans,arent table SF8543TP
#.at is t.e *irst (ey *iel' in your ;3!R! -lauseP
Does t.e 'atabase inter*a-e still use t.e ,rimary in'e:P
SA A! "A#$0 $$%26
!(ercises
/nit$ >ata Retrie+al
Topic$ Fillin. an" Sortin. an 5nternal Ta&le
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
=ill an internal table +it. 'ata by a,,en'in7 'ata re-or's
Sort t.e -ontent o* an internal table
4n.an-e your A8A ,ro7ram *or t.e out,ut o* *li7.t 'e,arture times so
t.at t.e *li7.ts a,,ear in t.e list sorte' by ,er-enta7e o--u,an-y.
=or t.is ,ur,ose0 a,,en' t.e rea' 'ata re-or's *or t.e sele-te' airline
-arrier to an internal table.
"em,late) @'C())5AA5SELECT5SFLIGHT or
SAPBC400DDS_SELECT_SFLIG/T
ro7ram) @'C())5AA5SELECT5SFLIGHT5ITA'
Mo'el solution) SAPBC400DDS_SELECT_SFLIG/T_TAB
## stan's *or t.e t+o%'i7it 7rou, number.
2%$ &o,y your e:e-utable ,ro7ram @'C())5AA5SELECT5SFLIGHT
@solution *or e:er-ise $ in t.is unitA or t.e tem,late
SAPBC400DDS_SELECT_SFLIG/T to t.e ne+ name
@'C())5AA5SELECT5SFLIGHT5ITA'.
2%2 De*ine an internal table @name ,ro,osal) *$51l*/-$A usin7 a 7lobal table ty,e as
a basis t.at .as t.e 7lobal stru-ture S0C400F6CC as line ty,e.
9se t.e 3*ere-used list in t.e A8A Di-tionary to *in' a suitable
table ty,e.
2%3 =ill t.is internal table line by line by usin7 an INSERT statement in t.e SELECT
loo,. @Remove t.e statements *or list out,ut. Fou -an use t.e sour-e te:t a7ain
later.A
2%4 Sort t.e internal table by ,er-enta7e o--u,an-y an' 'is,lay t.e -ontents o* t.e
internal table in a loo, on a list.
SA A! "A#$0 $$%2B
!(ercises
/nit$ >ata Retrie+al
Topic$ Authori9ation Chec'
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
1m,lement aut.ori<ation -.e-(s
Set u, t.e ,ro7ram *lo+ in a variable manner 'e,en'in7 on t.e
out-ome o* t.e aut.ori<ation -.e-(
4n.an-e your A8A ,ro7ram so t.at t.e *li7.ts -an be rea' an'
'is,laye' only i* t.e user .as 'is,lay aut.ori<ation *or t.e sele-te'
airline.
"em,lates) @'C())5AA5SELECT5SFLIGHT an'
@'C())5AA5SELECT5SFLIGHT5ITA'
SAPBC400DDS_SELECT_SFLIG/T an'
SAPBC400DDS_SELECT_SFLIG/T_TAB
ro.rams) @'C())5AA5AUTHORITY5CHECC an'
@'C())5AA5AUTHORITY5CHECC52
Mo'el solutions) SAPBC400DDS_A*T/ORITY_C/ECK an'
SAPBC400DDS_A*T/ORITY_C/ECK_5
AA stan"s #or the t*o)"i.it .roup num&er.
3%$ &o,y your e:e-utable ,ro7rams
@'C())5AA5SELECT5SFLIGHT @solution *or e:er-ise $ in t.is unitA an'
@'C())5AA5SELECT5SFLIGHT5ITA' @solution *or e:er-ise 2 in t.is unitA or
t.e tem,lates SAPBC400DDS_SELECT_SFLIG/T an'
SAPBC400DDS_SELECT_SFLIG/T_TAB to t.e ne+ names
@'C())5AA5AUTHORITY5CHECC an' @'C())5AA5AUTHORITY5CHECC52.
3%2 ro7ram an aut.ori<ation -.e-( *or t.e aut.ori<ation obHe-t SDCARR5>. &.e-( t.e
-ombination o* sele-te' airline an' a-tivity 'isplay.
9se t.e res,e-tive Pattern statement in t.e A8A 4'itor.
Sear-. *or t.e -orre-t abbreviation o* t.e a-tivity to be -.e-(e'.
3%3 De*ine a -onstant *or t.e abbreviation o* t.e a-tivity S'isplayT @name ,ro,osal
%+$v$58*&!l%.A. 9se ACT51DA/T3 *or ty,in7 t.e 'ata element an' use t.is
-onstant 'urin7 t.e aut.ori<ation -.e-(.
SA A! "A#$0 $$%2C
3%4 4:e-ute t.e 'atabase a--ess only i* t.e user .as 'is,lay aut.ori<ation *or t.e
sele-te' airline. 1* t.is is not t.e -ase0 'is,lay an a,,ro,riate error messa7e on t.e
list.
3%5 4:e-ute your ,ro7ramsI sele-t t.e airline abbreviations .LAAL an' L/AL.
SA A! "A#$0 $$%29
,.26>ata Retri+al Solutions
/nit$ >ata Retrie+al
Topic$ Rea"in. Se+eral Recor"s /sin. a 8oop
$%2 ".e 7lobal stru-ture S'C())FOCC .as t.e *ollo+in7 -om,onents)
CARRID +it. ty,e S5CARR5ID
CONNID +it. ty,e S5CONN5ID
FLDATE +it. ty,e S5DATE
SEATSMAX +it. ty,e S5SEATSMAX
SEATSOCC +it. ty,e S5SEATSOCC
PERCENTAGE +it. ty,e S5FLGHTOCC.
$%B ".e MANDT *iel' in SF8543T is mar(e' as a (ey *iel'. ".e 7HERE -on'ition
'oes not nee' t.is *iel'. Des,ite t.is *a-t0 t.e 'atabase inter*a-e -an use t.e ,rimary
in'e: in t.is -ase *or sele-tin7 t.e 'ata re-or's.
Reason$
#.en t.e A8A runtime system a--esses a -lient%s,e-i*i- table0 it assumes t.at
'ata s.oul' be ta(en into a--ount only i* it belon7s to t.e -lient un'er +.i-. t.e
user is lo77e' on. ".us0 by 'e*ault0 t.e 'atabase inter*a-e en.an-es t.e 7HERE
-on'ition +it. a 7HERE "%#8$ ; &.6"%#8$ -on'ition.
SA A! "A#$0 $$%30
$ Mo'el solution)
REPORT &%!2+())88&5&ele+$5&1l*/-$ .
DATA: 4%51l*/-$ TYPE &2+())1++:
PARAMETERS: !%5+%, TYPE &5+%,,5*8.
: Se'e-# a'' da#a+e#+ !om da#a(a+e #a('e SFLIG/T
: -oe+pond"n& #o -a"e PA_CAR<
SELECT +%,,*8 +##*8 1l8%$e &e%$&"%B &e%$&++
FROM &1l*/-$
INTO CORRESPONDING FIELDS OF 4%51l*/-$
7HERE +%,,*8 ; !%5+%,.
: Ca'-,'a#e o--,pa#"on o! ea-; !'"&;#:
4%51l*/-$6!e,+e#$%/e ;
?)) * 4%51l*/-$6&e%$&++ / 4%51l*/-$6&e%$&"%B.
: Cea#e L"+#<
7RITE: / 4%51l*/-$6+%,,*8:
4%51l*/-$6+##*8:
4%51l*/-$61l8%$e:
4%51l*/-$6&e%$&"%B:
4%51l*/-$6&e%$&++:
4%51l*/-$6!e,+e#$%/e:
<O<.
ENDSELECT.
SA A! "A#$0 $$%3$
Solutions
/nit$ >ata Retrie+al
Topic$ Fillin. an" sortin. an internal ta&le
2 Mo'el solution)
REPORT &%!2+())88&5&ele+$5&1l*/-$5$%2.
DATA: 9a_!'"&;# TYPE +(-400!o--7
*$51l*/-$ TYPE &2+())5$5&2+())1++.
PARAMETERS< pa_-a TYPE +_-a_"d%
: +e'e-# a'' da#a+e#+ !om da#a(a+e #a('e SFLIG/T
: -oe+pond"n& #o -a"e
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o--
FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a%
: -a'-,'a#e o--,pa#"on o! ea-; !'"&;#
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
: append +"n&'e '"ne "n#o "n#ena' #a('e
INSERT 4%51l*/-$ INTO TA'LE *$51l*/-$.
: a'#ena#"3e'$7 $o, -o,'d ,+e #;e APPEND +#a#emen#7
: "! $o, ae ,+"n& +#andad #a('e+<
:
: APPEND 9a_!'"&;# TO "#_!'"&;#%
ENDSELECT%
: +o# "n#ena' #a('e
SORT *$51l*/-$ 'Y !e,+e#$%/e.
: -ea#e '"+# !om +o#ed "n#ena' #a('e
LOOP AT *$51l*/-$ INTO 4%51l*/-$.
7RITE: / 4%51l*/-$6+%,,*8:
4%51l*/-$6+##*8:
4%51l*/-$61l8%$e:
4%51l*/-$6&e%$&++:
4%51l*/-$6&e%$&"%B:
4%51l*/-$6!e,+e#$%/e:<O<.
ENDLOOP.
SA A! "A#$0 $$%32
Solutions
/nit$ >ata Retrie+al
Topic$ Authori9ation Chec's
3 Mo'el solution)
REPORT &%!2+())88&5%0$-,*$.5+-e+N.
CONSTANTS %+$v$58*&!l%. TYPE %+$*v5%0$- >ALUE <)3<.
DATA 9a_!'"&;# TYPE +(-400!o--%
PARAMETERS pa_-a TYPE +_-a_"d%
: a,#;o"#$.-;e-8<
: I+ ,+e a,#;o"?ed #o d"+p'a$ da#a !o -a"e PA_CAR@
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< FIELD !%5+%,
ID <ACT>T< FIELD %+$v$58*&!l%..
CASE &.6&02,+.
: ,+e "+ a,#;o"?ed
7HEN ).
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o--
FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a%
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
WRITE< > 9a_!'"&;#.-a"d COLOR COL_KEY7
9a_!'"&;#.-onn"d COLOR COL_KEY7
9a_!'"&;#.!'da#e COLOR COL_KEY7
9a_!'"&;#.+ea#+o--7
9a_!'"&;#.+ea#+ma07
9a_!'"&;#.pe-en#a&e7ABA%
ENDSELECT%
: ,+e "+ no# a,#;o"?ed o
: o#;e eo o! a,#;o"#$.-;e-8
7HEN OTHERS.
7RITE: / <A0$-,*$.6C-e+N E,,,<D))?E.
ENDCASE.
@REPORT +ap(-400dd+_a,#;o"#$_-;e-8_5 analo7A.
SA A! "A#$0 $$%33
2
SAP AG 2003
,e)inin" $ubroutines
Inter)ace Parameters
Hisibilit!
Callin" $ubroutines
$ubroutines in ,ebu""in" 6ode
Contents3
Internal Pro"ram 6odulariEation *ith $ubroutines
SA A! "A#$0 $2%$
2.2
SAP AG 2003
,e)ine subroutines
Call subroutines
Anal!Ee the e+ecution o) subroutines in
debu""in" mode
At the conclusion o) this unit2 !ou *ill be able to3
Internal Pro"ram 6odulariEation *ith $ubroutines3
5nit 0b1ecti'es
SA A! "A#$0 $2%2
2.3
SAP AG 2003
ABAP ro"ram
Calls and Inter)aces
#0&00
Percenta0e
occupied
BB&B0
Sales ratio
Inter)ace Inter)ace
$ubroutine
200
(otal seats
1000
%nGuiries
?0
ccupied seats
BBB
Bookin0s
PERFORM ...
PERFORM ...
FORM ...
* .................... +%l+0l%$e !e,+e#$%/e ...
ENDFORM.
Actual arameters
Formal arameters
A su&routine is an internal mo'ule +it.in a ,ro7ram. 1n a subroutine0 you li*t ,arts o* a ,ro7ram
out o* t.e main ,ro7rammin7 blo-( an' ,ut t.em some+.ere else. ".is ma(es your ,ro7ram easier
to rea' an' allo+s you to use t.ese -o'e se7ments more t.an on-e.
Fou -an ,ass 'ata to t.e subroutine an' ba-( t.rou7. its inter*a-e. ".is allo+s you to -all t.e same
*un-tion *or 'i**erent 'ata obHe-ts. ".e e:am,le in t.e 7ra,.i- s.o+s a subroutine t.at -al-ulates a
,er-enta7e. ".is subroutine is -alle' several times0 even t.ou7. 'i**erent 'ata obHe-ts are ,asse' to
t.e inter*a-e in ea-. -ase.
9sin7 subroutines ma(es your ,ro7ram more #unction oriente") it s,lits t.e ,ro7ramYs tas( into
sub*un-tions so t.at ea-. subroutine is res,onsible *or one sub*un-tion.
".is 7enerally ma(es ,ro7rams easier to maintain. 1n t.e Debu77er0 you -an e:e-ute t.e
subroutines in ba-(7roun' so t.at you see only t.e result. ".is usually ma(es it easier to *in' t.e
sour-e o* t.e error.
".e structure o# a su&routine in-lu'es t.e *ollo+in7)
4a-. subroutine starts +it. FORM an' en's +it. ENDFORM.
".e name o* t.e subroutine is *ollo+e' by t.e inter*a-e 'e*inition.
".e statements t.at t.e subroutine e:e-utes -ome bet+een =3RM an' 42D=3RM.
SA A! "A#$0 $2%3
2.4
SAP AG 2003
Wa!s o) Passin" Inter)ace Parameters
Passes an address Passes a 'alue Passes and returns a 'alue
Call4b!4'alue Call4b!4re)erence Call4b!4'alue4and4result
Fou s,e-i*y .o+ t.e 'ata is ,asse' *rom t.e main ,ro7ram @actual parametersA to t.e subroutine
@#ormal parametersA in t.e inter*a-e o* t.e subroutine. Fou -an 'o t.is in t.ree +ays?
Call)&y)+alue D A local copy o* t.e a-tual ,arameter is ,asse' to t.e subroutine. ".is means
t.at value assi7nments to t.e *ormal ,arameter .ave a&solutely no e##ect on t.e a-tual
,arameter.
Call)&y)re#erence D A "ere#erence" a""ress o* t.e a-tual ,arameter is ,asse' to t.e
subroutine. ".is means t.at value assi7nments to t.e *ormal ,arameter "irectly a##ect t.e a-tual
,arameter. ".e value o* t.e a-tual ,arameter is ,.ysi-ally -.an7e' by t.e subroutine t.rou7.
t.e a''ress.
Call)&y)+alue)an")result D A local copy o* t.e a-tual ,arameter is ,asse' to t.e subroutine
an' a +alue is passe" &ac' to t.e main ,ro7ram only i* t.e 42D=3RM statement is e:e-ute'.
".is means t.at value assi7nments to t.e *ormal ,arameter a**e-t t.e a-tual ,arameter only
a#ter they ha+e le#t the su&routine. &.oose t.is o,tion i* you +ant to ma(e sure t.at t.e a-tual
,arameter is not -.an7e' i* t.e subroutine is terminate' ,rematurely.
SA A! "A#$0 $2%4
2.5
SAP AG 2003
Passin" Inter)ace Parameters3 $!nta+
FORM &02,0$*#e5#%"e USING v%l0eD1?E ...
CHANGING 12 ...
v%l0eD13E ... .
...
ENDFORM.
f3 f2 f3
PERFORM &02,0$*#e5#%"e USING %?
CHANGING %2
%3.
a3 a2 a3
USING USING v%l0e v%l0eD D E E
v%l0e v%l0eD D E E
CHANGING CHANGING
USING USING
CHANGING CHANGING
1n t.e inter*a-e 'e*inition0 you list t.e #ormal parameters o* t.e 'i**erent sorts an' assi7n a ty,e
to ea-. one. ".e se=uence o# parameters is *i:e') *irst you name all t.e USING ,arameters0 t.en
you name all t.e CHANGING ,arameters. #it.in t.e subroutine0 you a''ress t.e 'ata t.at .as been
,asse' usin7 t.e *ormal ,arameters.
".e a-tual ,arameters are 7rou,e' by *SING an' C/ANGING +.en t.e subroutine is -alle'.
Fou s,e-i*y t.e +ay in +.i-. t.e ,arameters are to be ,asse' in t.e inter*a-e 'e*inition)
Call)&y)+alue @1?A D Fou list t.ese ,arameters a*ter t.e *SING (ey+or' an' -om,lete t.em
+it. t.e v%l0eD!4E a''ition.
Call)&y)re#erence @12A D Fou list t.ese ,arameters a*ter t.e C/ANGING (ey+or'. @=or
'o-umentation ,ur,oses0 you -an also list a ,ass%by%re*eren-e ,arameter a*ter *SING.
"e-.ni-ally0 *SING an' C/ANGING .ave e:a-tly t.e same e**e-t. @>o+ever0 i* you -.an7e a
,arameter liste' a*ter *SING in t.e subroutine0 you re-eive a +arnin7 in t.e 4:ten'e' ro7ram
&.e-(.A
Call)&y)+alue)an")result @13A D Fou list t.ese ,arameters a*ter t.e C/ANGING (ey+or' an'
-om,lete t.em +it. t.e v%l0eD!6E a''ition
SA A! "A#$0 $2%5
2.6
SAP AG 2003
Inter)ace Parameters3 $eci)ied and Inherited T!es
TYPES $5!e,+ TYPE ! DECIMALS 2.
DATA: %? TYPE ...:
%2 TYPE ...:
%3 TYPE ... .
...
PERFORM +%l+5!e,+ USING %?
%2
CHANGING %3.
FORM +%l+5!e,+
USING
v%l0eD15!%,$E TYPE *
v%l0eD15%llE TYPE *
CHANGING
v%l0eD15!+E TYPE $5!e,+.
CHECC 15%ll LM ).
15!+ ; 15!%,$ * ?)) / 15%ll.
ENDFORM.
DATA: %? TYPE ...:
%2 TYPE ...:
%3 TYPE ... .
...
PERFORM +%l+5!e,+ USING %?
%2
CHANGING %3.
FORM +%l+5!e,+
USING
v%l0eD15!%,$E TYPE ANY
v%l0eD15%llE TYPE ANY
CHANGING
v%l0eD15!+E TYPE ANY.
CHECC 15%ll LM ).
15!+ ; 15!%,$ * ?)) / 15%ll.
ENDFORM.
TYPE * TYPE *
TYPE * TYPE *
TYPE $5 TYPE $5!e,+ !e,+
$eci)ied t!e Inherited t!e
8isk o) t!e con)licts
".e 'ata obHe-ts ,asse' to a subroutine @t.at is0 t.e a-tual ,arametersA -an be o# any type. 1* you
use elementary types0 you -an 'e-i'e +.et.er or not you +ant to s,e-i*y t.e ty,e o* t.e *ormal
,arameters.
8y s,e-i*yin7 t.e ty,e o* t.e *ormal ,arameters0 you ensure t.at only a-tual ,arameters o* t.at
ty,e -an be ,asse' to t.e subroutine. ".is ma(es your ,ro7ram more stable be-ause t.e synta:
-.e-( +ill *in' any ty,e -on*li-ts.
1* you use t.e TYPE ANY a''ition0 you leave t.e ty,e uns,e-i*ie'. @=or -om,atibility reasons0 you
-an also omit t.is a''ition.A 1n t.is -ase0 t.e *ormal ,arameter in.erits t.e ty,e *rom t.e a-tual
,arameter at run time. 1* t.e statements in t.e subroutine are not suite' to t.e in.erite' ty,e0 a
runtime error may o--ur.
1* you assi7n t.e ty,es !0 #0 + or B0 t.e missin. ty,e attributes are similarly Lin.erite'L at run time.
1* you +ant to s,e-i*y a ty,e -om,letely0 you must use a user%'e*ine' ty,e. 1* you use &$,*#/ or
B&$,*#/0 t.e ty,e is not *ully s,e-i*ie' until run time.
&onversely0 t.e ty,es *0 10 80 an' $ are *ully ty,e'.
SA A! "A#$0 $2%6
2.7
SAP AG 2003
Inter)ace Parameters3 $eci)!in" T!es )or
$tructures and Internal Tables
DATA 4%51l*/-$*#1
TYPE &2+())1++.
...
PERFORM 1*ll54%
CHANGING 4%51l*/-$*#1.
FORM 1*ll54%
CHANGING
154% TYPE &2+())1++.
154%6+%,,*8 ; ... .
154%6+##*8 ; ... .
ENDFORM.
DATA *$51l*/-$*#1
TYPE &2+())5$5&2+())1++.
...
PERFORM 1*ll5*$%2
CHANGING *$51l*/-$*#1.
FORM 1*ll5*$%2
CHANGING
15*$%2 TYPE &2+())5$5&2+())1++.
LOOP AT 15*$%2 ... .
...
ENDLOOP.
ENDFORM.
TYPE &2+())1++ TYPE &2+())1++ TYPE &2+())5$5&2+())1++ TYPE &2+())5$5&2+())1++
Table t!e $tructure t!e
Address the arameter as
an internal table
Address the structure
comonents
1* you use structures or internal ta&les as *ormal ,arameters0 you must ty,e t.em *ully. ".is allo+s
you to a--ess t.ese *ormal ,arameters +it.in t.e subroutine.
".e -om,onents o* stru-tures are (no+n in t.e subroutine0 as a result o* t.e assi7ne' ty,e0 so t.at
you -an a''ress t.ese -om,onents +it. t.e usual synta:.
1* you use internal tables0 t.e assi7ne' ty,e allo+s you to a''ress t.e *ormal ,arameter as an
internal ta&le +it. t.e usual synta:.
-ote on per#ormance)
1* you use internal ta&les as ,arameters0 you s.oul' 7enerally ,ass t.em usin7 pass)&y)re#erence.
3t.er+ise0 t.e system -an use -onsi'erable resour-es sim,ly -o,yin7 t.em to t.e subroutine.
SA A! "A#$0 $2%B
2.8
SAP AG 2003
Hisibilit! o) %lobal and 7ocal ,ata 0b1ects
...
PERFORM 1*ll5*$%2 CHANGING *$51l*/-$*#1.
FORM 1*ll5*$%2
CHANGING
15*$%2 TYPE &2+())5$5&2+())1++.
DATA l54% LICE LINE OF 15*$%2.
LOOP AT 15*$%2 INTO l54%.
...
ENDLOOP.
ENDFORM.
Hisible "loball!
Hisible locall!
DATA: *$51l*/-$*#1 TYPE &2+())5$5&2+())1++:
4%51l*/-$*#1 TYPE &2+())1++:
... .
DATA DATA
Fou -an 'e*ine local "ata +it.in a subroutine.
8ot. t.e *ormal ,arameters an' t.e lo-al 'ata obHe-ts are a-tive only at t.e run time o* t.e
subroutine. ".is means t.at memory is allo-ate' only +.en t.e subroutine is -alle' an' is release'
as soon as t.e subroutine .as been e:e-ute'. ".us t.ese ,arameters an' 'ata obHe-ts -an be
a''resse' only *rom +it.in t.e subroutine.
".e 7lobal 'ata obHe-ts *rom t.e main ,ro7ram -an also be a''resse' *rom t.e subroutine.
>o+ever0 you s.oul' avoi' 'oin7 t.is +.erever ,ossible. 3t.er+ise0 you by,ass t.e inter*a-e0
+.i-. ma(es t.e ,ro7ram more ,rone to errors.
1* a lo-al 'ata obHe-t or *ormal ,arameter .as t.e same name as a 7lobal 'ata obHe-t0 t.e A0A
runtime system a''resses t.e lo-al 'ata obHe-t in t.e subroutine an' t.e 7lobal one outsi'e it.
".ese obHe-ts are t.en (no+n as locally o&scure" obHe-ts.
Summary o* .ints about 7obal an' lo-al 'ata obHe-ts)
A''ress t.e 7lobal 'ata obHe-ts in t.e main ,ro7ram an' ,ass t.em to t.e subroutine usin7 t.e
inter*a-e.
A''ress only *ormal ,arameters an' lo-al 'ata obHe-ts in t.e subroutine.
=or -larity0 avoi' usin7 i'enti-ally name' 7lobal an' lo-al variables. 1nstea'0 use a sim,le
,re*i:0 su-. as 15 *or *ormal ,arameters an' l5 *or lo-al 'ata obHe-ts.
SA A! "A#$0 $2%C
2.C
SAP AG 2003
$!nta+ /+amle3 Passin" an Internal Table
DATA: *$51l*/-$*#1 TYPE &2+())5$5&2+())1++:
4%51l*/-$*#1 TYPE &2+())1++:
l*#e& TYPE *.
...
PERFORM +0#$5l*#e& USING *$51l*/-$*#1
<LH<
CHANGING l*#e&.
FORM +0#$5l*#e& USING 15*$%2 TYPE &2+())5$5&2+())1++
15+%,, TYPE &2+())1++6+%,,*8
CHANGING v%l0eD15l*#e&E TYPE *.
DATA l54% LICE LINE OF 15*$%2.
CLEAR 15l*#e&.
LOOP AT 15*$%2 INTO l54%
7HERE +%,,*8 ; 15+%,,.
ADD ? TO 15l*#e&.
ENDLOOP.
ENDFORM.
".e e:am,le in t.e 7ra,.i- s.o+s a main ,ro7ram -allin7 a subroutine0 +.i-. s,e-i*ies t.e
number o* lines o* an internal table nee'e' to *ul*ill a s,e-i*i- -riterion.
".e internal table0 15*$%20 an' t.e -om,arison value0 15+%,,0 are ,asse' by re*eren-e to
im,rove ,er*orman-e. ".e number o* lines0 15l*#e&0 is ,asse' by value%an'%result.
"o loo, t.rou7. t.e internal table0 you nee' a +or( area +it. a -om,atible line ty,e0 +.i-. you
'e*ine lo-ally in t.e subroutine0 by ma(in7 a re*eren-e to t.e *ormal ,arameter.
SA A! "A#$0 $2%9
2.,0
SAP AG 2003
Callin" $ubroutines
$!stem 9el $!stem 9el
D00CF086
A.AP Editor !"anging t"e Report 011+2$RM
$ubroutines
C05(TC7I(/$
FORM +0#$5l*#e&
USING 15*$%2 TYPE ...
15+%,, TYPE ...
CHANGING v%l0eD15l*#e&E TYPE ... .
...
ENDFORM.
PERFORM +0#$5l*#e&
USING
15*$%2
15+%,,
CHANGING
15l*#e&.
2 3
Adat the actual
arameters
N
1 3
=dra"4and4dro=
A subroutine is -alle' usin7 t.e PERFORM statement.
#.en t.e subroutine is -alle'0 ,arameters are ,asse' to it in strict se=uence.
=or t.is reason0 you s.oul' 'e*ine t.e subroutine *irst an' t.en -all it. ".e 3bHe-t 2avi7ator
su,,orts you in t.is res,e-t) Fou -an 7enerate t.e PERFORM statement by 'ra77in7 t.e subroutine
*rom t.e navi7ation area to t.e e'itor area.
Alternatively0 you -an 7enerate t.e -all usin7 t.e Pattern *un-tion in t.e A8A 4'itor.
".is ,revents you *rom mi:in7 u, or *or7ettin7 any ,arameters. >o+ever0 you must remember to
re,la-e t.e *ormal ,arameters +it. a-tual ,arameters.
SA A! "A#$0 $2%$0
2.,,
SAP AG 2003
$ubroutines in ,ebu""in" 6ode
,ariant
FIIEK#.SE000
FIIE/.MS
3 @ +
,ariant

FORM +0#$5l*#e& USING 15*$%2 TYPE ...


15+%,, TYPE ...
CHANGING v%l0eD15l*#e&E TYPE ... .
DATA l54% LICE LINE OF 15*$%2.
/i"ed point arit'metic
3> 30 +
M
$AP
;atc'point
A.AP Debugger

ch*s ch*s
SC+S#B.C SC+(AB%M SC+4BC7( 0 0 3
)Ccarr 79
/+ecute
8eturn
1n 'ebu77in7 mo'e0 you -an ma(e a subroutine run +it.out sto,,in7. ".e e:e-ution o* t.e main
,ro7ram 'oes not sto, until a*ter t.e subroutine .as been e:e-ute'.
Alternatively0 you -an e:e-ute t.e subroutine statement by statement usin7 Single Step"
1* t.e -urrent statement is lo-ate' in a subroutine0 you -an run t.e rest o* t.e subroutine +it.out it
sto,,in7 by sele-tin7 8eturn 7F</. 4:e-ution o* t.e main ,ro7ram 'oes not sto, until a*ter t.e
subroutine is e:e-ute'.
SA A! "A#$0 $2%$$
2.,2
SAP AG 2003
,e)ine subroutines
Call subroutines
Anal!Ee the e+ecution o) subroutines in
debu""in" mode
;ou are no* able to3
Internal Pro"ram 6odulariEation *ith $ubroutines3
5nit $ummar!
SA A! "A#$0 $2%$2
2.,3%o"ulari9ation !(ercises
/nit$ 5nternal ro.ram %o"ulari9ation
Topic$ Su&routines
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate subroutines
9se t.e subroutine inter*a-e to ,ass 'ata
&.an7e your ,ro7ram @'C())5AA5SELECT5SFLIGHT5ITA' @or t.e
-orres,on'in7 mo'el solutionA so t.at t.e 'is,lay o* t.e 'ata in a list is
en-a,sulate' in a subroutine.
Template$ @'C())5AA5AUTHORITY5CHECC52 o
SAP'C())DDS5AUTHORITY5CHECC52
ro.ram$ @'C())5AA5SU'ROUTINE
%o"el solution$ SAP'C())P'S5SU'ROUTINE
$%$ &o,y your ,ro7ram @'C())5AA5AUTHORITY5CHECC52 or t.e -orres,on'in7
mo'el solution SAP'C())DDS5AUTHORITY5CHECC52 to t.e ne+ ,ro7ram
@'C())5AA5SU'ROUTINE.
$%2 4n-a,sulate t.e 'is,lay o* 'ata in a list in a subroutine. &all t.e subroutine
@su77este' name) 7RITE5LISTA a*ter t.e SELECT loo,. ass t.e internal table
-ontainin7 t.e 'ata t.at .as been rea' usin7 t.e inter*a-e.
$%3 De*ine t.e subroutine an' s,e-i*y ty,es *or t.e inter*a-e ,arameters.
$%4 Dis,lay t.e 'ata *rom t.e subroutine usin7 a LOOPS ENDLOOP stru-ture. "o 'o
t.is0 -reate t.e reEuire' table +or( area as a lo-al 'ata obHe-t in t.e subroutine. "o
s,e-i*y t.e ty,e o* t.e lo-al stru-ture0 use t.e A8A statement DATA 19a2
LICE LINE OF 1"#a(2.
SA A! "A#$0 $2%$3
2.,4%o"ulari9ation Solutions
/nit$ 5nternal ro.ram %o"ulari9ation
Topic$ Su&routines
%o"el solution SA0C4000SDS/0R6/T5-!
:C..............................................................:
:C Repo# SAPBC400PBS_S*BRO*TINE :
:C :
RG%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%R
REPORT +ap(-400p(+_+,(o,#"ne%
&32S"A2"S a-tvtO'is,lay "F4 a-tivOaut. ;A694 Y03Y.
DATA< 9a_!'"&;# TYPE +(-400!o--7
"#_!'"&;# TYPE +(-400_#_+(-400!o--%
PARAMETERS< pa_-a TYPE +!'"&;#.-a"d%
S"AR"%3=%S464&"132.
* A0$-,*$.6C-e+N:
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD pa_-a
ID AACT)TA FIELD a-#3#_d"+p'a$%
CASE +$.+,(-%
: *+e "+ a,#;o"?ed
W/EN 0%
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o-- FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a%
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
APPEND 9a_!'"&;# TO "#_!'"&;#%
ENDSELECT%
4R=3RM +riteOlist 9S12! itO*li7.t.
: *+e "+ no# a,#;o"?ed o o#;e eo o! a,#;o"#$.-;e-8
W/EN OT/ERS%
WRITE< > AA,#;o"#$.C;e-8 EoAE004F%
ENDCASE%
*T66666666666666666666666666666666666666666666666666666666666666*
*T F," 7RITE5LIST
SA A! "A#$0 $2%$4
*T66666666666666666666666666666666666666666666666666666666666666*
* $eB$
*666666666666666666666666666666666666666666666666666666666666666*
* 66MP5IT5FLIGHT $eB$
*666666666666666666666666666666666666666666666666666666666666666*
FORM 4,*$e5l*&$ USING !5*$51l*/-$ TYPE &2+())5$5&2+())1++.
DATA: 4% LICE LINE OF !5*$51l*/-$.
LOOP AT !5*$51l*/-$ INTO 4%.
7RITE: / 4%6+%,,*8 COLOR COL5CEY:
4%6+##*8 COLOR COL5CEY:
4%61l8%$e COLOR COL5CEY:
4%6&e%$&++:
4%6&e%$&"%B:
4%6!e,+e#$%/e:<O<.
ENDLOOP.
ENDFORM. 9 7RITE5LIST
SA A! "A#$0 $2%$5
3
SAP AG 2003
/+ecution o) /'ent Blocks b! the ABAP 8untime
$!stem
/'ent Block 70A,40F4P80%8A6 (I(ITIA7IDATI0()
/'ent Block $TA8T40F4$/7/CTI0(
Contents3
The ABAP 8untime $!stem
SA A! "A#$0 $3%$
3.2
SAP AG 2003
,escribe the e'ent4controlled rocesses )or
e+ecutin" an ABAP ro"ram
5se the e'ent block 70A,40F4P80%8A6
(I(ITIA7IDATI0()
5se the e'ent block $TA8T40F4$/7/CTI0(
At the conclusion o) this unit2 !ou *ill be able to3
The ABAP 8untime $!stem3 5nit 0b1ecti'es
SA A! "A#$0 $3%2
3.3
SAP AG 2003
Possible /lements in an ABAP Pro"ram
/'ent
block
$ubroutine
ro"ram
Inter)ace
/'ent
block
$creen
Process
Be)ore
0utut
Process
A)ter
Inut
7ocal t!e and )ield
de)initions
$election screen
6odule
6odule
/'ent
block
/'ent
block
An A8A ,ro7ram is a -olle-tion o* ,ro-essin7 blo-(s. A ,ro-essin7 blo-( -onsists o* ,assive
sour-e -o'e se-tions t.at are ,ro-esse' seEuentially +.en -alle'.
ro-essin7 blo-(s are t.e smallest units in A8A. ".ey -annot be s,lit0 +.i-. also means t.at t.ey
-annot be neste'.
".ere are various (in's o* A8A ,ro-essin7 blo-(s)
!+ent &loc's are ,ro-essin7 blo-(s t.at are -alle' by t.e A8A runtime system +.enever t.e
res,e-tive event is initiate'. Su-. events -an be initiate' by t.e A8A runtime system itsel* or by
t.e user.
Su&routines are ,ro-essin7 blo-(s t.at are -alle' by A8A statements. ".e 'evelo,er -ontrols
subroutines.
%o"ules are s,e-ial A8A ,ro-essin7 blo-(s t.at are -alle' by s-reen statements. ".ese are
reEuire' *or s-reen ,ro-essin7.
#.enever a ,ro7ram is starte'0 all t.e 7lobal 'ata obHe-ts o* t.e ,ro7ram are -reate' in t.e +or(in7
memory *irst. De-larative A8A statements are not -om,onents o* A8A ,ro-essin7 blo-(sI
instea'0 t.ey are -olle-te' by t.e A8A runtime system +.en t.e overall sour-e -o'e is 7enerate'.
=or t.e sa(e o* -larity0 .o+ever0 you s.oul' ,la-e all 'e-larative statements to7et.er at t.e be7innin7
o* t.e sour-e -o'e. 4:-e,tions to t.is are lo-al 'e-larations +it.in subroutines.
SA A! "A#$0 $3%3
3.4
SAP AG 2003
/+amle3 ABAP Pro"ram *ith $e'eral /'ent
Blocks and a $election $creen
7ocal T!e and Field ,e)initions
$election screen
("enerated b! the
runtime s!stem)
LOAD6OF6PROGRAM.
!%58%$e ; &.68%$0" 6 F.
START6OF6SELECTION.
7RITE !%58%$e.
PARAMETERS !%58%$e LICE &.68%$0"
G DEFAULT &.68%$0" I.
/'ent block
/'ent block
,e)ault settin"s )or
selection screen
$tart o) list creation
1n all o* t.e ,ro7rams +e .ave seen so *ar in t.is -ourse0 only one ,ro-essin7 blo-( .as been
,ro7ramme' in a''ition to 'e-larative statements. 1n t.is -ase0 t.ere is no nee' to 'e-lare t.e
,ro-essin7 blo-( e:,li-itly. 1n more -om,le: ,ro7rams0 .o+ever0 several 'i**erent ,ro-essin7 blo-(s
are reEuire'.
".e e:am,le in t.e 7ra,.i- -ontains a sele-tion s-reen +it. an in,ut *iel' *or a 'ate. ".e 'ate o* t.e
same +ee('ay in t.e ,revious +ee( s.oul' a,,ear as a 'e*ault value.
".e PARAMETERS statement is a 'e-larative lan7ua7e element. ".e system reEuires a -al-ulation
to ,reset t.e 'ate 'ynami-ally. ".e >!FA/8T a''ition to t.e PARAMETERS statement ensures t.at
t.e 'ata obHe-t is *ille' +it. a 'e*ault value. ".e A8A runtime system *ills t.e +$.da#,m *iel'
+it. t.e -urrent 'ate at t.e start o* t.e ,ro7ram.
"o -.an7e variables at run time0 t.ere*ore0 you must ,ro7ram a ,ro-essin7 blo-(. 8e-ause t.is
s.oul' be ,ro-esse' &e#ore t.e stan'ar' sele-tion s-reen is transmitte'0 use t.e res,e-tive event
blo-( -alle' LOAD6OF6PROGRAM.
9se t.e stan'ar' event blo-(0 START6OF6SELECTION: to -reate t.e list
SA A! "A#$0 $3%4
3.5
SAP AG 2003
$amle Pro"ram 8untime Beha'ior
ABAP runtime s!stem
ABAP ro"ram
LOAD6OF6PROGRAM.
!%58%$e ; &.68%$0" 6 F.
START6OF6SELECTION.
7RITE !%58%$e.
Pro"ram
start
Time
7ist
bu))er
)or
basic list
aCdate
1LLL122B
AAA
1n t.e *lo+ 'ia7ram in t.e 7ra,.i-0 you -an easily *ollo+ t.e seEuen-e o* ,ro-essin7 ste,s by t.e
A8A runtime system. 4vent blo-(s are -alle' in a #i(e" se=uence 'esi7ne' *or list ,ro-essin7)
".e *irst event blo-( to be -alle' is LOAD6OF6PROGRAM. 1n t.e e:am,le0 t.e 'ate LA +ee( a7oL
is -al-ulate' an' ,la-e' into t.e pa_da#e in,ut *iel'. 2e:t t.e system sen's t.e sele-tion s-reen
+it. t.is ne+ value to t.e ,resentation server. ".e user -an -.an7e t.e value.
2e:t t.e sele-tion s-reen is sent to t.e ,resentation server.
A*ter t.e user leaves t.e sele-tion s-reen0 START6OF6SELECTION is -alle'.
1* t.e START.OF.SELECTION event blo-( -ontains t.e A8A statements 7RITE7 SCIP or
ULINEA a list bu**er is *ille'.
As soon as START.OF.SELECTION is ,ro-esse' -om,letely0 t.e list bu**er is sent to t.e
,resentation server as a list.
8ot. events ,resente' .ere are initiate' by t.e A8A runtime system e(actly once ea-. time a
,ro7ram is e:e-ute'.
SA A! "A#$0 $3%5
3.6
SAP AG 2003
/'ent Block Characteristics
PARAMETERS !%58%$e LICE &.68%$0"
G DEFAULT &.68%$0" I.
LOAD6OF6PROGRAM.
!%58%$e ; &.68%$0" 6 F.
START6OF6SELECTION.
7RITE !%58%$e.
LOAD LOAD6 6OF OF6 6PROGRAM. PROGRAM.
START START6 6OF OF6 6SELECTION. SELECTION.
ABAP ro"ram
Introduced b! an
e'ent ke!*ord
/nded b! the ne+t
rocessin" block
/'ent block )or
di))erent tasks
Processin" se.uence
)or e'ent blocks is
determined b! the
runtime s!stem 4
/'ent block se.uence
in source code
unimortant
$tandard e'ent block
in e+ecutable ro"ram3
An event blo-( is intro'u-e' +it. an e+ent 'ey*or". 1t en's im,li-itly +.en t.e ne:t ,ro-essin7
blo-( starts.
4vent blo-(s are -alle' by t.e A8A runtime system. ".ere*ore0 t.e seEuen-e in +.i-. t.e event
blo-(s are +ritten in t.e ,ro7ram is unim,ortant.
LOAD6OF6PROGRAM is t.e *irst event blo-( -alle' in all A8A ,ro7ram ty,es. ".is event blo-(
allo+s you to set 'e*ault values t.at -an only be 'etermine' at runtime.
=or -om,atibility reasons0 t.e event blo-( INITIALI@ATION is available as an alternative.
>o+ever0 it is available *or e:e-utable ,ro7rams only.
START6OF6SELECTION is t.e *irst event blo-( *or -reatin7 a list. 1t is -alle' by t.e A8A
runtime system as soon as you leave t.e stan'ar' sele-tion s-reen. 1t is available *or e:e-utable
,ro7rams only.
1n e:e-utable ,ro7rams0 a''itional event blo-(s are available *or 'i**erent tas(s an' are 'esi7ne' *or
-reatin7 lists. Fou -an obtain a -om,lete list o* event blo-(s *rom t.e A8A 'o-umentation) -.oose
A,AP Overview A,AP - Overview 'iagrams (lassification of $eywords y %ype Event
-eywords.
SA A! "A#$0 $3%6
3.7
SAP AG 2003
,escribe the e'ent4controlled rocesses )or
e+ecutin" an ABAP ro"ram
5se the e'ent block 70A,40F4P80%8A6
(I(ITIA7IDATI0()
5se the e'ent block $TA8T40F4$/7/CTI0(
;ou are no* able to3
The ABAP 8untime $!stem3 5nit $ummar!
SA A! "A#$0 $3%B
4
SAP AG 2003
7ist attributes and stren"ths
Basic list
7ist e'ents
Interacti'e lists
/+amle *ith s!nta+3 ,etail list
Contents3
5ser ,ialo" 7ist
4.2
SA A! "A#$0 $4%$
4.3
SAP AG 2003
,escribe list attributes and stren"ths
Write a ro"ram that disla!s the detail o) a
seci)ic line )rom !our basic list to an interacti'e
list *hene'er the user double4clicks that
articular line
/+lain the runtime beha'ior o) !our ro"ram
durin" the AT 7I(/4$/7/CTI0( e'ent
At the conclusion o) this unit2 !ou *ill be able to3
5ser ,ialo" 7ist3 5nit 0b1ecti'es
SA A! "A#$0 $4%2
4.4
SAP AG 2003
Formatted Formatted
outut3 outut3
Print Print
Formatted outut3 Formatted outut3
CA I, P8IC/
AA 2?02 2@00
AA 2?02 2B00
Total VP00
$creen $creen ,isla! lan"ua"e ,isla! lan"ua"e4 4
seci)ic te+ts in lo"on seci)ic te+ts in lo"on
lan"ua"e lan"ua"e
7ist Attributes
Accordin" to )i+ed Accordin" to )i+ed
user settin"s user settin"s
2))?)U2?
)U/2?/2))?
Amounts accordin" Amounts accordin"
to their currenc! to their currenc!
7en"ths accordin" 7en"ths accordin"
to their unit to their unit
,ate ,ate
".e main ,ur,ose o* a list is to 'is,lay 'ata +.ile involvin7 a minimum amount o* ,ro7rammin7.
S,e-ial business 'ata reEuirements are ta(en into a--ount)
6ists are lan7ua7e%in'e,en'ent. "e:ts an' .ea'ers a,,ear in t.e lo7on lan7ua7e +.enever a
translation is available.
6ists -an 'is,lay monetary values in numerous -urren-ies.
".e *ollo+in7 o,tions are available to t.e user *or lists)
Dis,layin7 on s-reens) you -an a'' -olors an' i-ons
rintin7
ublis.in7 on 1nternet or intranet) ".e system automati-ally -onverts lists to >"M6.
Savin7) Fou -an save lists +it.in t.e R/3 System as +ell as outsi'e *or *urt.er ,ro-essin70 *or
e:am,le0 usin7 s,rea's.eet ,ro7rams
SA A! "A#$0 $4%3
4.5
SAP AG 2003
Back / /+it / Cancel
$croll
Print
Find (in list)
$a'e
3
7ist
3
$!stem &&&
$tandard 7ist Functions3
".e stan'ar' list inter*a-e o**ers t.e user several navi7ation *eatures)
8a-(
4:it
&an-el
rint
=in' @in listA
Save as a *ile0 in t.e menu0 or to a bu**er
Sen' t.e list in e%mail *orm
Fou -an use t.e 0enu Painter to a'Hust t.e stan'ar' list inter*a-e to *it your in'ivi'ual nee's.
SA A! "A#$0 $4%4
4.6
SAP AG 2003
7ist header
Column header
$a'e
3
7ist
3
$!stem &&& Te+t elements
Titles/headers
From *ithin the list3 From the ABAP /ditor3
7ist 9eaders in the ,e)ault Pa"e 9eader
4a-. list -an .ave a list hea"er an' u, to *our lines o* column hea"ers. Fou -an use t.ese tools in
t+o +ays)
=rom t.e A8A 4'itor) 9se t.e te:t element maintenan-e *un-tions. A ruler is available.
=rom t.e list) 1* you save your pro.ram0 acti+ate it0 an' t.en e(ecute it to -reate t.e list0 you -an
a--ess t.e maintenan-e s-reen by -.oosin7 System List List *eader. ".e main a'vanta7e o*
usin7 t.is met.o' is t.at t.e list is still 'is,laye' on t.e s-reen. ".is ma(es it easier to ,osition
-olumn .ea'ers.
".e ne:t time you start t.e ,ro7ram0 t.e ne+ .ea'ers +ill a,,ear in t.e list automati-ally.
1* no .ea'er te:t is entere'0 t.e ,ro7ram title is inserte' in t.e .ea'er.
SA A! "A#$0 $4%5
4.7
SAP AG 2003
7RITE: /?V $eB$6))?:
3V &.68%$0":
/?V $eB$6))2:
3V &.60#%"e.
Te+t elements
Titles/headers Titles/headers
ABAP ro"ram
Te+t s!mbols Te+t s!mbols
,/ creation date
/( creation date
F8 &&&
,/ Anle"en ,atum
/( Creation date
F8 &&&
3
/( Created b!
001
002
7ist header
Creation date3 01/01/2001
Created b!3 WA7T/8$
6ultilin"ual Caabilit! o) 7ists
$eB$ $eB$6 6))? ))?
$eB$ $eB$6 6))2 ))2
Titles an" hea"ers are ,art o* t.e ,ro7ramYs te:t elements. Fou -an translate all te:t elements into
ot.er lan7ua7es. ".e lo7on lan7ua7e settin7 on t.e lo7on s-reen 'etermines in +.i-. lan7ua7e te:t
elements +ill be 'is,laye'.
Te(t sym&ols are anot.er (in' o* te:t element. "e:t symbols are te:t literals t.at -an be translate'
an' are assi7ne' to t.e ,ro7ram. ".ey are *reEuently use' to -reate lists in'e,en'ent o* lan7ua7e.
Fou -an +rite te:t symbols into your ,ro7ram in eit.er o* t.e *ollo+in7 +ays)
TEXT6--- @--- is a t.ree%byte -.ara-ter strin7A
A%%%AD---E @... is any te:t0 --- is a t.ree%'i7it -.ara-ter strin7A
=rom t.e 4'itor0 you -an a--ess t.e maintenan-e s-reen *or t.e te:t symbols by -.oosin7 !oto
%ext elements %ext symols or by 'ouble%-li-(in7 t.e number o* a te:t symbol.
SA A! "A#$0 $4%6
4.8
SAP AG 2003
7ists in /+ecutable Pro"rams
Pro"ram
start
,atabase
tables
,ata ob1ects
ABAP runtime s!stem
ABAP ro"ram
7ist
bu))er
$TA8T40F4$/7/CTI0(&
$/7/CT &&&
W8IT/ &&&
Time
1n e:e-utable ,ro7rams0 lists are automati-ally 'is,laye' a*ter t.eir -orres,on'in7 event blo-(s .ave
been ,ro-esse'. ".ese ,ro-essin7 blo-(s must0 .o+ever0 -ontain a statement t.at +rites to t.e list
bu**er. ".ese are 7RITE0 SCIP0 an' ULINE.
4vent blo-(s are -alle' in a seEuen-e 'esi7ne' *or list ,ro-essin7)
8e*ore t.e sele-tion s-reen) LOAD6OF6PROGRAM.
A*ter t.e user leaves t.e sele-tion s-reen) START6OF6SELECTION.
All out,ut *rom t.e event blo-(s t.at -reate t.e lists @.ere only START.OF.SELECTIONA an' *rom
t.e mo'ulari<ation units -alle' t.ere0 +.i-. is ,ro-esse' be*ore a list is sent0 is tem,orarily store' in
t.e list bu**er.
3n-e all list -reation event blo-(s @.ere only START.OF.SELECTIONA .ave been ,ro-esse'0 all
'ata *rom t.e list bu**er is 'is,laye' in t.e *orm o* a list.
SA A! "A#$0 $4%B
4.C
SAP AG 2003
Creatin" ,etail 7ists
Time
,atabase
tables
$TA8T40F4$/7/CTI0(&
Basic
list
bu))er
AT 7I(/4$/7/CTI0(&
,etail
list
bu))er
1n e:e-utable ,ro7rams0 you -an use t.e event blo-( AT LINE6SELECTION to -reate 'etail lists.
".e A8A runtime system ensures t.at)
".e basi- list is sent a*ter t.e event blo-(s res,onsible *or -reatin7 t.e basi- list .ave been
,ro-esse' @*or e:am,le0 a*ter START.OF.SELECTIONA. 1n t.is -ase0 t.e system *iel' +$.
'+"nd -ontains t.e value 0.
".e event blo-( AT LINE.SELECTION is ,ro-esse' usin7 t.e *un-tion -o'e 1&K ea-. time
you 'ouble%-li-( an entry or -.oose an a-tion *or t.e system to ,er*orm. 1* you are not usin7 a
user%'e*ine' status0 t.is .a,,ens automati-ally every time you -.oose 'etail list @i-on loo(s li(e a
ma7ni*yin7 7lassA0 t.e menu *un-tion (*oose0 or t.e *un-tion (ey =2.
".e 'etail list is sent a*ter t.e AT LINE.SELECTION event blo-( is ,ro-esse' an' t.e value
-ontaine' in +$.'+"nd is in-rease' by one.
A*ter every user a-tion +it. t.e *un-tion -o'e 8A&K0 t.e system 'is,lays t.e list at t.e ,revious
'etail level @t.at is0 it 7oes *rom level n to n-:A.
SA A! "A#$0 $4%C
4.,0
SAP AG 2003
Basic list
s!4lsind
s!4lsind
s!4lsind
3
2
,etail 7ists3 (a'i"ation
0
,etail list
,etail list
Basic list
First detail list
$econd detail list
".e lists in t.e e:am,le ,ro7ram s.oul' *un-tion as *ollo+s)
".e basi- list s.oul' 'is,lay t.e te:t ,asic list an' t.e system *iel' +$.'+"nd.
".e user -an navi7ate to a 'etail list by usin7 any o* t.e *ollo+in7)
Double%-li-(in7 on t.e basi- list
&.oosin7 'etail list @i-on loo(s li(e a ma7ni*yin7 7lassA in t.e a,,li-ation toolbar
&.oosin7 a menu *un-tion
9sin7 *un-tion (ey =2. ".e 'etail list a,,ears an' t.e system *iel' +$.'+"nd .as t.e value $.
Re,eatin7 t.is a-tion -alls t.e se-on' 'etail list0 +.ere system *iel' +$.'+"nd -ontains t.e value
2 instea' @re,resentin7 t.e -urrent 'etail list levelA.
Re,eatin7 t.is a-tion in-reases t.e +$.'+"nd value by one every time. ".is is ,ossible u, to t.e
t+entiet. 'etail list.
&.oosin7 ,ac- ta(es t.e user ba-( one sin7le 'etail list level at a time until t.e basi- list is
rea-.e'..
SA A! "A#$0 $4%9
4.,,
SAP AG 2003
...
START6OF6SELECTION.
7RITE: / $eB$6))? COLOR +l5-e%8*#/:
/ <&.6l&*#8<:
&.6l&*#8 +l, 2.
AT LINE6SELECTION.
7RITE: / $eB$6))2 COLOR +l5-e%8*#/.
ULINE.
7RITE: / <&.6l&*#8<:
&.6l&*#8 +l, (.
Te+t s!mbols3
001
002
Basic list
,etail list
$!nta+ /+amle3 $imle ,etail 7ist
AT LINE AT LINE6 6SELECTION. SELECTION.
A 'etail list is ,ro7ramme' as *ollo+s)
Fou -reate a basi- list by *illin7 t.e basi- list bu**er at an a,,ro,riate event blo-( @.ere START.
OF.SELECTIONA usin7 eit.er WRITEA SKIP0 or *LINE.
9se t.e event blo-( AT LINE.SELECTION +.en ,ro7rammin7 'etail lists. #.enever you use
WRITEA SKIP0 or *LINE +it. t.is event blo-(0 you *ill t.e 'etail list bu**er *or t.e ne:t level @t.e
'etail list bu**er +it. a level value one 7reater t.an t.e level on +.i-. t.e user ,er*orme' t.e
a-tionA.
Fou -an ,re%'etermine navi7ation bet+een 'etail lists by Eueryin7 system *iel' +$.'+"nd at t.e
event blo-( AT LINE.SELECTION.
SA A! "A#$0 $4%$0
4.,2
SAP AG 2003
Airl! /li0't /rom (o 4epartin0 at
*: 0@00 /.A /rankfurt I/K 7ew Cork 30?30?00
*: 0@00 /.A /rankfurt I/K 7ew Cork 33?30?00
!!!
SN 0002 S%7 Sin0apore S/ San /rancisco 0<?30?00
Cou 'a8e c'osen *: 0@02
/li0't date
3<!32!2003
20!32!2003
2@!32!2003
Ma"!
3B0
3B0
3B0
cc!
2@0
290
3B0
/+amle3 ,etail 7ist
Timetable Timetable
,etail3 Fli"hts ,etail3 Fli"hts
Fou +ill no+ +rite a ,ro7ram usin7 bot. basi- lists an' 'etail lists.
".e basi- list in your ,ro7ram s.oul' -ontain *li7.t 'ata su-. as -arrier 1D an' *li7.t numbers0
'e,arture -ity an' air,ort0 'estination -ity an' air,ort0 an' 'e,arture an' arrival times. ".is 'ata -an
be *oun' in t.e 'atabase table S=61.
".e user s.oul' be able to a--ess in*ormation about any ,arti-ular *li7.t by 'ouble%-li-(in7 its
-arrier 1D an' *li7.t number. =li7.t 'ate an' o--u,an-y s.oul' be 'is,laye'. ".is 'ata -an be *oun'
in t.e 'atabase table S=61!>". Fou must use t.e S=61 (ey *iel's in t.is 'etail list in or'er to rea'
t.e a,,ro,riate 'ata in S=61!>". ".e *ollo+in7 7ra,.i-s 'emonstrate .o+ t.is is 'one.
".e e:am,le ,ro7ram is SA8&4009DDOD4"A16O61S" an' it is ,art o* 'evelo,ment -lass
8&400.
SA A! "A#$0 $4%$$
4.,3
SAP AG 2003
AA 001V JFF $F0 1#3#0300
79 0@00 F8A JFF 10310300
79 0@02 F8A JFF 1#3#0300
3 3 3 3 3
Bu))erin" %lobal ,ata in the 9ide Area
HIDE 1*el8#%"e.
SELECT +%,,*8 +##*8
%*,!1," %*,!$ 8e!$*"e
FROM &!1l*
INTO CORRESPONDING FIELDS OF
4%5&!1l*.
7RITE: / 4%5&!1l*6+%,,*8:
4%5&!1l*6+##*8:
4%5&!1l*6%*,!1,":
4%5&!1l*6%*,!$:
4%5&!1l*68e!$*"e.
: 4%5&!1l*6+%,,*8:
4%5&!1l*6+##*8.
ENDSELECT.
AT LINE6SELECTION.
7ine
#
#
@
@
B
B
3
Field name
*aCs)li4carrid
*aCs)li4connid
*aCs)li4carrid
*aCs)li4connid
*aCs)li4carrid
*aCs)li4connid
3
Halue
AA
001V
79
0@00
79
0@02
3
9ide area
HIDE HIDE
3
2
3
@
>
3
Current list bu))er
CA8 I, From To ,eartin" at CA8 I, From To ,eartin" at
B B
B B
B B
#.en t.e event A" 6124%S464&"132 is ,ro-esse'0 a ,ro7ramYs 'ata obHe-ts -ontain t.e same
values as be*ore basi- list 'is,lay. A 'etail list0 .o+ever0 o*ten nee's 'ata sele-te' +it.in t.e basi-
list itsel*. Fou -an use t.e >1D4 area to store -ertain 'ata *rom t.e line t.at you .ave sele-te' an'
t.en automati-ally insert it +.ere you nee' it in t.e -orres,on'in7 'ata obHe-t *or a 'etail list.
"o ,re'etermine +.i-. in*ormation is -lassi*ie' by its line ,osition +.en you -reate a basi- list0 use
t.e A8A (ey+or' >1D4 *ollo+e' by a list o* t.e 'ata obHe-ts you reEuire. ".e runtime system
automati-ally re-or's t.e name an' -ontents o* t.e 'ata obHe-t in relation to its line ,osition in t.e
list -urrently bein7 -reate'.
".e >1D4 7lobalO*iel' statement bu**ers t.e -ontent o* t.e 7lobal 'ata *iel' 7lobalO*iel' +it.
re*eren-e to t.e -urrent 'is,lay line. Fou 'o not .ave to 'is,lay t.e *iel' be*ore.an' usin7 t.e
#R1"4 statement. Fou merely .ave to ,ro7ram t.e >1D4 statements a*ter t.e last #R1"4 statement
in t.e -urrent line.
".e 'ata *iel' -an also be a *lat stru-ture.
SA A! "A#$0 $4%$2
4.,4
SAP AG 2003
...
AT LINE6SELECTION.
7RITE: $eB$6))?:
4%5&!1l*6+%,,*8:
4%5&!1l*6+##*8.
CA. %4 /rom (o 4epartin0 at
AA 0039 I/K S/ 33?30?00
*: 0@00 /.A I/K 30?30?00
*: 0@02 /.A I/K 33?30?00
!!!
SN 0002 S%7 S/ 0<?30?00
*aCs)li 79 0@00 AA AA AA AA
Te+t s!mbols3
001 Fli"hts )or connection
7ine $election
AT LINE AT LINE6 6SELECTION. SELECTION.
7ine
#
#
@
@
B
B
3
1@
1@
Field name
*aCs)li4carrid
*aCs)li4connid
*aCs)li4carrid
*aCs)li4connid
*aCs)li4carrid
*aCs)li4connid
3
*aCs)li4carrid
*aCs)li4connid
Halue
AA
001V
79
0@00
79
0@02
3
$G
0002
9ide area
CA8 I, From To ,eartin" at CA8 I, From To ,eartin" at
#.en you sele-t a line @by ,ointin7 to it *ollo+e' by 1&K or 'ouble%-li-(A0 t.is tri77ers t.e event
AT LINE.SELECTION.
=irst t.e values *or t.is line bu**ere' in t.e >1D4 area are inserte' &ac' into the correspon"in.
.lo&al "ata o&<ects.
".en t.e system ,ro-esses t.e relevant event blo-( in t.e A8A ,ro7ram.
SA A! "A#$0 $4%$3
4.,5
SAP AG 2003
...
AT LINE6SELECTION.
IF &.6l&*#8 ; ?.
7RITE: $eB$6))?:
4%5&!1l*6+%,,*8:
4%5&!1l*6+##*8.
SELECT 1l8%$e &e%$&"%B &e%$&++
FROM &1l*/-$
INTO CORRESPONDING FIELDS OF 4%5&1l*/-$
7HERE +%,,*8 ; 4%5&!1l*6+%,,*8
AND +##*8 ; 4%5&!1l*6+##*8.
7RITE:/ 4%5&1l*/-$61l8%$e:
4%5&1l*/-$6&e%$&"%B:
4%5&1l*/-$6&e%$&++.
ENDSELECT.
ENDIF.
Te+t s!mbols3
001 Fli"hts )or connection
AT LINE AT LINE6 6SELECTION. SELECTION.
$!nta+ /+amle3 Additional ,ata )or $elected 7ine
Fou -reate a 'etail list by *illin7 t.e 'etail list bu**er at t.e AT LINE.SELECTION event blo-(
usin7 eit.er WRITE0 SKIP0 or *LINE.
1n t.e e:am,le ,ro7ram0 t.e (ey *iel's o* t.e airline +ill be 'is,laye'. ".e *li7.ts available *or t.is
airline in t.e 'atabase table SFLIG/T are rea' usin7 a SELECT loo,.
2ote t.at t.e line%s,e-i*i- in*ormation on t.e airline is only available by 'ouble%-li-(in7 in t.e 'ata
obHe-ts i* t.e relevant 'ata obHe-ts .ave been ,la-e' in t.e >1D4 area +.en t.e basi- list +as
-reate'.
SA A! "A#$0 $4%$4
4.,6
SAP AG 2003
,escribe list attributes and stren"ths
Write a ro"ram that disla!s the details o) a
seci)ic line )rom !our basic list to an interacti'e
list *hene'er the user double4clicks that
articular line
/+lain the runtime beha'ior o) !our ro"ram
durin" the AT 7I(/4$/7/CTI0( e'ent
;ou are no* able to3
5ser ,ialo" 7ist3 5nit $ummar!
SA A! "A#$0 $4%$5
4.,7/ser >ialo. 8ist !(ercises
/nit$ /ser >ialo. 8ist
Topic$ >etail 8ists
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate a 'etail list in a ,ro7ram
4:ten' t.e ,ro7ram @'C())5AA5SELECT5SFLIGHT or t.e
-orres,on'in7 mo'el solution as *ollo+s)
3n-e t.e user .as sele-te' a *li7.t on t.e basi- list @'ouble%-li-( or =2 on
t.e relevant list lineA0 'is,lay a 'etail list -ontainin7 all o* t.e boo(in7s
*or t.e sele-te' *li7.t.
"em,late) @'C())5AA5SELECT5SFLIGHT or
SAPBC400DDS_A*T/ORITY_C/ECK
ro.ram$ @'C())5AA5DETAIL5LIST
%o"el solution$ SAP'C())UDS5DETAIL5LIST
$%$ &o,y your ,ro7ram @'C())5AA5SELECT5SFLIGHT or t.e -orres,on'in7
tem,late SAP'C())DDS5AUTHORITY5CHECC to t.e ne+ ,ro7ram
@'C())5AA5DETAIL5LIST.
$%2 Ma(e sure t.at t.e (ey *iel's o* t.e 'atabase table SFLIGHT are available to you
*or -reatin7 t.e 'etail list +.en t.e user sele-ts a *li7.t *rom t.e basi- list @'ouble%
-li-( or =2 on t.e -orres,on'in7 list lineA.
$%3 A'' t.e AT LINE6SELECTION event to your ,ro7ram to allo+ you to -onstru-t a
'etail list.
$%4 1n t.e *irst line o* t.e 'etail list0 'is,lay (ey in*ormation *rom t.e sele-te' *li7.t.
9n'er t.is line0 'is,lay a .ori<ontal line an' a blan( line.
$%5 Rea' all o* t.e boo(in7s *rom 'atabase table S'OOC *or t.e sele-te' *li7.t. Ma(e
sure t.at you rea' only t.ose *iel's *rom t.e 'atabase table t.at you +ant to 'is,lay
in t.e list. Dis,lay t.e *ollo+in7 *iel's *rom t.e 'atabase table S'OOC on t.e 'etail
list)
'OOCID:
CUSTOMID:
CUSTTYPE
SA A! "A#$0 $4%$6
CLASS:
ORDER5DATE:
SMOCER:
CANCELLED.
$%6 6ptional$ Dis,lay t.e *iel's LOCCURAM an' LOCCURCEY on t.e 'etail list)
4nsure t.at t.e -urren-y amount LOCCURAM is 'is,laye' +it. t.e a,,ro,riate
*ormattin7 *or t.e -urren-y LOCCURCEY. 9se t.e a''ition CURRENCY
L+0,,e#+.5Ne.M in t.e 7RITE statement.
!(ample)
WRITE< 9a_+!'"&;#.p"-e C*RRENCY 9a_+!'"&;#.-,en-$7
9a_+!'"&;#.-,en-$%
$%B 6ptional$ Dis,lay t.e 'OOCID *iel' in t.e -olor COL5CEY.
SA A! "A#$0 $4%$B
4.,8/ser >ialo. 8ist Solutions
/nit$ /ser >ialo. 8ist
Topic$ >etail 8ists
%o"el solution *ithout optional e(ercises$ SAP'C())UDS5DETAIL5LIST
:C..............................................................:
:C Repo# SAPBC400*DS_DETAIL_LIST :
:C :
RG%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%R
REPORT +ap(-400,d+_de#a"'_'"+#%
CONSTANTS< a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A%
DATA< 9a_!'"&;# TYPE +(-400!o--7
4%5&2N TYPE &2N.
PARAMETERS< pa_-a TYPE +_-a_"d%
START.OF.SELECTION%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD pa_-a
ID AACT)TA FIELD a-#3#_d"+p'a$%
CASE +$.+,(-%
W/EN 0%
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o-- FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a%
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
WRITE< > 9a_!'"&;#.-a"d7
9a_!'"&;#.-onn"d7
9a_!'"&;#.!'da#e7
9a_!'"&;#.+ea#+o--7
9a_!'"&;#.+ea#+ma07
9a_!'"&;#.pe-en#a&e7ABA%
* H*8e Ne. 1*el8 v%l0e& +,,e&!#8*#/ $ $-e %+$0%l l*#e
HIDE: 4%51l*/-$6+%,,*8: 4%51l*/-$6+##*8:
4%51l*/-$61l8%$e.
ENDSELECT%
SA A! "A#$0 $4%$C
W/EN OT/ERS%
WRITE< > AA,#;o"#$.C;e-8 EoAE004F%
ENDCASE%
CLEAR 9a_!'"&;#%
* P,/,%" +#$*#0e& -e,e: *1 % l*#e *& &ele+$e8 # 2%&*+ l*&$
AT LINE6SELECTION.
IF &.6l&*#8 ; ?.
* Ce. 1*el8& $,%#&!,$e8 2%+N 1," -*8e %,e% $ A'AP 8%$% 23e+$&
7RITE: / 4%51l*/-$6+%,,*8:
4%51l*/-$6+##*8:
4%51l*/-$61l8%$e.
ULINE.
SCIP.
* Sele+$*# 1 2N*#/&: 4-*+- 8e!e#8 # &ele+$e8 1l*/-$
SELECT 2N*8 +0&$"*8 +0&$$.!e +l%&& ,8e,58%$e
&"Ne, +%#+elle8 l++0,%" l++0,Ne.
FROM &2N INTO CORRESPONDING FIELDS OF 4%5&2N
7HERE +%,,*8 ; 4%51l*/-$6+%,,*8
AND +##*8 ; 4%51l*/-$6+##*8
AND 1l8%$e ; 4%51l*/-$61l8%$e.
* C,e%$*# 1 8e$%*l l*&$
7RITE: / 4%5&2N62N*8:
4%5&2N6+0&$"*8:
4%5&2N6+0&$$.!e:
4%5&2N6+l%&&:
4%5&2N6,8e,58%$e:
4%5&2N6&"Ne,:
4%5&2N6+%#+elle8.
ENDSELECT.
ENDIF.
CLEAR 9a_!'"&;#%
%o"el solution *ith optional e(ercises$ SAP'C())UDS5DETAIL5LIST?
:C..............................................................:
:C Repo# SAPBC400*DS_DETAIL_LIST4 :
:C :
RG%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%R
REPORT +ap(-400,d+_de#a"'_'"+#4%
CONSTANTS< a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A%
DATA< 9a_!'"&;# TYPE +(-400!o--7
9a_+(oo8 TYPE +(oo8%
PARAMETERS< pa_-a TYPE +_-a_"d%
SA A! "A#$0 $4%$9
START.OF.SELECTION%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD pa_-a
ID AACT)TA FIELD a-#3#_d"+p'a$%
CASE +$.+,(-%
W/EN 0%
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o-- FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a%
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
WRITE< > 9a_!'"&;#.-a"d7
9a_!'"&;#.-onn"d7
9a_!'"&;#.!'da#e7
9a_!'"&;#.+ea#+o--7
9a_!'"&;#.+ea#+ma07
9a_!'"&;#.pe-en#a&e7ABA%
* H*8e Ne. 1*el8 v%l0e& +,,e&!#8*#/ $ $-e %+$0%l l*#e
/IDE< 9a_!'"&;#.-a"d7 9a_!'"&;#.-onn"d7 9a_!'"&;#.!'da#e%
ENDSELECT%
W/EN OT/ERS%
WRITE< > AA,#;o"#$.C;e-8 EoAE004F%
ENDCASE%
CLEAR 9a_!'"&;#%
* P,/,%" +#$*#0e& -e,e: *1 % l*#e *& &ele+$e8 # 2%&*+ l*&$
AT LINE.SELECTION%
IF +$.'+"nd = 4%
* Ce. 1*el8& $,%#&!,$e8 2%+N 1," -*8e %,e% $ A'AP 8%$% 23e+$&
WRITE< > 9a_!'"&;#.-a"d7 9a_!'"&;#.-onn"d7 9a_!'"&;#.!'da#e%
*LINE%
SKIP%
* Sele+$*# 1 2N*#/&: 4-*+- 8e!e#8 # &ele+$e8 1l*/-$
SELECT (oo8"d -,+#om"d -,+##$pe -'a++ ode_da#e
+mo8e -an-e''ed 'o--,am 'o--,8e$
FROM +(oo8 INTO CORRESPONDING FIELDS OF 9a_+(oo8
W/ERE -a"d = 9a_!'"&;#.-a"d
AND -onn"d = 9a_!'"&;#.-onn"d
AND !'da#e = 9a_!'"&;#.!'da#e%
* C,e%$*# 1 8e$%*l l*&$
WRITE< > 9a_+(oo8.(oo8"d COLOR COL5CEY7
9a_+(oo8.-,+#om"d7
9a_+(oo8.-,+##$pe7
9a_+(oo8.-'a++7
9a_+(oo8.ode_da#e7
9a_+(oo8.+mo8e7
SA A! "A#$0 $4%20
9a_+(oo8.-an-e''ed7
4%5&2N6l++0,%" CURRENCY 4%5&2N6l++0,Ne.:
4%5&2N6l++0,Ne..
ENDSELECT%
ENDIF%
CLEAR 9a_!'"&;#%
SA A! "A#$0 $4%2$
5
SAP AG 2003
$election screen attributes and stren"ths
,e)inin" selection screens
/'aluatin" user inut to restrict database selection
$election screen e'ents
$!nta+ e+amles3 Additional inut checks *ith error
dialo"
Contents3
5ser ,ialo" $election $creen
SA A! "A#$0 $5%$
5.2
SAP AG 2003
,escribe selection screen attributes and
stren"ths
Write a ro"ram that allo*s !ou to enter inter'als
on a selection screen and that can be used to
restrict the number o) data records retrie'ed )rom
the database
Write a ro"ram that contains additional inut
checks )or the selection screen and returns to the
selection screen i) an error occurs
At the conclusion o) this unit2 !ou *ill be able to3
5ser ,ialo" 7ist3 5nit 0b1ecti'es
SA A! "A#$0 $5%2
5.3
SAP AG 2003
5se o) $election $creens
,atabase
table
ABAP
rocessin"
block
ABAP runtime s!stem
ABAP ro"ram
$election criteria
Sele-tion s-reens allo+ users to enter sele-tion -riteria reEuire' by t.e ,ro7ram *or it to -ontinue.
=or e:am,le0 i* you -reate a list -ontainin7 'ata *rom a very lar7e 'atabase table0 you -an use a
sele-tion s-reen to restri-t t.e amount o* 'ata t.at is sele-te'. At runtime0 t.e user -an sele-t
intervals *or one o* t.e (ey *iel's0 an' only 'ata t.at -orres,on's to t.is sele-tion is rea' *rom t.e
'atabase an' 'is,laye' in t.e list. ".is -onsi'erably re'u-es t.e loa' on t.e 'atabase an' net+or(.
SA A! "A#$0 $5%3
5.4
SAP AG 2003
0'er'ie*3 $election $creen Attributes
$election $creen Attributes
$election $creen Attributes
$in"le Fields (PA8A6/T/8$)
$in"le Fields (PA8A6/T/8$)
Halue $ets ($/7/CT40PTI0($)
Halue $ets ($/7/CT40PTI0($)
$election $creen /'ents
$election $creen /'ents
SA A! "A#$0 $5%4
5.5
SAP AG 2003
,alue ,alue entry entry
Multilin0ual Capacity Multilin0ual Capacity
,ariants ,ariants
Possi$le Possi$le
entries entries
'elp 'elp
(ype c'ecks (ype c'ecks
$election $creen Attributes
%nput 'elp %nput 'elp
A
Sele-tion s-reens are in,ut mas(s *or value sets t.at restri-t t.e amount o* 'ata rea' *rom t.e
'atabase. ".e *ollo+in7 ,ossibilities are available to t.e user)
4ntries in sin7le *iel's
Comple( entries) 1ntervals0 o,erations0 ,atterns
Savin7 *ille' sele-tion *iel's as +ariants
1n,ut .el, an' sear-. .el,s are available by -.oosin7 t.e =4 *un-tion (ey or t.e ,ossible entries
,us.button
Fou -an translate selection te(ts into ot.er lan7ua7es so t.at t.ey are t.en 'is,laye' in t.e lan7ua7e
in +.i-. t.e user is lo77e' on.
".e system -.e-(s t.e ty,e) 1* you enter a value +it. an in-orre-t ty,e0 t.e system 'is,lays an error
messa7e an' ma(es t.e *iel' rea'y *or ne+ in,ut.
SA A! "A#$0 $5%5
5.6
SAP AG 2003
SELECT6OPTIONS ...
PARAMETERS ...
$in"le 'alue
%reater than or e.ual
%reater than
7ess than
(ot e.ual
7ess than or e.ual
/+clude )rom selection
,earture cit!
Airline 79
$elect
Airline
6ultile sin"le 'alues
Inter'als
$in"le 'alue e+clusion
Inter'al e+clusion
/nterin" Halue $ets
to
6aintain selection otions
Sele-tion s-reens allo+ you to 'e*ine sele-tion o,tions *or -om,le: entries as +ell as sim,le in,ut
*iel's.
Settin7 sele-tion o,tions
4nterin7 multi,le values or intervals
De*inin7 a value set t.at is not to be sele-te' an' is to be subtra-te' *rom t.e value set to be
sele-te' at t.e en'.
4very sele-tion s-reen -ontains an in*ormation i-on. &.oose t.is i-on to 'is,lay a''itional
in*ormation.
SA A! "A#$0 $5%6
5.7
SAP AG 2003
5sin" the $emantic In)ormation o) %lobal T!es
$election screen
Airline
%lobal t!es
- Field label
- Inut hel
- $earch hel Y$earch helZ
,ata element ,ata element
$tructure $tructure
ABAP ro"ram
PARAMETERS !%5+%,, TYPE &!1l*6+%,,*8.
- Technical t!e
$emantic
in)ormation
Technical
in)ormation3
Formattin"
rules
1* an in,ut *iel' is ty,e' +it. a "ata element0 t.e *ollo+in7 a''itional semanti- in*ormation is
available)
Fou -an use a #iel" name as a sele-tion te:t
5nput help @=$ .el,A *rom t.e 'ata element is available automati-ally
ossi&le entries help @=4 .el,A is available automati-ally0 ,rovi'e' t.e 'ata element .as been
lin(e' +it. a sear-. .el,. A sear-. .el, is a stan'alone obHe-t 'e*ine' in t.e Di-tionary0 +.i-.
-ontrols t.e 'ialo7 +it. t.e user an' 'ata retrieval *or t.e ,ossible entries .el,.
1* an in,ut *iel' is ty,e' +it. a structure #iel" t.at uses a 'ata element0 t.e *ollo+in7 semanti-
in*ormation is available)
Fiel" names an' input help @=$ .el,A are -o,ie' *rom t.e 'ata element t.at .as been use' to ty,e
t.e Di-tionary stru-ture *iel'.
1* a stru-ture *iel' is -ou,le' +it. a sear-. .el,0 t.en t.is is t.e sear-. .el, t.at is use' *or t.e
possi&le entries help @=4 .el,A % t.at is0 it obs-ures t.e 'ata element sear-. .el,. 1* t.ere is no
sear-. .el, -ou,le' +it. t.e stru-ture *iel'0 t.e system uses t.e 'ata element sear-. .el,.
8ear in min' t.at t.e 7lobal ty,e you -.oose to ,rovi'e a ty,e *or an in,ut *iel' a**e-ts t.e semanti-
in*ormation available to t.e user.
=or more in*ormation0 re*er to t.e online 'o-umentation *or t.e A8A Di-tionary.
SA A! "A#$0 $5%B
5.8
SAP AG 2003
Te+t elements
Titles/headers
ABAP ro"ram
Te+t s!mbols
$0CCA88
PACCIT;
$election te+ts
,/
/( Airline
,/
/( ,earture cit!
6ultilin"ual caacit! 6ultilin"ual caacit!
...
SELECT6OPTIONS &5+%,, FOR ...
PARAMETERS !%5+*$. TYPE ...
$election Te+ts
,earture cit!
Airline 79 to
,ictionar! re)erence
$ource code
3n t.e sele-tion s-reen0 t.e *iel' names a,,ear as te:t ne:t to t.e in,ut *iel's. >o+ever0 you -an
re,la-e t.ese +it. sele-tion te:ts0 +.i-. you -an t.en translate into any *urt.er lan7ua7es you
reEuire. Sele-tion te:ts are 'is,laye' in t.e userYs lo7on lan7ua7e.
1* t.e in,ut *iel' is ty,e' 'ire-tly or in'ire-tly +it. a 'ata element0 you -an -o,y t.e *iel' name *rom
one o* t.e te:ts store' in t.e Di-tionary.
SA A! "A#$0 $5%C
5.C
SAP AG 2003
Hariants
Create a 'ariant3
- Fill out the selection screen
- $a'e as a 'ariant
- /nter a 'ariant name
- 6eanin"3 /nter a descriti'e short te+t
- ;ou can also choose other attributes
Create a 'ariant3
Create a 'ariant3
- $tart the ro"ram
- Choose the icon on the selection screen
- Choose a 'ariant b! name
- The s!stem coies the 'alues to the inut )ields
5se the 'ariant3
,earture cit!
Airline 79 to
1* you +ant to save t.e values @or some o* t.e valuesA on a sele-tion s-reen t.at you .ave *ille' out0
you -an 'o so by -reatin7 a variant. #.en you start t.e ,ro7ram a7ain later0 you -an 7et t.ese values
*rom t.e variant an' 'is,lay t.em in t.e sele-tion s-reen.
Fou -an 'e*ine an' save variants *or any ,ro7ram t.at -ontains a sele-tion s-reen. Fou 'o t.is by
startin7 t.e ,ro7ram an' t.en -reatin7 a variant by -.oosin7 !oto ;ariants Save as variant.
;ariants allo+ you to tailor sele-tion s-reens to suit your nee's. Fou -an)
reassi7n values *or in,ut *iel's
>i'e in,ut *iel's
A sin7le variant -an re*er to more t.an one sele-tion s-reen in t.e same ,ro7ram.
;ariants are -lient%s,e-i*i-.
4very sele-tion s-reen -ontains an in*ormation i-on. &.oose t.is i-on to 'is,lay a''itional
in*ormation.
SA A! "A#$0 $5%9
5.,0
SAP AG 2003
$in"le Fields (PA8A6/T/8$)
$election $creen Attributes
$election $creen Attributes
$in"le Fields (PA8A6/T/8$)
$in"le Fields (PA8A6/T/8$)
Halue $ets ($/7/CT40PTI0($)
Halue $ets ($/7/CT40PTI0($)
$election $creen /'ents
$election $creen /'ents
SA A! "A#$0 $5%$0
5.,,
SAP AG 2003
/))ect o) the PA8A6/T/8$ $tatement
PA8A6/T/8$ aCcar
T;P/ sCcarrCid&
ABAP ro"ram
PARAMETERS PARAMETERS
aCcar
,eclarati'e statements
$election
screen
8e)erence to
ABAP ,ictionar!
$CCA88CI,
1n an e:e-utable ,ro7ram0 a sin7le PARAMETERS statement is su**i-ient to 7enerate a stan'ar'
sele-tion s-reen.
".e PARAMETERS Xname2 TYPE 1#$pename2 statement an' t.e PARAMETERS 1name2
LIKE Lda#a_o(Ge-#2 statement bot. 7enerate an elementary in,ut *iel' on t.e sele-tion s-reen0
an' a 'ata obHe-t +it. t.e same ty,e.
1* t.e user enters a value an' -.ooses Execute0 t.at value is ,la-e' in t.e internal 'ata obHe-t XnameJ
in t.e ,ro7ram. ".e system ,ermits only entries +it. t.e -orre-t ty,e.
SA A! "A#$0 $5%$$
5.,2
SAP AG 2003
8untime Beha'ior and ,ata Transort3 Parameters
ABAP runtime s!stem
ABAP ro"ram
ABAP
rocessin"
block
Time
$election
screen
,escrition o)
selection screen
aCcar
3n-e t.e LOAD6OF6PROGRAM event blo-( .as been ,ro-esse'0 t.e sele-tion s-reen is sent to t.e
,resentation server. ".e runtime system trans,orts t.e 'ata obHe-t values t.at are 'e*ine' usin7
PARAMETERS to t.e sele-tion s-reen in,ut *iel's o* t.e same name.
".e user -an t.en -.an7e t.e values in t.e in,ut *iel's. 1* t.e user t.en -li-(s on t.e Execute
*un-tion0 t.e in,ut *iel' values are trans,orte' to t.e ,ro7ram 'ata obHe-ts +it. t.e same name an'
-an be evaluate' in t.e A8A ,ro-essin7 blo-(s.
SA A! "A#$0 $5%$2
5.,3
SAP AG 2003
5sin" Parameters When Accessin" the ,atabase
REPORT ...
DATA 4%5&!1l* TYPE &!1l*.
PARAMETERS !%5+%, TYPE &5+%,,5*8.
...
SELECT +%,,*8 +##*8 +*$.1," +*$.$ ...
FROM &!1l*
INTO CORRESPONDING FIELDS OF 4%5&!1l*
7HERE +%,,*8 ; !%5+%, .
7RITE: / 4%5&!1l*6+%,,*8: 4%5&!1l*6+##*8:
4%5&!1l*61l8%$e: ... .
ENDSELECT .
7HERE 7HERE +%,,*8 +%,,*8 ; ; !% !%5 5+%, +%,
SELECT SELECT
ENDSELECT ENDSELECT
1* you .ave use' t.e PARAMETERS statement to ,ro7ram an in,ut *iel' as a (ey *iel' *or a 'atabase
table0 you -an use a 7HERE -lause at t.e SELECT statement to limit 'ata sele-tion to t.is value.
1n t.e e:am,le above only t.ose 'ata re-or's are rea' *rom 'atabase table SPFLI +.ose (ey *iel'
CARRID .as t.e same value as is -ontaine' in 'ata obHe-t !%5+%, at runtime.
SA A! "A#$0 $5%$3
5.,4
SAP AG 2003
Halue $ets ($/7/CT40PTI0($)
$election $creen Attributes
$election $creen Attributes
$in"le Fields (PA8A6/T/8$)
$in"le Fields (PA8A6/T/8$)
Halue $ets ($/7/CT40PTI0($)
Halue $ets ($/7/CT40PTI0($)
$election $creen /'ents
$election $creen /'ents
SA A! "A#$0 $5%$4
5.,5
SAP AG 2003
/))ect o) the $/7/CT40PTI0($ $tatement
ABAP ro"ram
soCcarr
$election
screen
"dCcarrid
,ATA "dCcarrid T;P/ sCcarrCid&
$/7/CT40PTI0($ soCcarr
F08 "dCcarrid&
,eclarati'e statements
SELECT SELECT6 6OPTIONS OPTIONS
si"n lo* hi"h
0tion
8e)erence to
ABAP ,ictionar!
/8 /8
$CCA88CI,
Fou use t.e SELECT6OPTIONS name FOR 'ataOobHe-t statement to 'e*ine sele-tion o,tions) "+o
in,ut *iel's +it. t.e same ty,e as t.e 'ata obHe-t a,,ear on t.e sele-tion s-reen0 allo+in7 you to
enter interval limits. A''itionally0 a button a,,ears t.at allo+s you to reali<e -om,le: set limits.
".e statement also 'e-lares an internal table name +it.in t.e ,ro7ram0 +it. t.e *ollo+in7 *our
-olumns)
&*/#) ".is *iel' 'esi7nates +.et.er t.e value or interval s.oul' be in-lu'e' @5A in or e:-lu'e' @!A
*rom t.e sele-tion.
!$*# *or t.e o,erator @'T0 ...A) =or a list o* ,ossible o,erators0 re*er to t.e (ey+or'
'o-umentation *or t.e SELECT6OPTIONS statement.
l4) ".is *iel' -ontains t.e lo+er limit o* an interval or sin7le value.
-*/-) ".is *iel' -ontains t.e u,,er limit o* an interval.
".is sele-tion table name al+ays re*ers to a 'ata obHe-t t.at .as alrea'y been 'e*ine'. ".e 'ata
obHe-t is use' as a tar7et *iel' 'urin7 'atabase sele-tion0 +.ile t.e sele-tion table is a set o* ,ossible
values. =or t.is reason a s,e-ial version o* t.e 7HERE -lause e:ists *or 'atabase sele-tion. 1t
'etermines +.et.er or not t.e 'atabase -ontains t.e -orres,on'in7 *iel' +it.in t.e +alue set.
2ote)
Similarly0 an in-lusion test is also 'e*ine' *or t.e IF statement.
SA A! "A#$0 $5%$5
5.,6
SAP AG 2003
8untime Beha'ior and ,ata Transort3 $election 0tions
ABAP runtime s!stem
ABAP ro"ram
ABAP
rocessin"
block
$election
screen
Time
"dCcarrid
,escrition o)
selection screen
soCcarr
1* t.e user enters several values or intervals *or a sele-tion o,tion an' -.ooses Execute0 t.e system
,la-es t.em in t.e internal table.
SA A! "A#$0 $5%$6
5.,7
SAP AG 2003
5sin" $election 0tions When Accessin" the ,atabase
REPORT ...
DATA 4%5&!1l* TYPE &!1l*.
SELECT6OPTIONS &5+%,, FOR 4%5&!1l*6+%,,*8.
...
SELECT +%,,*8 +##*8 +*$.1," +*$.$ ...
FROM &!1l*
INTO CORRESPONDING FIELDS OF 4%5&!1l*
7HERE +%,,*8 IN &5+%,,.
7RITE: / 4%5&!1l*6+%,,*8: 4%5&!1l*6+##*8:
4%5&!1l*6+*$.1,": 4%5&!1l*6+*$.$: ... .
ENDSELECT.
7HERE 7HERE +%,,*8 +%,,*8 IN &5 IN &5+%,, +%,,
SELECT SELECT
ENDSELECT ENDSELECT
".e above e:am,le s.o+s .o+ you -an restri-t 'atabase sele-tion to a -ertain ran7e usin7 a sele-tion
table.
&on'itions in an internal table 'e-lare' usin7 SELECT6OPTIONS are inter,rete' as *ollo+s)
1* t.e internal table is em,ty0 t.e -on'ition *iel' IN +e'name is al+ays true.
1* t.e internal table only -ontains in-lusive elementary -on'itions0 su-. as "_40 or "_n0 t.e
result is t.e -om,osite -on'ition E"_4 OR %%% OR "_n E.
1* t.e internal table only -ontains e:-lusive elementary -on'itions su-. as e4 or em0 t.e result is
t.e -om,osite -on'ition D NOT e_4E AND ... AND DNOT e_mE
1* t.e internal table -ontains in-lusive elementary -on'itions0 su-. as *5? or *5#0 an' e:-lusive
elementary -on'itions0 su-. as e5? or e5"0 t.e result is t.e -om,osite -on'ition D "_4
OR ... OR "_n E AND D NOT e_4 E AND ... AND D NOT e_m E.
SA A! "A#$0 $5%$B
5.,8
SAP AG 2003
$election $creen /'ents
$election $creen Attributes
$election $creen Attributes
$in"le Fields (PA8A6/T/8$)
$in"le Fields (PA8A6/T/8$)
Halue $ets ($/7/CT40PTI0($)
Halue $ets ($/7/CT40PTI0($)
$election $creen /'ents
$election $creen /'ents
SA A! "A#$0 $5%$C
5.,C
SAP AG 2003
$election $creen /'ents
Time
LOAD6OF6PROGRAM.
START6OF6SELECTION.
AT SELECTION6SCREEN.
(o
;es
Pro"ram
start
1n an e:e-utable ,ro7ram0 t.e A8A runtime system 7enerates a stan'ar' sele-tion s-reen as lon7 as
you .ave +ritten at least one PARAMETERS or SELECT6OPTIONS statement. ".e event blo-( AT
SELECTION6SCREEN belon7s to t.e sele-tion s-reen.
".e sele-tion s-reen is sent a*ter t.e event blo-( LOAD6OF6PROGRAM.
4a-. time t.e user ,resses X4nterJ0 a ,us.button0 a *un-tion (ey0 or -.ooses a menu *un-tion0 t.e
system initially -arries out a ty,e -.e-(. 1* t.e entries 'o not .ave t.e -orre-t ty,e0 t.e system
'is,lays an error messa7e0 an' ma(es t.e *iel's rea'y *or in,ut a7ain. #.en t.e entries .ave t.e
-orre-t ty,e0 t.e system ,ro-esses t.e event blo-( AT SELECTION6SCREEN.
SubseEuent ,ro7ram *lo+ 'e,en's on t.e user a-tion)
1* t.e user -.ooses X=CJ or Execute t.e ne:t event blo-( is -alle') in t.is -ase START6OF6
SELECTION.
1* t.e user -.ose any ot.er *un-tion0 t.e sele-tion s-reen is 'is,laye' a7ain.
SA A! "A#$0 $5%$9
5.20
SAP AG 2003
/rror ,ialo"s in AT $/7/CTI0(4$C8//(
Time
Pro"ram
start
LOAD6OF6PROGRAM.
START6OF6SELECTION.
(o authoriEation&&&
AT SELECTION6SCREEN.
IF ... 6essa"e te+t
/rror messa"e
/rror check
9se t.e event blo-( AT SELECTION6SCREEN i* you +ant to ,ro7ram a''itional in,ut -.e-(s *or
a stan'ar' sele-tion s-reen.
".e event blo-( AT SELECTION6SCREEN is tri77ere' by ea-. user a-tion. 1* an error 'ialo7 is
tri77ere' by t.e MESSAGE statement0 t.e system resen's t.e sele-tion s-reen an' automati-ally
resets all in,ut *iel's to rea'y *or in,ut.
=or more 'etaile' in*ormation on t.e MESSAGE statement0 re*er to t.e (ey+or' 'o-umentation.
A''itional in*ormation -an be *oun' in t.e (ey+or' 'o-umentation *or AT SELECTION6SCREEN.
SA A! "A#$0 $5%20
5.2,
SAP AG 2003
$!nta+ /+amle3 $election $creen AuthoriEation Check
PARAMETERS !%5+%, TYPE &5+%,,5*8.
* eve#$ !,+e&&e8 %1$e, le%v*#/ $-e &ele+$*# &+,ee#
AT SELECTION6SCREEN.
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< FIELD !%5+%,
ID <ACT>T< FIELD %+$v$58*&!l%..
IF &.6&02,+ NE ).
* &-4 &ele+$*# &+,ee# %/%*# 4*$- "e&&%/e *# &$%$0& 2%,
MESSAGE e)(VD2+())E 7ITH !%5+%,.
ENDIF.
AT SELECTION AT SELECTION6 6SCREEN. SCREEN.
MESSAGE e MESSAGE e
As an e:am,le o* an a''itional in,ut -.e-( +it. error 'ialo70 an in,ut *iel' *or t.e airline 1D nee's
to be a''e' to t.e ,ro7ram.
An aut.ori<ation -.e-( is to be -arrie' out on t.e sele-tion s-reen.
1* t.e user .as aut.ori<ation to 'is,lay t.e s,e-i*ie' airline0 t.e ,ro7ram -ontinues.
1* t.e user 'oes not .ave 'is,lay aut.ori<ation0 t.en t.e sele-tion s-reen is 'is,laye' a7ain an' an
error messa7e a,,ears in t.e status bar.
SA A! "A#$0 $5%2$
5.22
SAP AG 2003
,escribe selection screen attributes and
stren"ths
Write a ro"ram that allo*s !ou to enter inter'als
on a selection screen and that can be used to
restrict the number o) data records retrie'ed )rom
the database
Write a ro"ram that contains additional inut
checks )or the selection screen and returns to the
selection screen i) an error occurs
;ou are no* able to3
5ser ,ialo" 7ist3 5nit $ummar!
SA A! "A#$0 $5%22
5.23 Selection Screen !(ercises
/nit$ Selection Screen
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
9se t.e A8A statement SELECT6OPTIONS to enter -om,le: values
on a stan'ar' sele-tion s-reen.
"a(e a--ount o* -om,le: values in a 'atabase sele-tion.
ro7ram an error messa7e *or a stan'ar' sele-tion s-reen
4:ten' your ,ro7ram @'C())5AA5DETAIL5LIST or t.e
-orres,on'in7 mo'el solution as *ollo+s)
4:ten' t.e stan'ar' sele-tion s-reen to allo+ you to 'e*ine a -om,le:
value set *or limitin7 t.e -onne-tin7 *li7.t number. ".e value set is to be
ta(en into a--ount +.en sele-tin7 *li7.ts.
A''itionally0 -.an7e your ,ro7ram so t.at t.e user -an only ,ro7ress
*rom t.e sele-tion s-reen i* t.e aut.ori<ation -.e-( *or t.e 'esire' airline
is su--ess*ul.
ro.ram$ @'C())5AA5SEL5SCREEN
%o"el solution$ SAP'C())UDS5SEL5SCREEN
Template$ SAP'C())UDS5DETAIL5LIST
$%$ &o,y your ,ro7ram @'C())5AA5DETAIL5LIST or t.e -orres,on'in7 tem,late
SAP'C())UDS5DETAIL5LIST to t.e ne+ ,ro7ram
@'C())5AA5SEL5SCREEN.
$%2 4:ten' your sele-tion s-reen to allo+ t.e user to enter a -om,le: value ran7e *or
t.e #li.ht num&er CONNID.
#.en you are ty,in7 t.e airline an' *li7.t number0 ma(e sure
you re*er to t.e same stru-ture so t.at t.e sear-. .el,s are
-onte:t%'e,en'ent.
$%3 9se t.e -om,le: value set to restri-t t.e amount o* 'ata sele-te' *rom t.e 'atabase
table SFLIGHT.
$%4 &.an7e your ,ro7ram so t.at t.e user -annot ,ro7ress *rom t.e sele-tion s-reen i*
t.e aut.ori<ation -.e-( a7ainst t.e aut.ori<ation obHe-t S5CARRID *ails. 1* t.e
aut.ori<ation -.e-( *ails0 'is,lay a suitable error messa7e *rom messa7e -lass
8&4000 an' allo+ t.e user to enter a 'i**erent value on t.e sele-tion s-reen.
SA A! "A#$0 $5%23
5.24Selection Screen Solutions
/nit$ Selection Screen
%o"el solution$ ro.ram SAP'C())UDS5SEL5SCREEN
:C..............................................................:
:C Repo# SAPBC400*DS_SEL_SCREEN :
:C :
:C..............................................................:
REPORT +ap(-400,d+_+e'_+-een%
CONSTANTS< a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A%
DATA< 9a_!'"&;# TYPE +(-400!o--7
9a_+(oo8 TYPE +(oo8%
PARAMETERS< pa_-a LICE 4%51l*/-$6+%,,*8%
* D%$% 1*el8 1, +"!leB ,e&$,*+$*#& %!!l*e8 $ +##e+$*# *8
SELECT6OPTIONS: &5+# FOR 4%51l*/-$6+##*8.
* F*,&$ eve#$ !,+e&&e8 %1$e, le%v*#/ $-e &ele+$*# &+,ee#
AT SELECTION6SCREEN.
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< FIELD !%5+%,
ID <ACT>T< FIELD %+$v$58*&!l%..
IF &.6&02,+ LM ).
* Re$0,# $ &ele+$*# &+,ee# %/%*# %#8 8*&!l%. "e&&%/e *# &$%$0& *
2%,
MESSAGE ID <'C())< TYPE <E< NUM'ER <)(V< 7ITH !%5+%,.
ENDIF.
START.OF.SELECTION%
SELECT -a"d -onn"d !'da#e +ea#+ma0 +ea#+o-- FROM +!'"&;#
INTO CORRESPONDING FIELDS OF 9a_!'"&;#
W/ERE -a"d = pa_-a
AND +##*8 IN &5+#%
9a_!'"&;#.pe-en#a&e =
400 : 9a_!'"&;#.+ea#+o-- > 9a_!'"&;#.+ea#+ma0%
SA A! "A#$0 $5%24
WRITE< > 9a_!'"&;#.-a"d7
9a_!'"&;#.-onn"d7
9a_!'"&;#.!'da#e7
9a_!'"&;#.+ea#+o--7
9a_!'"&;#.+ea#+ma07
9a_!'"&;#.pe-en#a&e7ABA%
/IDE< 9a_!'"&;#.-a"d7 9a_!'"&;#.-onn"d7 9a_!'"&;#.!'da#e%
ENDSELECT%
AT LINE.SELECTION%
IF +$.'+"nd = 4%
WRITE< > 9a_!'"&;#.-a"d7 9a_!'"&;#.-onn"d7 9a_!'"&;#.!'da#e%
*LINE%
SKIP%
SELECT (oo8"d -,+#om"d -,+##$pe -'a++ ode_da#e
+mo8e -an-e''ed 'o--,am 'o--,8e$
FROM +(oo8 INTO CORRESPONDING FIELDS OF 9a_+(oo8
W/ERE -a"d = 9a_!'"&;#.-a"d
AND -onn"d = 9a_!'"&;#.-onn"d
AND !'da#e = 9a_!'"&;#.!'da#e%
WRITE< > 9a_+(oo8.(oo8"d7
9a_+(oo8.-,+#om"d7
9a_+(oo8.-,+##$pe7
9a_+(oo8.-'a++7
9a_+(oo8.ode_da#e7
9a_+(oo8.+mo8e7
9a_+(oo8.-an-e''ed7
9a_+(oo8.'o--,am C*RRENCY 9a_+(oo8.'o--,8e$7
9a_+(oo8.'o--,8e$%
ENDSELECT%
ENDIF%
SA A! "A#$0 $5%25
6
SAP AG 2003
$creen Attributes and $tren"ths
Creatin" $creens
7a!out
Field Attributes
Flo* 7o"ic
,ata Transort
5sin" Pushbuttons and /'aluatin" 5ser Actions
Contents3
5ser ,ialo"s3 $creens
SA A! "A#$0 $6%$
6.2
SAP AG 2003
At the conclusion o) this unit2 !ou *ill be able to3
5ser ,ialo" $creen3 5nit 0b1ecti'es
,escribe screen attributes and stren"ths
Write a ro"ram that3
,isla!s data on a screen
Allo*s the user to chan"e some o) that data
Allo*s the user to in)luence )urther ro"ram
rocessin" usin" ushbuttons
SA A! "A#$0 $6%2
6.3
SAP AG 2003
Fle+ible Fle+ible
ro"ram )lo* ro"ram )lo*
200
120
1@0
100
#00
T!e T!e checks checks
Consistenc! check Consistenc! check
durin" data entr! durin" data entr!
Possi$le entries Possi$le entries
'elp 'elp
%nput %nput 'elp 'elp
A
$creen Attributes
/ditin" /ditin"
otions otions
S-reens are ma'e u, o* more t.an Hust a s-reen layout +it. in,ut an' out,ut *iel's. ".ey also .ave
t.eir o+n ,ro-essin7 lo7i-.
".e *a-t t.at t.e A8A Di-tionary is inte7rate' in t.e system means t.at automati- -onsisten-y
-.e-(s *or s-reen in,ut *iel's are ,rovi'e'. ".ese -.e-(s in-lu'e ty,e -.e-(s0 *orei7n (ey -.e-(s0
an' *i:e' value -.e-(s. All o* t.ese -.e-(s are automati-ally su,,lie' +it. in*ormation *rom t.e
A8A Di-tionary.
&.e-(s li(e t.e ones above -an be -om,lemente' by ot.er ,ro7ram%s,e-i*i- -.e-(s. #it. t.e
te-.niEues available *or s-reens 0 you -an -ontrol t.e or'er in +.i-. -.e-(s are ,er*orme' an'0 i*
errors o--ur0 ma(e t.e *iel's in,ut rea'y a7ain0 +.ere a,,ro,riate.
Fou -an also set u, s-reen layout in a very *le:ible +ay. 1n,ut *iel's0 out,ut *iel's0 ra'io buttons0
-.e-(bo:es0 an' even ,us.buttons -an be ,la-e' on s-reens. ".ese *eatures allo+ users to 'etermine
t.e 'ire-tion in +.i-. t.e ,ro7ram +ill ,ro-ee'.
".e same e'itin7 o,tions are available *or t.e s-reen as *or list 'is,lay an' t.e sele-tion s-reen) t.e
*i:e' ,oint numbers an' t.e 'ate are set a--or'in7 to t.e user 'e*ault values0 t.e time in *ormat
..)mm)ss0 amounts a--or'in7 to t.e settin7 in a -urren-y *iel'0 an' len7t.s an' +ei7.ts a--or'in7 to
t.e -ontent o* a unit%o*%measure *iel'.
SA A! "A#$0 $6%3
6.4
SAP AG 2003
0tions )or Callin" $creens
100
200
#00
120
1@0
Transaction code
CA77 $C8//( 100&
"o start a s-reen seEuen-e)
S,e-i*y t.e *irst s-reen as t.e start s-reen o* a transa-tion -o'e o* t.e ty,e dialog transaction
&all a s-reen *rom any one A8A ,ro-essin7 blo-( in t.e ,ro7ram
".is unit -on-entrates on t.e latter o,tion.
SA A! "A#$0 $6%4
6.5
SAP AG 2003
/l0t /l0t Conn Conn! ! 4ept 4ept 4est 4est! !
*: 0@00 /.A /rankfurt I/K 7ew Cork
*: 0@00 /.A /rankfurt I/K 7ew Cork
!!!
SN 0002 S%7 Sin0apore S/ San /rancisco
Timetable
Chan"e )li"ht data Chan"e )li"ht data
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
Chan"e
in
database
$creen
Alication /+amle3 ,estination
79
0@00
P32@
10310300
F8A
JFF
$a'e Back
1n t.e *ollo+in7 units0 you +ill 'evelo, a ,ro7ram0 in several ste,s0 t.at enables t.e user to -.an7e
t.e master 'ata o* t.e *li7.t timetable.
Double%-li-(in7 on an entry in t.e basi- list -ontainin7 t.e *li7.t timetable -alls a s-reen0 +.i-.
'is,lays 'ata *rom t.e line you sele-te'0 an' a''itional in*ormation about t.e *li7.t -onne-tion.
Fou -an -.an7e t.e *li7.t 'uration an' t.e 'e,arture time.
&.oosin7 ,ac- ta(es t.e user ba-( to t.e basi- list +it.out -.an7in7 any 'ata.
&.oosin7 Save -.an7es t.e 'ata in t.e 'atabase.
".ere is a *un-tion mo'ule *or 'atabase -.an7es t.at is im,lemente' later on @see t.e unit about
&ross%ro7ram Mo'ulari<ationA.
SA A! "A#$0 $6%5
6.6
SAP AG 2003
Comonents )or $creen Processin"
Attributes /lement list Flo* control
$creen number
$hort te+t
$creen t!e
(e+t screen
&&&
PROCESS 'EFORE OUTPUT.
MODULE +le%,5N5+8e.
PROCESS AFTER INPUT.
MODULE 0&e,5+""%#8.
$creen
Painter
Attributes3
C9A820
8e.uired entr!
)ield
&&&
7a!out
,earture Cit!
4a-. s-reen .as t.e *ollo+in7 in*ormation)
Attri&utes$
1n-lu'e a *our%'i7it number as t.e s-reen name0 'esi7nation0 an' a s.ort te:t in*ormation on t.e
s-reen ty,e @*or e:am,le0 normal *or *ull si<e s-reenA.
8ayout$
1n-lu'es elements you -an ,la-e on t.e s-reen. 4lements t.at are 'is,laye' on t.e s-reen are -alle'
screen elements.
!lement list$
&ontains t.e attributes o* t.e s-reen elements0 su-. as t.e ,osition0 si<e0 an' 'ata ty,e.
Flo* control$
&ontains t.e ,ro-essin7 lo7i- t.at is to be ,ro-esse' be*ore t.e s-reen is sent to t.e ,resentation
server @06A an' t.e ,ro-essin7 lo7i- t.at is to be ,ro-esse' a*ter a user a-tion .as ta(en ,la-e.
SA A! "A#$0 $6%6
6.7
SAP AG 2003
/ditin" Windo* in the %rahical 7a!out /ditor
%rahical 7a!out /ditor
/lement
attributes
/lement list
Create )ields *ith
re)erence to the
,ictionar!
Toolbar
7a!out area
=rom t.e !ra,.i-al 6ayout 4'itor0 you -an start ot.er *un-tions)
!lement attri&utes$
All t.e attributes o* a s-reen element are 'is,laye' in t.is 'ialo7 bo:. Fou -an -.an7e some o* t.e
attributes in t.e bo:. 4:am,le) you -an s,e-i*y +.et.er or not an in,ut/out,ut *iel' is to be in,ut
rea'y.
4et #rom A0A >ictionary : 4et #rom pro.ram$
".is 'ialo7 bo: allo+s you to 7enerate *iel's t.at .ave eit.er a 7lobal ty,e or t.e same ty,e as a
'ata obHe-t in t.e ,ro7ram.
!lement list)
S.o+s all t.e elements 'is,laye' on t.e s-reen +it. t.eir attributes. Fou -an also -.an7e
attributes .ere..
SA A! "A#$0 $6%B
6.8
SAP AG 2003
/l0t /l0t Conn Conn! ! 4ept 4ept 4est 4est! !
*: 0@00 /.A /rankfurt I/K 7ew Cork
*: 0@00 /.A /rankfurt I/K 7ew Cork
!!!
SN 0002 S%7 Sin0apore S/ San /rancisco
Timetable
Chan"e )li"ht data Chan"e )li"ht data
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
/+amle o) 7e'el 13 Create $creen
$creen
Four *irst ste, is to -reate a s-reen0 s,e-i*y its layout0 an' 'e*ine its *iel' attributes.
".e *iel's Airline0 =li7.t number0 De,arture air,ort0 an' Destination air,ort are to a,,ear as out,ut
*iel's. ".e *iel's =li7.t 'uration an' De,arture time are available as in,ut%rea'y *iel's.
".e user s.oul' be able to -all t.e s-reen by 'ouble%-li-(in7 a line +it.in t.e basi- list an' return to
t.e basi- list by -.oosin7 t.e a,,ro,riate *un-tion on t.e s-reen.
SA A! "A#$0 $6%C
6.C
SAP AG 2003
Cancel Ces 7o
Create ob1ect
$creen 100 does not e+ist&
,o !ou *ant to create the ob1ectA
Creatin" a $creen3 $creen Attributes
:
AT LINE6SELECTION.
:
CALL SCREEN ?)).
:
$hort te+t
(e+t screen
0
ABAP
?)) ?)) ,ouble4click
$creen Attributes
$ulemental data disla!
$creen t!e
(ormal
$ubscreen
6odal dialo" bo+
$creen
Painter
".ere are several +ays to -reate s-reens)
Throu.h #or*ar" na+i.ation) Fou -an -reate s-reens *rom +it.in t.e A8A 4'itor by 'ouble%
-li-(in7 on t.e s-reen number. ".is trans*ers you to S-reen ainter automati-ally.
/sin. 6&<ect -a+i.ator) Fou -an -reate a ne+ ,ro7ram obHe-t s-reen *or your ,ro7ram 'ire-tly
*rom t.e obHe-t list in t.e navi7ation area.
#.en you -reate a s-reen0 t.e system +ill as( you to enter screen attri&utes. 4nter a s.ort
'es-ri,tion o* t.e s-reen0 sele-t s-reen ty,e 6ormal# an' enter t.e number o* t.e subseEuent s-reen.
1* you enter 0 *or t.e subseEuent s-reen0 t.e system *irst ,ro-esses your s-reen -om,letely an' t.en
returns to ,ro-essin7 at t.e ,oint +.ere t.e s-reen -all is set. @2ote t.at L0L in t.e entry *iel' *or t.e
subseEuent 'yn,ro is not 'is,laye' be-ause t.is is a-tually t.e inital value.A
1n t.e e:am,le in t.e 7ra,.i-0 t.e s-reen t.e user -reates is -alle' *rom +it.in t.e basi- list.
".ere*ore0 CALL SCREEN 400 must belon7 to t.e AT LINE.SELECTION event blo-(%
SA A! "A#$0 $6%9
6.,0
SAP AG 2003
Inut Fields *ith 8e)erence to Fields o) a
,ictionar! $tructure
T
M
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
$,;(CC0((
".ere are t+o +ays o* assi7nin7 *iel' attributes to t.e reEuire' s-reen *iel's)
Copyin. "ata #rom the >ictionary) Fou -an -o,y ty,es an' *iel' attributes *rom e:istin7
A8A Di-tionary stru-tures. ".is ma(es all in*ormation about t.e obHe-t available to you0
in-lu'in7 semanti- in*ormation about its 'ata elements an' *orei7n (ey 'e,en'en-ies. ".e name
o* t.e Di-tionary *iel' is automati-ally a'o,te' as a *iel' name.
Copyin. "ata #rom the pro.ram) Fou -an -o,y *iel' attributes *rom 'ata obHe-ts alrea'y
'e*ine' +it.in your ,ro7ram to t.e s-reen. 1n or'er to 'o t.is0 .o+ever0 an a-tivate' -o,y o* t.e
,ro7ram must alrea'y e:ist. ".e name o* t.e 'ata obHe-t is automati-ally ta(en as t.e *iel'
name.
".e !ra,.i-al S-reen ainter allo+s you to 'e*ine 'i**erent s-reen elements @*or e:am,le0 in,ut an'
out,ut *iel's0 (ey+or' te:ts0 bor'ers0 an' so onA +it. relative ease. &.oose t.e 'esire' s-reen
element an' t.en ,la-e it on t.e s-reen usin7 t.e mouse.
Fou -an 'elete s-reen elements sim,ly by ,ointin7 to t.em an' -.oosin7 'elete.
Fou -an move s-reen elements by sele-tin7 t.em an' 'ra77in7 t.em to a ne+ ,osition.
SA A! "A#$0 $6%$0
6.,,
SAP AG 2003
Chan"in" the /lement Attributes o) a Field3
Attribute Windo*
T
M
Attributes Attributes
,ict
FCode FT!
e
7ine Colu
mn
(ame
Te+t
Pro" ,is
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
Inut )ield
0utut )ield
8e.uired )ield
& & &
$,;(CC0((4CA88I,
"o maintain t.e attributes o* a s-reen *iel'0 sele-t t.e *iel' an' -.oose Attriutes"
Fou -an assi7n t.e attribute mandatory @8e5uired fieldA to a s-reen *iel'. At run time0 t.e *iel' +ill
be mar(e' a--or'in7ly i* it is set to initial value.
1* not all reEuire' *iel's .ave been *ille' at run time an' a user a-tion is ,er*orme'0 an error 'ialo7 is
tri77ere' by t.e A8A run time system an' all in,ut *iel's are on-e a7ain 'is,laye' rea'y *or in,ut.
SA A! "A#$0 $6%$$
6.,2
SAP AG 2003
/l0t /l0t Conn Conn! ! 4ept 4ept 4est 4est! !
*: 0@00 /.A /rankfurt I/K 7ew Cork
*: 0@00 /.A /rankfurt I/K 7ew Cork
!!!
SN 0002 S%7 Sin0apore S/ San /rancisco
Timetable
Chan"e )li"ht data Chan"e )li"ht data
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
$creen
/+amle 7e'el 23 ,isla!in" ,ata
79
0@00
P32@
10310300
F8A
JFF
1n ste, t+o you learn .o+ to 'is,lay 'ata on a s-reen by ,ro7rammin7 'ata trans,ort *rom t.e basi-
list to t.e s-reen.
=or t.e user0 t.e ,ro7ram +or(s in t.e *ollo+in7 manner)
8y 'ouble%-li-(in7 on a line in t.e basi- list0 t.e user bran-.es to t.e s-reen +.ere t.e most
im,ortant items o* in*ormation *or t.e *li7.t -onne-tion .e or s.e .as -.osen are 'is,laye'. ".e
*li7.t 'uration an' 'e,arture time are 'is,laye' in a *iel' t.at is rea'y *or in,ut an' .en-e -an be
-.an7e'.
".e user returns to t.e basi- list in one o* several +ays.
#it. t.is in min'0 t.is ,art o* t.e unit +ill 'eal +it.)
Settin7 u, ,rereEuisites *or automati- 'ata trans,ort bet+een t.e ,ro7ram an' s-reen *iel's
De*inin7 t.e s-reen inter*a-e an' ,ro7rammin7 'ata trans,ort to t.e 'ata obHe-ts o* t.e inter*a-e
SA A! "A#$0 $6%$2
6.,3
SAP AG 2003
$creen Inter)ace
$creen
,ata ob1ects
ABAP
rocessin"
block
ABAP ro"ram
,ATA *aCs)li T;P/ s)li&
TAB7/$ sd!nCconn& TA'LES TA'LES
,eclarati'e statements
*aCs)li
Process
Be)ore
0utut
Process
A)ter
Inut
sd!nCconn
$,;(CC0((
".e TA'LES statement 'e*ines an internal 'ata obHe-t t.at serves as an inter*a-e *or t.e s-reen. ".e
TABLES statement al+ays re*ers to an A8A Di-tionary obHe-t @*or e:am,le0 trans,arent table or
stru-tureA.
1* t.e s-reen *iel's an' t.e TABLES statement re*er to t.e same A8A Di-tionary obHe-t0 t.is 'ata
obHe-tYs 'ata is automati-ally trans,orte' to t.e s-reen *iel's every time t.e s-reen is transmitte'.
Any ne+ entries or -.an7es t.at t.e user ma(es on t.e s-reen are t.en trans*erre' ba-( into t.is 'ata
obHe-t.
As a rule0 stru-tures t.at -ontain *iel's o* t.e same ty,e *or t.e 'i**erent tables are -reate' in t.e
A8A Di-tionary. ".e *li7.t 'ata ,ro7rams bein7 -reate' in t.is -ourse use one stru-ture *or master
'ata maintenan-e @+d$n_-onnA an' anot.er *or boo(in7s 'ata @+d$n_(oo8A. 9sin7 your o+n
stru-tures as inter*a-es usually .el,s ma(e a ,ro7ram easier to un'erstan' an' .el,s to avoi' errors
as +ell.
SA A! "A#$0 $6%$3
6.,4
SAP AG 2003
S+,ee# ?))
Time
,ata Transort )rom the Pro"ram to the $creen
ABAP runtime s!stem
ABAP ro"ram
DATA 4%5&!1l* TYPE &!1l*.
TA'LES &8.#5+##.
4%5&!1l*
&8.#5+##
Process
Be)ore
0utut
Process
A)ter
Inut
CALL SCREEN ?)).
Data trans,ort bet+een ,ro7ram 'ata obHe-ts an' s-reen *iel's +it. t.e same name ta(es ,la-e
automati-ally)
1mme'iately be*ore t.e s-reen is sent to t.e ,resentation server0 t.at is0 a#ter t.e 06 event .as
been *ully ,ro-esse'0 t.e -ontents *rom *iel's +it. t.e same names are -o,ie' *rom t.e A8A +or(
area into t.e s-reen *iel's.
A8A statements *a-ilitate 'ata trans,ort bet+een A8A ,ro7ram 'ata obHe-ts an' t.e +or( area
'esi7nate' as t.e s-reen inter*a-e.
SA A! "A#$0 $6%$4
6.,5
SAP AG 2003
Time
,ata Transort )rom the $creen to the Pro"ram
Process
Be)ore
0utut
Process
A)ter
Inut
4%5&!1l*
&8.#5+##
CALL SCREEN ?)).
S+,ee# ?))
Data trans,ort bet+een s-reen *iel's an' ,ro7ram 'ata obHe-ts +it. t.e same name ta(es ,la-e
automati-ally)
1mme'iately a*ter a user ,er*orms an a-tion on t.e s-reen0 t.at is0 &e#ore t.e A5 event is *ully
,ro-esse'0 t.e -ontents o* t.e *iel's +it. t.e same name are -o,ie' *rom t.e s-reen *iel's into t.e
A8A +or( area.
A8A statements *a-ilitate 'ata trans,ort bet+een He-ts t.e +or( area 'esi7nate' as t.e s-reen
inter*a-e an' ,ro7ram 'ata obHe-ts..
SA A! "A#$0 $6%$5
6.,6
SAP AG 2003
,ata Transort in the Pro"ram /+amle
ABAP runtime s!stem
CALL SCREEN ?)).
Time
Automatic
data transort
9I,/ area
in data ob1ects
TAB7/$ structure
in screen )ields
$creen )ields in
TA'LES structure
AT LINE6SELECTION.
Fill the
TAB7/$ structure
*ith current data
)or selected line
".e sam,le ,ro7ram s.oul' 'is,lay s-reen 'ata t.at mat-.es t.e line sele-te' in t.e basi- list.
1* 'ata obHe-ts an' t.eir values +ere store' in t.e /IDE area +.en t.e basi- list +as -reate'0 t.e 'ata
belon7in7 to t.e sele-te' line +ill be ,la-e' in t.e -orres,on'in7 'ata obHe-ts.
Fou must -o,y t.e 'ata to be 'is,laye' on t.e s-reen to a TABLES stru-ture. Fou -an 'o t.is in any
A8A ,ro-essin7 blo-( t.at is ,ro-esse' be*ore t.e s-reen is sent to t.e ,resentation server. ".ere
are various +ays o* 'oin7 t.is)
Fou start by rea'in7 all t.e 'ata to be 'is,laye' on t.e s-reen be*ore retrievin7 t.e basi- list *rom
t.e 'atabase. Fou t.en ,la-e all t.e ne-essary 'ata in t.e /IDE area. ".en0 at t.e AT LINE.
SELECTION event0 you .ave to -o,y t.e 'ata into t.e TA'LES stru-ture only.
>isa"+anta.e$ Fou .ave to rea' 'ata *rom t.e 'atabase t.at t.e user may not even loo( at. 1*
'etaile' 'ata .as -.an7e' bet+een -reatin7 t.e basi- list an' 'is,layin7 t.e s-reen0 t.e system +ill
'is,lay t.e +ron7 'ata.
8e*ore t.e s-reen is -alle' usin7 t.e SELECT SINGLE statement0 you rea' t.e a''itional 'ata *or
t.e sele-te' (ey @/IDE areaA *rom t.e 'atabase.
A"+anta.e$ Fou re'u-e t.e volume o* 'ata you nee' to rea' *rom t.e 'atabase +.en you -reate
t.e basi- list. ".e 'etaile' list is u,%to%'ate.
>isa"+anta.e$ ".e system sen's a Euery to t.e 'atabase every time t.e user 'ouble%-li-(s t.e list.
SA A! "A#$0 $6%$6
6.,7
SAP AG 2003
Imlementin" the $amle Pro"ram
Fields3
6A(,T
CA88I,
C0((I,
C05(T8;F8
CIT;F806
AI8PF806
C05(T8;T0
CIT;T0
AI8PT0
F7TI6/
,/PTI6/
A88TI6/
,I$TA(C/
,I$TI,
F7T;P/
Basic
7ist 9I,/ Area
$creen3
0utut Field Inut Field

Be)ore callin" the screen Be)ore callin" the screen3 3


$/7/CT $I(%7/ > F806 $/7/CT $I(%7/ > F806 s)li s)li &&& &&&
*aCs)li $tructure3 sd!nCconn
3n t.e last 'evelo,ment level0 t.e ,ro7ram s.oul' allo+ t.e user to -.an7e 'ata in t.e 'atabase. ".e
user s.oul' be able to -.an7e t.e *iel's FLTIME an' DEPTIME. "o enable t.e user to -.an7e 'ata
*or several airlines0 a basi- list o* t.e airlines *or +.i-. t.e user is allo+e' to -.an7e 'ata s.oul' be
'is,laye'. ".e user rea-.es t.e -.an7e s-reen by 'ouble%-li-(in7 in t.e basi- list. 3n-e t.e -.an7es
are ma'e su--ess*ully0 t.e user returns to t.e basi- list. >o+ever0 a ne+ basi- list is not -reate'.
".ere*ore0 t.e 'ata t.at -an be -.an7e' s.oul' not a,,ear on t.e basi- list.
"o ensure t.at t.e 'atabase 'ata 'is,laye' on t.e s-reen is u,%to%'ate0 t.e re-or' is rea' a7ain *rom
t.e 'atabase at t.e be7innin7 o* AT LINE.SELECTION.
A'vanta7es o* t.is met.o')
=or t.e basi- list0 only t.ose -olumns o* t.e 'atabase table t.at are 'is,laye' on t.e list nee' to be
rea'. ".is -an im,rove ,er*orman-e +it. lar7e lists.
".e 'ata t.at is 'is,laye' on t.e s-reen is al+ays u,%to%'ate0 even i* t.e 'ata re-or' sele-te' .as
Hust been -.an7e' usin7 t.is ,ro7ram.
&.an7es ma'e to t.e 'atabase usin7 t.e s-reen 'o not lea' to in-orre-t values in t.e basi- list
be-ause t.e mo'i*iable *iel's are not -ontaine' in t.e basi- list.
SA A! "A#$0 $6%$B
6.,8
SAP AG 2003
START6OF6SELECTION.
SELECT +%,,*8 +##*8 %*,!1," +*$.1," %*,!$ +*$.$
INTO CORRESPONDING FIELDS OF 4%5&!1l*
FROM &!1l*.
7RITE: / 4%5&!1l*6+%,,*8 COLOR COL5CEY:
4%5&!1l*6+##*8 COLOR COL5CEY:
...
* 2011e,*#/ Ne. 1*el8&
HIDE: 4%5&!1l*6+%,,*8: 4%5&!1l*6+##*8.
ENDSELECT.
AT LINE6SELECTION.
SELECT SINGLE * FROM &!1l*
INTO 4%5&!1l*
7HERE +%,,*8 ; 4%5&!1l*6+%,,*8
AND +##*8 ; 4%5&!1l*6+##*8.
CALL SCREEN ?)).
HIDE: HIDE: 4% 4%5 5&!1l* &!1l*6 6+%,,*8 +%,,*8: : 4% 4%5 5&!1l* &!1l*6 6+##*8 +##*8. .
SELECT SINGLE * FROM SELECT SINGLE * FROM &!1l* &!1l*
INTO INTO 4% 4%5 5&!1l* &!1l*
7HERE 7HERE +%,,*8 +%,,*8 ; ; 4% 4%5 5&!1l* &!1l*6 6+%,,*8 +%,,*8
AND AND +##*8 +##*8 ; ; 4% 4%5 5&!1l* &!1l*6 6+##*8 +##*8. .
MO>E MO>E6 6CORRESPONDING CORRESPONDING 4% 4%5 5&!1l* &!1l* $ $ &8.# &8.#5 5+## +##. .
$!nta+3 $amle Pro"ram *ith ,ata Transort
"o 'is,lay 'ata on t.e s-reen0 t.e TABLES stru-ture must be *ille' +it. -urrent 'ata be*ore t.e
s-reen is sent to t.e ,resentation server. ".e e:am,le in t.e 7ra,.i- s.o+s one +ay o* 'oin7 t.is.
".e /IDE statement is use' to ,la-e (ey *iel's o* 'atabase tables +it. re*eren-e to t.e list line in t.e
/IDE area. ".en t.e -urrent 'ata *or t.e line sele-te' is available in *iel's 9a_+p!'".-a"d
an' 9a_+p!'".-onn"d at event AT LINE.SELECTION.
".e 'ata re-or' is rea' *rom t.e 'atabase usin7 SELECT SINGLE. ".is ensures t.at t.e 'ata is u,%
to%'ate.
".e -orres,on'in7 *iel's o* t.e 9a_+p!'" +or( area are -o,ie' to t.e TABLES stru-ture
+d$n_-onn usin7 MO)E6CORRESPONDING. ".e system trans,orts t.e stru-ture 'ata to t.e s-reen
*iel's automati-ally.
Alternatively0 you -an ,la-e t.e 'ata into t.e TABLES stru-ture 'ire-tly +.en t.e 'atabase is
a--esse'0 usin7 t.e INTO CORRESPONDING FIELDS a''ition.
SA A! "A#$0 $6%$C
6.,C
SAP AG 2003
/l0t /l0t Conn Conn! ! 4ept 4ept 4est 4est! !
*: 0@00 /.A /rankfurt I/K 7ew Cork
*: 0@00 /.A /rankfurt I/K 7ew Cork
!!!
SN 0002 S%7 Sin0apore S/ San /rancisco
Timetable Timetable
Chan"e )li"ht data Chan"e )li"ht data
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht duration
,earture time
$creen $creen
/+amle 7e'el #3 Assi"nin" Pushbuttons
6essa"e 2in status line
6essa"e 1
in status line
79
0@00
P32@
10310300
F8A
JFF
$a'e Back
1n ste, t.ree you learn .o+ to assi7n ,us.button *un-tions. ".ese *un-tions allo+ 'i**erent (in's o*
,ro7ram lo7i- to be ,ro-esse' a--or'in7 to user -.oi-e.
=or t.e user0 t.e ,ro7ram +or(s in t.e *ollo+in7 manner)
8y 'ouble%-li-(in7 on a line0 t.e user bran-.es to a s-reen +.ere t.e most im,ortant items o*
in*ormation *or t.e -onne-tion t.e user -.ose are 'is,laye'. ".e *li7.t 'uration an' 'e,arture time
-an be -.an7e'.
8y -.oosin7 t.e 8a-( ,us.button0 t.e user returns to t.e basi- list +it.out +ritin7 any -.an7es to
t.e 'atabase. ".e messa7e LS-reen +as le*t +it.out any -.an7es bein7 ma'eL is 'is,laye' in t.e
status bar o* t.e basi- list.
&.oose Save to +rite all o* your -.an7es to t.e 'atabase. ".e -.an7es ta(e e**e-t in t.e ,ro7ram
only at a later time. ".e ,us.button is alrea'y ,re,are' in t.e *ollo+in7 se-tion. ".e user returns
to t.e basi- list a*ter -.oosin7 t.e ,us.button an' a messa7e is 'is,laye' in t.e status bar. .
A*ter ea-. ot.er user a-tivity0 t.e s-reen is 'is,laye' on-e a7ain.
#it. t.is in min'0 t.is ,art o* t.e unit 'eals +it.)
=lo+ lo7i- in 83 an' A1 event blo-(s
9sin7 83 an' A1 mo'ules as A8A ,ro-essin7 blo-(s *or s-reen ,ro7rammin7
4valuatin7 in*ormation on +.i-. ,us.button +as sele-te' at t.e time o* A1
SA A! "A#$0 $6%$9
6.20
SAP AG 2003
8untime Beha'ior When 5ser Chooses a
Pushbutton
Time
%lobal data ob1ect
ABAP runtime s!stem
ABAP ro"ram
Back
Function code BACF
okCcode BACF
CASE N5+8e.
7HEN <'ACC<.
...
ENDCASE.
1* t.e user -.ooses a ,us.button0 t.e run time system -o,ies t.e asso-iate' *un-tion -o'e to a s,e-ial
s-reen *iel'. ".is s-reen *iel' is usually -alle' t.e o8_-ode%
".e -ontent o* t.is s-reen *iel' is t.en automati-ally trans,orte' i* t.ere is an A8A 'ata obHe-t o*
t.e same name.
".e -ontent o* t.is o8_-ode *iel' -an t.en be evaluate' in an A8A ,ro-essin7 blo-(.
".is me-.anism allo+s you to -reate a ,ro7ram *lo+ t.at 'e,en's on t.e userYs a-tions. ".e
*ollo+in7 sli'es 'eal +it. .o+ you 'e-lare t.e o8_-ode *iel'0 .o+ you -reate ,us.buttons an'
assi7n *un-tion -o'es to t.em0 an' .o+ you -an -.an7e t.e s-reen seEuen-e.
SA A! "A#$0 $6%20
6.2,
SAP AG 2003
,e)inin" Pushbuttons / Assi"nin" Function Codes
T
M
Attributes Attributes
,ict
FCode FT!e
7ine
Colum
n
(ame
Te+t
Pro" ,is
Airline
Fli"ht number
,earture airort
,estination airort
Fli"ht time
,earture time
Back
Inut )ield
0utut )ield
& & &
B5TT0(2
$a'e
BACF
Back
"o be able to trans,ort in*ormation as to +.i-. ,us.button +as -.osen0 you must assi7n a *un-tion
-o'e to ea-. ,us.button. Fou -an 'o t.is eit.er in t.e !ra,.i-al 6ayout 4'itor usin7 t.e
maintenan-e *un-tion *or *iel' attributes or *rom t.e element list.
SA A! "A#$0 $6%2$
6.22
SAP AG 2003
6akin" the Command Field 5sable
Screen Painter Screen Painter? *ist ? *ist of of Elements Elements
B5TT0(1
B5TT0(2
0FCC0,/ 0F
$a'e
Back
$AH/
BACF
Field name
&&& &&&
TA'LES &8.#5+##.
DATA: N5+8e l*Ne &.60+"".
ABAP
/ditor
$creen
Painter
Function code Field te+t
%eneral attributes
DATA DATA N N5 5+8e +8e LICE LICE &. &.6 60+"" 0+"". .
1
2
0FCC0,/ 0FCC0,/
".e -omman' *iel' serves as a s,e-ial *iel' into +.i-. -orres,on'in7 *un-tion -o'es are ,la-e' a*ter
every user a-tion.
".is *iel' must be 7iven a name in t.e last line o* t.e list o* elements on ea-. s-reen. !enerally0 you
use t.e name 3KO&3D4.
1n t.e 'e-laration ,art o* t.e ,ro7ram0 'e*ine a -orres,on'in7 'ata obHe-t +it. t.e same name. At run
time0 +.enever a user a-tion is tri77ere'0 t.e *un-tion -o'e o* t.e ,us.button -.osen is ,la-e' into
t.e 'ata obHe-t. Fou -an use t.e system *iel' sy%u-omm as a re*eren-e *iel' *or t.e ty,e.
SA A! "A#$0 $6%22
6.23
SAP AG 2003
Time
Callin" 6odules
100
PB0
CALL SCREEN ?)).
MODULE #%"e
OUTPUT.
ENDMODULE.
MODULE
#%"e.
PAI
MODULE
#%"e.
MODULE #%"e
INPUT.
ENDMODULE.
".e A8A statement CALL SCREEN L####M interru,ts t.e ,ro-essin7 o* t.e ,ro-essin7 blo-(
an' -alls a s-reen.
4a-. s-reen .as t+o event blo-(s)
PROCESS 'EFORE OUTPUT F06G is ,ro-esse' imme'iately be*ore a s-reen is 'is,laye'.
At t.is time0 mo'ules are -alle' t.at ta(e -are o* tas(s su-. as ,resettin7 values in s-reen *iel's.
PROCESS AFTER INPUT FA5G is ,ro-esse' imme'iately a*ter a user a-tion. All ,ro7ram
lo7i- t.at is in*luen-e' by user a-tion must be ,ro-esse' at PAI.
-ote$ ".e -o'e *or t.e events 83 an' A1 is +ritten usin7 t.e S-reen ainter# not +it. t.e A8A
4'itor. ".ese t+o event blo-(s ma(e u, t.e *lo+ lo7i- o* a s-reen. A s,e-ial small set o* -omman's
@not A8A statementsA is available *or ,ro7rammin7 *lo+ lo7i-. ".e most im,ortant statement .ere
is -alle') MODULE mo'uleOname. ".is -alls t.e mo'uleOname A8A ,ro-essin7 blo-(. #it.in t.is
blo-( you -an -o'e in A8A as usual.
%o"ules are A8A ,ro-essin7 blo-(s +it. no inter*a-e t.at -an be -alle' only *rom +it.in t.e *lo+
lo7i-. Mo'ules are en-lose' +it.in t.e A8A statements MOD*LE an' ENDMOD*LE%
SA A! "A#$0 $6%23
6.24
SAP AG 2003
PROCESS 'EFORE OUTPUT.
ABAP
/ditor
$creen
Painter
Back $a'e
/'aluatin" the Function Code )or PAI
MODULE 0&e,5+""%#85)?)) INPUT.
CASE N5+8e.
7HEN <'ACC<. ...
7HEN <SA>E<. ...
ENDCASE.
ENDMODULE.
MODULE MODULE 0&e, 0&e,5 5+""%#8 +""%#85)?)) INPUT. 5)?)) INPUT.
ENDMODULE. ENDMODULE.
CASE CASE
PROCESS AFTER INPUT.
MODULE 0&e,5+""%#85)?)). MODULE MODULE 0&e, 0&e,5 5+""%#8 +""%#85)?)). 5)?)).
Fou -an evaluate user a-tions in a A1 mo'ule. 9sually0 t.is A1 mo'ule is -alle'
,+e_-ommand_nnnn0 +.ere nnnn stan's *or t.e s-reen number. 1n t.is mo'ule0 evaluate t.e
*un-tion -o'e in t.e o8_-ode *iel'.
-ote$ =or .istori-al reasons0 mo'ules .ave no inter*a-e an' no lo-al variables. Fou -an a--ess all
t.e A8A ,ro7ramYs 7lobal 'ata in mo'ules.
SA A! "A#$0 $6%24
6.25
SAP AG 2003
PROCESS AFTER INPUT.
MODULE 0&e,5+""%#85?)).
MODULE 0&e,5+""%#85?)) INPUT.
ENDMODULE.
ABAP
/ditor
$creen
Painter
Creatin" 6odules 5sin" For*ard (a'i"ation
Cancel Ces 7o
Create ob1ect
PAI module 5$/8CC066A(,C100 does not e+ist&
,o !ou *ant to create the ob1ectA
,ouble4click
#SE.ECMMA74E0300
PA% module
7ew include
Main pro0ram
%nclude selection
FBC@00E00E4C7P.
Create PAI module
As a rule0 you im,lement MOD*LE -alls +it.in a s-reenYs *lo+ -ontrol @83 an' A1 eventsA. ".e
mo'ules t.emselves are -reate' usin7 A8A.
".ere are t+o +ays to -reate a mo'ule)
For*ar" na+i.ation) "o -reate a mo'ule0 'ouble%-li-( on t.e mo'ule name in t.e *lo+ lo7i-
*rom +it.in t.e Screen Painter.
-a+i.ation area) 1* you +ant to -reate a mo'ule *rom +it.in t.e obHe-t list o* t.e ,ro7ram0
-.oose a ne+ ,ro7ram obHe-t PBO mod,'e or PAI mod,'e.
A mo'ule -an be -alle' *rom more t.an one s-reen @reusabilityA.
Ma(e sure t.at mo'ules -alle' at 83 events are 'e*ine' usin7 t.e statement MOD*LE %%%
O*TP*T0 +.ereas mo'ules 'e*ine' usin7 t.e statement MOD*LE %%% INP*T -an be -alle' only
at A1 events.
SA A! "A#$0 $6%25
6.26
SAP AG 2003
Time
(e+t $creen3 CA77 $C8//( $tatement
100
PB0
CALL SCREEN ?)).
PAI
$creen attributes
(e+t screen 0
NeB$ &+,ee# )
1* you enter 0 *or t.e ne:t s-reen0 t.e system *irst ,ro-esses your s-reen -om,letely an' t.en
-ontinues ,ro-essin7 t.e ,ro7ram *rom t.e ,oint +.ere t.e s-reen +as -alle'.
SA A! "A#$0 $6%26
6.27
SAP AG 2003
Time
(e+t $creen3 $et $taticall!
CALL SCREEN ?)).
...
NeB$ &+,ee# ?))
100
PB0
PAI
$creen attributes
(e+t screen 100
1* you set t.e ne:t s-reen *or s-reen $00 to $000 t.e system ,ro-esses t.e s-reen a7ain a*ter it .as
*inis.e' ,ro-essin7 t.e A1 mo'ule.
SA A! "A#$0 $6%2B
6.28
SAP AG 2003
Time
(e+t $creen3 $et ,!namicall!
CALL SCREEN ?)).
...
$/T $C8//( 0& SET SCREEN ). SET SCREEN ).
)
NeB$ &+,ee# )
100
PB0
PAI
$creen attributes
(e+t screen 100
9sin7 t.e A8A statement SET SCREEN nnnn *rom +it.in a A1 mo'ule0 you -an .ave t.e ne:t
s-reen set 'ynami-ally. ".e stati- entry is t.en su,,resse'.
".e number o* t.e -urrent s-reen is entere' by t.e system as t.e stan'ar' entry *or t.e ne:t s-reen.
".is ensures t.at t.e 4nter (ey or t.e 7reen -.e-(mar( lea' to a *iel' -.e-( onlyI a*ter+ar's t.e
s-reen is transmitte' on-e a7ain0 ,ossibly +it. a res,e-tive error messa7e. "o leave t.e s-reen0 an
a,,ro,riate ,us.button must be 'e*ine' t.at tri77ers a s-reen -.an7e +it.in t.e A1 mo'ule.
-ote$ 1* t.e system ,ro-esses t.e same s-reen a7ain0 it also runs t.rou7. all t.e 83 mo'ules a7ain.
1* you 'e-i'e to *ill t.e TABLES stru-ture in a 83 mo'ule0 ma(e sure t.at 'ata -.an7es ma'e by
t.e user are not over+ritten on t.e s-reen i* t.e mo'ule 7ets -alle' t+i-e
SA A! "A#$0 $6%2C
6.2C
SAP AG 2003
$!nta+ /+amle3 /'aluatin" the Function Codes
DATA N5+8e LICE &.60+"".
.
.
MODULE 0&e,5+""%#85)?)) INPUT.
CASE N5+8e.
7HEN <'ACC<.
SET SCREEN ).
MESSAGE &)VFD'C())E.
7HEN <SA>E<.
* +%ll*#/ % 10#+$*# "80le $ &%ve +-%#/e&
* *& le1$ 0$ 1, 8*8%+$*+%l ,e%&#&
SET SCREEN ).
MESSAGE &)VFD'C())E.
ENDCASE.
ENDMODULE.
CASE CASE N N5 5+8e +8e. .
7HEN <'ACC<. 7HEN <'ACC<.
7HEN <SA>E<. 7HEN <SA>E<.
=or t.e e:am,le *or evaluatin7 *un-tion -o'es0 t+o ,us.buttons are 'is-usse')
&.oosin7 8A&K 'ynami-ally sets t.is value to 0. ".is sen's t.e user ba-( to t.e -all,oint. 1n our
-ase0 t.is means t.e user returns to t.e basi- list. Messa7e 05B a,,ears in t.e status bar o* t.e ne:t
s-reen.
#it. SA;4A t.e ,ro7ram be.aves in t.e same +ay as 8A&K. ".e user returns to t.e basi- listI
.o+ever0 t.ere is a ne+ messa7e in t.e status bar. 1n t.e unit about &ross%ro7ram
Mo'ulari<ation0 t.e ,ro7ram is en.an-e' +it. a 'ata re-or' -.an7e.
SA A! "A#$0 $6%29
6.30
SAP AG 2003
Time
8untime Beha'ior )or $ecial $ituation3 (o
Function Code Is Assi"ned to the /(T/8 Fe!
$creen )ield
0FCC0,/
Basic list
,ata ob1ect
okCcode
BACF
BACF
BACF
$creen 100
BACF
BACF
BACF
,ouble4click
Back to
basic list
Transmit
screen 100
,ouble4click
Transmit
screen 100
Back to
basic listA
".is se-tion +al(s t.rou7. a ,arti-ular s-enario to ,oint out t.e ne-essity o* an a''itional ,ro7ram
ste,.
".e user starts t.e ,ro7ram an' 'ouble%-li-(s to 'is,lay 'etaile' in*ormation on t.e s-reen. A*ter
'eterminin7 t.at all t.e 'ata is -orre-t t.e user returns to t.e basi- list by -.oosin7 t.e 7reen arro+.
1n t.is +ay0 t.e *un-tion -o'e 8A&K0 +.i-. is assi7ne' to t.is stan'ar' ,us.button0 is ,la-e' in t.e
-omman' *iel' an' t.en it is trans,orte' automati-ally to t.e 7lobal 'ata obHe-t o8_-ode o* t.e
A8A ,ro7ram. ".is *un-tion -o'e is t.en evaluate' in a A1 mo'ule. ".e ne:t s-reen is set to 0.
".en AT LINE.SELECTION is ,ro-esse' *urt.er. 1* t.ere is no WRITE statement t.ere0 t.e system
'is,lays t.e basi- list a7ain.
".e user t.en 'is,lays 'etails *or anot.er re-or' by 'ouble%-li-(in7 it. ".rou7. automati- *iel'
trans,ort0 t.e -ontent o* t.e 7lobal 'ata obHe-t o8_-ode is trans,orte' into t.e s-reen *iel' +it. t.e
same name an' t.e s-reen is 'is,laye'.
1* t.e user no+ -.ooses Enter0 t.e s-reen is 'is,laye' on-e a7ain0 ,rovi'e' no *un-tion -o'e .as
been assi7ne' to t.e 4nter (ey. @Stan'ar' -aseNA ".ere*ore0 t.e -omman' *iel' is not over+ritten.
".e *un-tion -o'e 8A&K remains in t.e -omman' *iel' an' is -o,ie' to t.e 7lobal 'ata obHe-t
o8_-ode at t.e be7innin7 o* t.e A1 event.
".is *un-tion -o'e is t.en evaluate' in a A1 mo'ule. &onseEuently0 as 'es-ribe' above0 t.e system
7oes ba-( to t.e basi- list0 instea' o* 'is,layin7 t.e s-reen a7ain.
SA A! "A#$0 $6%30
6.3,
SAP AG 2003
$olution 0tion3
,eletin" the Command Field )or PB0
PROCESS 'EFORE OUTPUT.
MODULE +le%,5N5+8e.
PROCESS AFTER INPUT.
MODULE 0&e,5+""%#85)?)).
ABAP
/ditor
MODULE +le%,5N5+8e OUTPUT.
CLEAR N5+8e.
ENDMODULE.
MODULE 0&e,5+""%#85)?)) INPUT.
CASE N5+8e.
...
ENDMODULE.
$creen
Painter
Back $a'e
MODULE MODULE +le%, +le%,5 5N N5 5+8e +8e OUTPUT. OUTPUT.
ENDMODULE. ENDMODULE.
CLEAR CLEAR N N5 5+8e +8e. .
MODULE MODULE +le%, +le%,5 5N N5 5+8e +8e. .
1* t.e -omman' *iel' is not initiali<e'0 errors -an o--ur sin-e not every ,us.button must .ave a
*un-tion -o'e assi7ne' to it. ".ere are t+o +ays to initiali<e a -omman' *iel')
1nitiali<e t.e o8_-ode *iel' in a 83 mo'ule. ".en it is set to t.e initial value at A10 unless t.e
user .as -arrie' out a user a-tion to +.i-. a *un-tion -o'e is assi7ne'. 1n t.is -ase0 t.e o(O-o'e
*iel' -ontains t.e -urrent *un-tion -o'e.
9se an au:iliary *iel' an' -o,y t.e -ontent o* t.e o8_-ode *iel' into t.e au:iliary *iel' in a A1
mo'ule0 t.en initiali<e t.e o8_-ode *iel'. 1n t.is -ase0 t.e au:iliary *iel' must be Euerie' in t.e
A1 mo'ule *or t.e *un-tion -o'e evaluation.
SA A! "A#$0 $6%3$
6.32
SAP AG 2003
;ou are no* able to3
5ser ,ialo" $creen3 5nit $ummar!
,escribe screen attributes and stren"ths
Write a ro"ram that3
,isla!s data on a screen
Allo*s the user to chan"e some o) that data
Allo*s the user to in)luence )urther ro"ram
rocessin" usin" ushbuttons
SA A! "A#$0 $6%32
6.33Screen
!(ercises
/nit$ Screen
Topic$ Creatin. Screens
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate s-reens
&all e:istin7 s-reens *rom t.e ,ro7ram
".e ,ro7ram SAP'C())UDT5DYNPRO5A enables you to 'is,lay all
boo(in7s ma'e by one travel a7en-y as a list.
As a *irst ste,0 -.an7e t.e ,ro7ram as *ollo+s)
A s-reen is to be -alle' +.enever t.e user 'ouble%-li-(s a line in t.e
basi- list. ".is s-reen s.oul' -ontain in,ut *iel's *or s,e-i*i- boo(in7
'ata t.at is not 'is,laye' on t.e list. ".is s-reen s.oul' also -ontain
out,ut *iel's *or boo(in7 in*ormation t.at is alrea'y 'is,laye' on t.e list.
Any user a-tion s.oul' result in t.e basi- list bein7 'is,laye' a7ain
ro.ram$ @'C())5AA5DYNPRO
%o"el solution$ SAP'C())UDS5DYNPRO5A
Template$ SAPBC400*DT_DYNPRO_A
$%$ &o,y t.e tem,late SAPBC400*DT_DYNPRO_A to your ne+ ,ro7ram
@'C())5AA5DYNPRO.
$%2 8e-ome *amiliar +it. t.e ,ro7ram. "est t.e ,ro7ram usin7 t.e travel a7en-y
number $QQ @HH is your 7rou, numberA.
$%3 Sele-tin7 a line on t.e basi- list @by 'ouble%-li-(in7 or usin7 =2A s.oul' -all a
s-reen. &reate t.is s-reen @s-reen number $00A usin7 *or+ar' navi7ation.
$%4 =or t.e attributes0 assi7n s-reen number 0 as t.e number o* t.e ne:t s-reen0 so t.at
a*ter any user a-tion on s-reen $000 t.e user returns to t.e basi- list.
$%5 &reate in,ut/out,ut *iel's on t.e s-reen. #.en you are assi7nin7 *iel' ty,es0 re*er
to A8A A8A Di-tionary stru-ture SDYN_BOOK.
&o,y boo(in7 table (ey *iel's CARRID0 CONNID0 FLDATE0 an' 'OOCID +it.
t.eir *iel' labels.
SA A! "A#$0 $6%33
".e -ustomer name NAME s.oul' be -o,ie' +it.out a *iel' label an' s.oul' be
'is,laye' ne:t to t.e -ustomer number.
".e *iel's CUSTOMID0 CUSTTYPE0 SMOCER0 CLASS0 LOCCURAM0 an'
LOCCURCEY s.oul' be -o,ie' +it. *iel' labels.
$%6 Maintain t.e s-reen *iel' attributes)
=iel's CARRID0 CONNID0 FLDATE0 'OOCID: an' CUSTOMID s.oul' be
'is,laye' as out,ut *iel's @Output field attributeA.
".e -ustomer name NAME s.oul' be 'is,laye' ne:t to t.e -ustomer number
+it.out te:t @Output only attributeA.
".e *iel's CUSTTYPE0 SMOCER0 CLASS0 LOCCURAM: an' LOCCURCEY are
in,ut/out,ut *iel's @+nput field9Output field attributesA.
SA A! "A#$0 $6%34
!(ercises
/nit$ Screen
Topic$ >ata Transport
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
=ill t.e s-reen *iel's +it. 'ata *rom t.e ,ro7ram
&.an7e your ,ro7ram @'C())5AA5DYNPRO)
Double%-li-(in7 on a line o* t.e basi- list 'is,lays 'etails o* t.e sele-te'
boo(in7 on t.e s-reen. 1* t.e user -.an7es 'ata on t.e s-reen0 t.en t.ese
-.an7es s.oul' be available in t.e ,ro7ram on-e t.e user .as le*t t.e
s-reen.
ro.ram$ @'C())5AA5DYNPRO
%o"el solution$ SAP'C())UDS5DYNPRO5'
2.$ &.an7e your ,ro7ram HBC400_##_DYNPRO or -o,y t.e tem,late
SAPBC400*DS_DYNPRO_A to t.e ne+ ,ro7ram HBC400_##_DYNPRO_B%
2.2 1n your ,ro7ram0 use t.e TA'LES statement to -reate a +or( area +it. t.e same
name. ".is +or( area +ill t.en serve as t.e s-reen inter*a-e.
2%3 4nsure t.at t.e (ey *iel's o* t.e S'OOC 'atabase table an' t.e -ustomer name are
still available @HIDE$ ...A in t.e AT LINE6SELECTION event blo-( a*ter a line
.as been sele-te' on t.e basi- list @'ouble -li-( or =2A.
2%4 &.an7e your ,ro7ram a--or'in7ly so t.at 'ata in t.e 'atabase -an be -.an7e'.
Ma(e sure t.at t.e s-reen -an be ,ro-esse' only i* t.e user .as -.an7e aut.ori<ation
*or t.e airline sele-te'.
8e*ore t.e s-reen is -alle'0 retrieve t.e 'ata o* t.e sele-te' ,ostin7 *rom t.e SBOOK
'atabase table into a suitable +or( area @name ,ro,osal) 4%5&2NA "o ma(e sure
t.at t.e 'ata is u,%to%'ate. 1* t.e 'ata re-or' -annot be rea'0 t.e system must 'is,lay
in*ormation messa7e $B6 *rom messa7e -lass BC400. 1* t.e 'ata is rea'
su--ess*ully0 -all t.e s-reen.
2%5 1mme'iately be*ore t.e s-reen is -alle'0 -o,y t.e relevant 'ata into t.e TA'LES
+or( area.
SA A! "A#$0 $6%35
!(ercises
/nit$ Screen
Topic$ Fiel" Transports an" Su&se=uent Screen rocessin.
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate ,us.buttons on s-reens
ro-ess t.e system -o'e tri77ere' +.en t.e user -li-(s on a
,us.button an' t.us -ontrol t.e ,ro7ram *lo+
Set t.e ne:t s-reen 'ynami-ally
&.an7e your ,ro7ram @'C())5AA5DYNPRO)
3n t.e s-reen0 t.e user s.oul' be able to -ontrol ,ro7ram *lo+ t.rou7.
t+o ,us.buttons.
ro.ram$ @'C())5AA5DYNPRO
%o"el solution$ SAP'C())UDS5DYNPRO5C
3%$ &.an7e your ,ro7ram @'C())5AA5DYNPRO or -o,y t.e tem,late
SAP'C())UDS5DYNPRO5' to t.e ne+ ,ro7ram @'C())5AA5DYNPRO5C.
3%2 De*ine t+o ,us.buttons on t.e s-reen t.at allo+ t.e user to eit.er return to t.e basi-
list @PUSH5'ACCA or to save t.e -.an7e' 'ata @PUSH5SA>EA)
2ame o*
,us.button
Te(t =un-tion -o'e
9S>O8A&K 8a-( 0AC2
9S>OSA;4 Save
or i-on
1&32OSFS"4MOSA;4
SA1!
3%3 2ame t.e OC5CODE *iel' on t.e s-reen an' 'e*ine a 'ata obHe-t o* t.e same name
@an' -orres,on'in7 ty,eA in t.e ,ro7ram.
3%4 2avi7ate in t.e *lo+ lo7i-. &reate a mo'ule *or *un-tion -o'e ,ro-essin7 @usin7
*or+ar' navi7ationA at R6C!SS AFT!R 5-/T)
=un-tion -o'e Action 2e:t s-reen
8A&K 2one 6ist
SA A! "A#$0 $6%36
=un-tion -o'e Action 2e:t s-reen
SA;4 First$
1n*ormation messa7e no.
060@8&400A
6ist
All ot.ers 2one S-reen $00
3%5 4nsure t.at ,ressin7 Enter al+ays 'is,lays s-reen $000 re7ar'less o* t.e navi7ation
.istory. 1nitiali<e t.e 62DC6>! *iel' in a 83 mo'ule.
SA A! "A#$0 $6%3B
6.34Screens
Solutions
/nit$ Screens
Topic$ Creatin. Screens
%o"el Solution$ ro.ram SAP'C())UDS5DYNPRO5A
:C..............................................................:
:C Repo# SAPBC400*DS_DYNPRO_A :
:C :
:C :
:C..............................................................:
REPORT +ap(-400,d+_d$npo_a%
CONSTANTS a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A%
* De1*#*$*# 1 &ele+$*# &+,ee#
PARAMETERS pa_an,m TYPE +(oo8.a&en-$n,m%
* 4,N%,e% 1, &ele+$
DATA< 9a_(oo8"n& TYPE +(-400_(oo8"n&%
START.OF.SELECTION%
* &ele+$*#/ 8%$% 0&*#/ %# A'AP 8*+$*#%,. v*e4 $ /e$ $-e 8%$% 1,"
* &2N %#8 $-e +0&$"e, #%"e 1," &+0&$"
SELECT -a"d -onn"d !'da#e (oo8"d -,+#om"d name
FROM +(-400_(oo8"n&
INTO CORRESPONDING FIELDS OF 9a_(oo8"n&
W/ERE a&en-$n,m = pa_an,m%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD 9a_(oo8"n&.-a"d
ID AACT)TA FIELD a-#3#_d"+p'a$%
IF +$.+,(- = 0%
* O0$!0$
WRITE< > 9a_(oo8"n&.-a"d COLOR -o'_8e$7
9a_(oo8"n&.-onn"d COLOR -o'_8e$7
9a_(oo8"n&.!'da#e COLOR -o'_8e$7
9a_(oo8"n&.(oo8"d COLOR -o'_8e$7
SA A! "A#$0 $6%3C
9a_(oo8"n&.name%
ENDIF%
ENDSELECT%
AT LINE6SELECTION.
CALL SCREEN ?)).
$%3 &reate a s-reen usin7 *or+ar' navi7ation
@'ouble%-li-( $00 in t.e CA88 SCR!!- ,00 statementA.
$%4 Maintain s-reen attributes
% 4nter a 'es-ri,tive s.ort te:t
% Set t.e ne:t s-reen to 0
$%5 6ayout
% 2avi7ate to t.e !ra,.i-al 6ayout 4'itor
% &.oose t.e Dict-$rogram #ields i-on
% 4nter S>?-D0662
% &.oose t.e .et #rom Dictionary i-on
% Sele-t t.e *iel's you +ant
-.oose Enter to -on*irm0 an' 'ra7 t.ese *iel's to t.e s-reen

% $st 8lo-()
Copy 'ey #iel"s) CARRID: CONNID: FLDATE: an' 'OOCID
+it. *iel' names
% 2n' 8lo-()
Copy customer name -A%!
+it.out a *iel' name @-.oose t.e %it!out te&t ra'io buttonA
% 3r' 8lo-()
&o,y t.e #iel"s) CUSTOMID: CUSTTYPE: SMOCER: CLASS:
LOCCURAM0 an' LOCCURCEY
+it. *iel' names
$%6 &.an7e t.e *iel' attributes %
*or e:am,le0 by 'ouble%-li-(in7 t.e in,ut *iel'
% &.an7e t.e attributes)
% ".e *iel's CARR5>A C6--5>A F8>AT!0 06625>0 an' C/ST6%5>
s.oul' be 'is,laye' as out,ut *iel's @Output field attributeA.
% ".e -ustomer name -A%! s.oul' be 'is,laye' ne:t to t.e -ustomer number
+it.out te:t
@Output only attributeA.
% ".e *iel's C/STT?!0 S%62!R0 C8ASS0 86CC/RA%0 an'
86CC/R2!? s.oul' be bot. in,ut%rea'y an' out,ut%rea'y @t.e +nput9Output field
attributeA.
.
SA A! "A#$0 $6%39
SA A! "A#$0 $6%40
Solutions
/nit$ Screens
Topic$ >ata Transport
%o"el Solution$ ro.ram SAP'C())UDS5DYNPRO5'
:C..............................................................:
:C Repo# SAPBC400*DS_DYNPRO_B :
:C :
:C :
:C..............................................................:
REPORT +ap(-400,d+_d$npo_(%
CONSTANTS< a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A7
a-#3#_-;an&e TYPE a-#"3_a,#; )AL*E A05A%
* De1*#*$*# 1 &ele+$*# &+,ee#
PARAMETERS pa_an,m TYPE +(oo8.a&en-$n,m%
* 4,N%,e% 1, l*&$
DATA 9a_(oo8"n& TYPE +(-400_(oo8"n&%
* 4,N%,e% 1, &*#/le 2N*#/ $ 2e +-%#/e8
DATA 4%5&2N TYPE &2N.
* 4,N%,e% 1, 8.#!,
TA'LES &8.#52N.
START.OF.SELECTION%
* &ele+$*#/ 8%$% 0&*#/ %# A8*+$*#%,. v*e4 $ /e$ $-e 8%$% 1,"
* &2N %#8 $-e +0&$"e, #%"e 1," &+0&$"
SELECT -a"d -onn"d !'da#e (oo8"d -,+#om"d name
FROM +(-400_(oo8"n&
INTO CORRESPONDING FIELDS OF 9a_(oo8"n&
W/ERE a&en-$n,m = pa_an,m%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD 9a_(oo8"n&.-a"d
ID AACT)TA FIELD a-#3#_d"+p'a$%
IF +$.+,(- = 0%
* O0$!0$
WRITE< > 9a_(oo8"n&.-a"d COLOR -o'_8e$7
9a_(oo8"n&.-onn"d COLOR -o'_8e$7
SA A! "A#$0 $6%4$
9a_(oo8"n&.!'da#e COLOR -o'_8e$7
9a_(oo8"n&.(oo8"d COLOR -o'_8e$7
9a_(oo8"n&.name%
HIDE: 4%52N*#/6+%,,*8:
4%52N*#/6+##*8:
4%52N*#/61l8%$e:
4%52N*#/62N*8:
4%52N*#/6#%"e.
ENDIF%
ENDSELECT%
AT LINE.SELECTION%
AUTHORITY6CHECC O'QECT <S5CARRID<
ID <CARRID< FIELD 4%52N*#/6+%,,*8
ID <ACT>T< FIELD %+$v$5+-%#/e.
IF &.6&02,+ ; ).
SELECT SINGLE *
FROM &2N
INTO 4%5&2N
7HERE +%,,*8 ; 4%52N*#/6+%,,*8
AND +##*8 ; 4%52N*#/6+##*8
AND 1l8%$e ; 4%52N*#/61l8%$e
AND 2N*8 ; 4%52N*#/62N*8.
IF &.6&02,+ ; ).
MO>E6CORRESPONDING 4%5&2N TO &8.#52N.
MO>E 4%52N*#/6#%"e TO &8.#52N6#%"e.
CALL SCREEN 400%
ENDIF.
ELSE .
MESSAGE ID <'C())< TYPE <S< NUM'ER <)(F<
7ITH 4%52N*#/6+%,,*8.
ENDIF.
SA A! "A#$0 $6%42
/nit$ Screens
Topic$ Fiel" Transports an" Su&se=uent Screen rocessin.
%o"el Solution$ ro.ram SAP'C())UDS5DYNPRO5C
:C..............................................................:
:C Repo# SAPBC400*DS_DYNPRO_C :
:C :
:C :
:C..............................................................:
REPORT +ap(-400,d+_d$npo_-%
CONSTANTS< a-#3#_d"+p'a$ TYPE a-#"3_a,#; )AL*E A06A7
a-#3#_-;an&e TYPE a-#"3_a,#; )AL*E A05A%
* De1*#*$*# 1 &ele+$*# &+,ee#
PARAMETERS pa_an,m TYPE +(oo8.a&en-$n,m%
* 4,N%,e% 1, l*&$
DATA 9a_(oo8"n& TYPE +(-400_(oo8"n&%
* 4,N%,e% 1, &*#/le 2N*#/ $ 2e +-%#/e8
DATA 9a_+(oo8 TYPE +(oo8%
* 4,N%,e% 1, 8.#!,
TABLES +d$n_(oo8%
* v%,*%2le 1, 10#+$*# +8e 1 0&e, %+$*#
DATA N5+8e LICE &.60+"".
START.OF.SELECTION%
* &ele+$*#/ 8%$% 0&*#/ % 8*+$*#%,. v*e4 $ /e$ $-e 8%$% 1,"
* &2N %#8 $-e +0&$"e, #%"e 1," &+0&$"
SELECT -a"d -onn"d !'da#e (oo8"d -,+#om"d name
FROM +(-400_(oo8"n&
INTO CORRESPONDING FIELDS OF 9a_(oo8"n&
W/ERE a&en-$n,m = pa_an,m%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD 9a_(oo8"n&.-a"d
ID AACT)TA FIELD a-#3#_d"+p'a$%
IF +$.+,(- = 0%
SA A! "A#$0 $6%43
* O0$!0$
WRITE< > 9a_(oo8"n&.-a"d COLOR -o'_8e$7
9a_(oo8"n&.-onn"d COLOR -o'_8e$7
9a_(oo8"n&.!'da#e COLOR -o'_8e$7
9a_(oo8"n&.(oo8"d COLOR -o'_8e$7
9a_(oo8"n&.name%
/IDE< 9a_(oo8"n&.-a"d7
9a_(oo8"n&.-onn"d7
9a_(oo8"n&.!'da#e7
9a_(oo8"n&.(oo8"d7
9a_(oo8"n&.name%
ENDIF%
ENDSELECT%
CLEAR 9a_(oo8"n&%
AT LINE.SELECTION%
A*T/ORITY.C/ECK OBDECT AS_CARRIDA
ID ACARRIDA FIELD 9a_(oo8"n&.-a"d
ID AACT)TA FIELD a-#3#_-;an&e%
IF +$.+,(- = 0%
SELECT SINGLE :
FROM +(oo8
INTO 9a_+(oo8
W/ERE -a"d = 9a_(oo8"n&.-a"d
AND -onn"d = 9a_(oo8"n&.-onn"d
AND !'da#e = 9a_(oo8"n&.!'da#e
AND (oo8"d = 9a_(oo8"n&.(oo8"d%
IF +$.+,(- = 0%
MO)E.CORRESPONDING 9a_+(oo8 TO +d$n_(oo8%
MO)E 9a_(oo8"n&.name TO +d$n_(oo8.name%
CALL SCREEN 400%
ENDIF%
ELSE %
MESSAGE ID ABC400A TYPE ASA N*MBER A04IA
WIT/ 9a_(oo8"n&.-a"d%
ENDIF%
CLEAR< 9a_+(oo87 9a_(oo8"n&%
:C..............................................................:
:C Mod,'e CLEAR_OK_CODE O*TP*T :
:C..............................................................:
:C #e0# :
SA A! "A#$0 $6%44
:C..............................................................:
MODULE +le%,5N5+8e OUTPUT.
CLEAR N5+8e.
ENDMODULE. 9 CLEAR5OC5CODE OUTPUT
:C..............................................................:
:C Mod,'e *SER_COMMAND_0400 INP*T :
:C..............................................................:
:C #e0# :
:C..............................................................:
MODULE 0&e,5+""%#85)?)) INPUT.
CASE N5+8e.
7HEN <'ACC<.
LEA>E TO SCREEN ).
7HEN <SA>E<.
MO>E6CORRESPONDING &8.#52N TO 4%5&2N.
MESSAGE ID <'C())< TYPE <I< NUM'ER <)W)<.
LEA>E TO SCREEN ).
ENDCASE.
ENDMODULE. 9 USER5COMMAND5)?)) INPUT
SA A! "A#$0 $6%45
7
SAP AG 2003
Function %rous and Function 6odules
Workin" *ith 6ethods
Workin" *ith BAPIs
Contents3
%lobal 6odulariEation
SA A! "A#$0 $B%$
7.2
SAP AG 2003
Create )unction "rous and )unction modules
Add )unction module calls to !our ro"ram
Add ob1ect instantiations and method calls to
!our ro"ram
Add the A7H "rid control to disla! data in a )i+ed
screen area
Create in)ormation usin" BAPIs
Add BAPI calls to !our ro"ram&
At the conclusion o) this unit2 !ou *ill be able to3
%lobal 6odulariEation3 5nit 0b1ecti'es
SA A! "A#$0 $B%2
7.3
SAP AG 2003
Workin" *ith Function 6odules
Function %rous and Function 6odules
Function %rous and Function 6odules
Workin" *ith 6ethods
Workin" *ith 6ethods
Workin" *ith BAPIs
Workin" *ith BAPIs
SA A! "A#$0 $B%3
7.4
SAP AG 2003
Function 6odule
%nterface %nterface
%mport %mport parameters parameters
s!4subrc
Attri$utes
*ocal data o$jects
Source code
%mport %mport parameters parameters E"port E"port parameters parameters C'an0in0 parameters C'an0in0 parameters E"ceptions E"ceptions
/unction Module
Function mo"ules are a-tively inte7rate' mo'ulari<ation units +it. an inter*a-e.
=un-tion mo'ules -an0 t.ere*ore0 be -alle' s,e-i*i-ally *rom +it.in ,ro7rams or *un-tion mo'ules.
".e inter*a-e o* a *un-tion mo'ule -an -ontain t.e *ollo+in7 elements)
5mport parameters are ,asse' to t.e *un-tion mo'ule. 1n 7eneral0 t.ese ,arameters are assi7ne'
stan'ar' A8A Di-tionary ty,es. 1m,ort ,arameters -an also be o,tional.
!(port parameters are re-eive' *rom t.e *un-tion mo'ules. 4:,ort ,arameters are al+ays
o,tional.
Chan.in. parameters are ,asse' to t.e *un-tion mo'ule an' -an be -.an7e' by it.
!(ceptions ,rovi'e in*ormation about error situations. 1* a *un-tion mo'ule initiates an e:-e,tion0
,ro-essin7 o* t.e *un-tion mo'ule is interru,te'. 1t is ,ossible to set a return -o'e0 i* ne-essary0 in
t.e -allin7 ,ro7ram.
As is t.e -ase +it. subroutines0 a *un-tion mo'ule -an -ontain lo-al ty,e an' 'ata obHe-t 'e*initions.
SA A! "A#$0 $B%4
7.5
SAP AG 2003
Function %rou
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
3
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
2
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
3
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
>
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/unction Module
/M@
%nterface %nterface
$ub4
routine
Inter)ace Inter)ace
$creen
%lobal
data ob1ects
A #unction .roup re,resents t.e main ,ro7ram *or *un-tion mo'ules. Several *un-tion mo'ules t.at
o,erate on t.e same 'ata -ontent are -ombine' to *orm a *un-tion 7rou,.
".e *un-tion 7rou, remains a-tive *or as lon7 as t.e -allin7 ,ro7ram is a-tive. =or e:am,le0 i* an
e:e-utable ,ro7ram -alls a *un-tion mo'ule0 its entire *un-tion 7rou, is loa'e' as +ell. 1t remains
a-tive until t.e e:e-utable ,ro7ram is -om,lete'.
A *un-tion 7rou, -an -ontain t.e same -om,onents as an e:e-utable ,ro7ram. ".ese in-lu'e)
>ata 6&<ects
".ese are t.en 7lobal in relation to t.e *un-tion 7rou,0 t.at is0 t.ey are visible to an' -.an7eable
by all *un-tion mo'ules +it.in t.e 7rou,. ".e vali'ity ,erio' is t.e same as *or t.e *un-tion 7rou,.
Su&routines
".ese -an be -alle' *rom all *un-tion mo'ules in t.e 7rou,.
Screens
".ese -an be -alle' *rom all *un-tion mo'ules in t.e 7rou,.
SA A! "A#$0 $B%5
7.6
SAP AG 2003
,ata Flo* Within a Function %rou
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
3
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
2
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
3
/
u
n
c
t
i
o
n
M
o
d
u
l
e
/
M
>
%
n
t
e
r
f
a
c
e
%
n
t
e
r
f
a
c
e
/unction Module
/M@
%nterface %nterface
".e 7lobal 'ata o* a *un-tion mo'ule is retaine' until t.e ,ro7ram t.at -ontaine' t.e *irst -all o* a
*un-tion mo'ule in t.e *un-tion 7rou, is *inis.e'.
".us0 i* a *un-tion mo'ule t.at +rites values to t.e 7lobal 'ata is -alle'0 ot.er *un-tion mo'ules in
t.e same *un-tion 7rou, -an a--ess t.is 'ata +.en t.e ,ro7ram -alls t.em.
Seen *rom t.e outsi'e0 t.e 7lobal 'ata is en-a,sulate'0 t.at is0 it is not ,ossible to a--ess it 'ire-tly.
".ere*ore0 you must .ave *un-tion mo'ules t.at allo+ or'erly a--ess *rom t.e outsi'e.
".e same a,,lies to all t.e ot.er -om,onents o* t.e *un-tion 7rou, @s-reens0 subroutinesA.
SA A! "A#$0 $B%6
7.7
SAP AG 2002
Attributes
Function module /dit %oto 5tilities /n'ironment $!stem 9el
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Function 2odule BC402_FM_!"#_F$""_S"%#S active
Source code 1xceptions Tables Changing 1xport I2port Attributes
0rocessing type
"or2al $unction 2odule
%e2ote8enabled 2odule
*pdate 2odule
Function group BC402_FM_FLI!&# Function 'odules de'onstration
Short text Calculates nu'(er of free seats
Develop2ent class BC402
5eneral data
Classi$ication
Function 2odule docu2entation
1n t.e Attributes o* a *un-tion mo'ule0 you s,e-i*y its 7eneral a'ministrative 'ata an' t.e processin.
type)
Remote)ena&le" #unction mo"ules -an be -alle' asyn-.ronously in t.e same system an' -an
be -alle' *rom ot.er systems @not Hust R/3 SystemsA. "o -all a *un-tion mo'ule in anot.er system0 t.ere
must be a vali' system -onne-tion. =or *urt.er in*ormation0 re*er to t.e -ourse ,(=:> -
(ommunications +nterfaces in A,AP or t.e online 'o-umentation.
/p"ate #unction mo"ules -ontain a''itional *un-tions *or bun'lin7 'atabase -.an7es.
=or *urt.er in*ormation0 re*er to t.e -ourse ,(=:= - Programming 'ataase &pdates or t.e online
'o-umentation.
".e online 'o-umentation also 'etails t.e inter*a-e restri-tions t.at a,,ly to remote%enable'
an' u,'ate *un-tion mo'ules.
SA A! "A#$0 $B%B
7.8
SAP AG 2002
Inter)ace
Function 2odule docu2entation
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Fun.tionsbaustein BC402_FM_!"#_F$""_S"%#S a.tiv
Source code 1xceptions Tables Changing I2port Attributes 1xport
0ara2eter na2e Type %e$erence type 0ass value Short text
10#S1ATSF%11 T,01 S#S1ATS!A4 Seats $ree
Function module /dit %oto 5tilities /n'ironment $!stem 9el
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Function 2odule BC402_FM_!"#_F$""_S"%#S active
Source code 1xceptions Tables Changing 1xport
Function 2odule docu2entation
I2port Attributes
0ara2eter na2e Type %e$erence type De$ault value )ptional 0ass value Short text
I0#0LA"1T,01 T,01 S#0LA"1T,1 0lane type
I0#S1ATS)CC T,01 S#S1ATS!A4 &
)ccupied seats

".ree (in's o* ,arameters -an be use' to e:-.an7e 'ata +it. *un-tion mo'ules)
5mportin. ,arameters0 +.i-. are recei+e" by t.e *un-tion mo'ule
!(portin. ,arameters0 +.i-. are returne" by t.e *un-tion mo'ule
Chan.in. ,arameters0 +.i-. are bot. re-eive' an' returne'
8y 'e*ault0 all ,arameters are ,asse' by re#erence. Fou -an -.an7e e:,ortin7 an' -.an7in7
,arameters only in t.e *un-tion mo'ule. ".is rule ensures t.at you avoi' un+ante' si'e e**e-ts. 1*
you +ant to ,ass ,arameters by +alue0 you must sele-t t.e relevant o,tion +.en you 'e*ine t.e
inter*a-e.
Fou -an also 'e-lare importin. an" chan.in. ,arameters as o,tional. Fou 'o not .ave to ,ass
values to t.ese ,arameters +.en you -all t.e *un-tion mo'ule. #.ere ,ossible0 use t.is o,tion +.en
you a"" ne+ ,arameters to *un-tion mo'ules t.at are alrea'y in use. Fou -an assi7n a "e#ault +alue
to an o,tional ,arameter. 1* you 'o not ,ass a value o* your o+n +.en you -all t.e *un-tion mo'ule0
t.e system t.en uses t.e 'e*ault value instea'. !(portin. ,arameters are al+ays o,tional.
Fou may s,e-i*y t.e ty,e o* an elementary ,arameter. Fou must s,e-i*y t.e ty,e o* a stru-ture' or
table ,arameter. Fou -an use eit.er A8A Di-tionary ty,es0 A8A Di-tionary obHe-ts0 ,re'e*ine'
A8A ty,e @"7!7p7n7-7+#"n&7070+#"n&7d7#A or user%'e*ine' ty,es. Any ty,e -on*li-ts
s.o+ u, in t.e e(ten"e" pro.ram chec'. Fou -an also assi7n a re*eren-e ty,e.
"able ,arameters are obsolete *or normal #unction mo"ules but .ave been retaine' to ensure
-om,atibility *or *un-tion mo'ules +it. ot.er e:e-ution mo'es.
SA A! "A#$0 $B%C
7.C
SAP AG 2002
Processin" 7o"ic
Function module /dit %oto 5tilities /n'ironment $!stem 9el
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Function 2odule BC402_FM_!"#_F$""_S"%#S active
1xceptions Tables Changing 1xport I2port
Function 2odule docu2entation
Attributes Source code
FUNCTION 2+()251"885/e$51,ee5&e%$&.
*9666666666666666666666666666666666
*9*9L+%l I#$e,1%+e:
*9 IMPORTING
*9 EXPORTING
*9 EXCEPTIONS
*9666666666666666666666666666666666
...
ENDFUNCTION.
#.en you save t.e inter*a-e0 t.e system 7enerates t.e statement *rame+or( to7et.er +it. t.e
-omment blo-( t.at lists t.e inter*a-e ,arameters)

FUNCTION name%
*966666666666666
*9 ...
*966666666666666
...
ENDFUNCTION.
".e -omment blo-( is u,'ate' automati-ally i* you ma(e -.an7es to t.e *un-tion mo'ule later
on. ".is means t.at you -an al+ays see t.e inter*a-e 'e*inition +.en you are -o'in7 t.e
*un-tion mo'ule. Fou ,ro7ram t.e statements e:a-tly as you +oul' in any ot.er A8A
,ro7ram in t.e A,AP Editor"
1n t.e *un-tion mo'ule0 you -an -reate your o+n lo-al ty,es an' 'ata obHe-ts an' -all
subroutines or ot.er *un-tion mo'ules.
SA A! "A#$0 $B%9
7.,0
SAP AG 2002
/+cetions
Function module /dit %oto 5tilities /n'ironment $!stem 9el
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Function 2odule BC402_FM_!"#_F$""_S"%#S active
Tables Changing 1xport
Function 2odule docu2entation
I2port Attributes
1xception Short text
Cargo plane
Source code 1xceptions
")#S1ATS
)verboo.ed )91%L)AD
RAISE 1e0-ep#"on2.
*** 4*$- 8e1%0l$ "e&&%/e:
MESSAGE 18"nd21n,m2D1"d2E
RAISING 1e0-ep#"on2.
"o data D:#FAIL*%1
Fou -an ma(e a *un-tion mo'ule raise e(ceptions.
"o 'o t.is0 you must *irst "eclare t.e e:-e,tions in t.e inter*a-e 'e*inition0 t.at is0 assi7n ea-. one a
uniEue name. 1n t.e sour-e -o'e o* your *un-tion mo'ule0 you ,ro7ram t.e statements t.at
raise an e:-e,tion un'er t.e reEuire' -on'ition. At runtime0 t.e *un-tion mo'ule is terminate'
+.en an e:-e,tion is tri77ere'. ".e -.an7es to e:,ortin7 an' -.an7in7 ,arameters are t.e
same as in subroutines. Fou -an use t+o statements to raise an e:-e,tion. 1n t.e *orms 7iven
belo+0 e0-ep#"on stan's *or t.e name o* an e:-e,tion t.at you 'e-lare' in t.e inter*a-e. ".e
system rea-ts 'i**erently a--or'in7 to +.et.er or not t.e e:-e,tion +as liste' in t.e *un-tion
mo'ule -all)
RAISE e0-ep#"on.
1* t.e e:-e,tion is liste' in t.e -allin7 ,ro7ram0 t.e system returns -ontrol to it 'ire-tly.
1* t.e e:-e,tion is not liste'0 a runtime error o--urs.
MESSAGE 18"nd21n,m2D1"d2E RAISING 1e0-ep#"on2.
-6T!$ 1* t.e e:-e,tion is liste' in t.e -allin7 ,ro7ram0 t.e statement .as t.e same e**e-t as
RA1S4 Xe:-e,tionJ. 1* it is not liste'0 t.e system sen's messa.e InumJ #rom messa.e
class Ii"J *ith type I'in"JA an' no runtime error o--urs.
SA A! "A#$0 $B%$0
7.,,
SAP AG 2002
,ocumentin"2 Acti'atin"2 and Testin"
Function module documentation
$hort te+t and lon" te+t
Parameters
/+cetions
Functions2 notes2 and so on
Worklist
8e'ised 'ersion
Inacti'e 'ersion
Acti'e 'ersion
Function testin"2 debu""in"
$ul!in" 'alues )or arameters
/+cetions
6essa"es
=un-tion mo'ules 'i**er *rom subroutines in t.at you must assume t.at ot.er ,ro7rammers +ill
use t.em. =or t.is reason0 you s.oul' ensure t.at you -om,lete t.e ste,s liste' .ere)
>ocumentation Fcan &e translate"G
Fou s.oul' 'o-ument all your ,arameters an' e:-e,tions0 alon7 +it. your entire *un-tion
mo'ule0 +it. s.ort te:t @an' lon7 te:t i* ne-essaryA. ".e system ,rovi'es a te:t e'itor *or you
to 'o t.is0 -ontainin7 ,re'e*ine' se-tions *or FunctionsA !(ample CallA 3intsA an'
Further 5n#ormation.
;or' list
#.en you -.an7e an a-tive *un-tion mo'ule0 it a-Euires t.e status a-tive @revise'A.
#.en you save it0 anot.er version is -reate' +it. t.e status inacti+e. #.en you are
+or(in7 on a *un-tion mo'ule0 you -an s+it-. bet+een t.e ina-tive version an' t.e last
version t.at you a-tivate'. #.en you a-tivate t.e ina-tive version0 t.e ,revious a-tive
version is over+ritten.
Function test
-ote$ 3n-e you .ave a-tivate' your *un-tion mo'ule0 you -an test it usin7 t.e built%in
test environment in t.e =un-tion 8uil'er. 1* an e:-e,tion is tri77ere'0 t.e test
environment 'is,lays it0 alon7 +it. any messa7e t.at you may .ave s,e-i*ie' *or it. Fou
-an also s+it-. into t.e Debugger an' t.e Runtime Analysis. Fou -an save test 'ata an'
-om,are sets o* results.
SA A! "A#$0 $B%$$
7.,2
SAP AG 2002
Call
DATA: ,e&0l$ TYPE &5&e%$&"%B.
PARAMETERS: !%5$.!e TYPE &5!l%#e$.e: !%5++ TYPE &5&e%$&"%B.
CALL FUNCTION <'C()25FMDD5GET5FREE5SEATS<
EXPORTING
*!5!l%#e$.!e ; !%5$.!e
*!5&e%$&++ ; !%5++ 9 8e1%0l$: )
IMPORTING
e!5&e%$&1,ee ; ,e&0l$
EXCEPTIONS
#5&e%$& ; ?
ve,l%8 ; 2
OTHERS ; 3.
CASE &.6&02,+.
7HEN ).
7RITE: / ,e&0l$ COLOR V.
7HEN ?.
7RITE: / <Y0<<ll -%ve $ &$%#8: *$<<& % 1,e*/-$e,=<D1,$E.
7HEN 2.
7RITE: / <T-e !l%#e -%& %l,e%8. 2ee# ve,l%8e8=<D#&E.
7HEN 3.
7RITE: / <Ple%&e +#$%+$ .0, &.&$e" %8"*#*&$,%$,=<D%8"E.
ENDCASE.
Insert attern
CALL F*"CTI)"





BC402_FM_!"#_F$""_S"%#S
CALL FUNCTION CALL FUNCTION < < < <
EXPORTING EXPORTING
IMPORTING IMPORTING
EXCEPTIONS EXCEPTIONS
; ;
; ;
; ;
; ? ; ?
; 2 ; 2
OTHERS OTHERS ; 3. ; 3.
CASE CASE &. &.6 6&02,+. &02,+.
7HEN 7HEN ). ).
7HEN 7HEN ?. ?.
7HEN 7HEN 2. 2.
7HEN 7HEN 3. 3.
ENDCASE. ENDCASE.
#.en you insert a *un-tion mo'ule -all in your ,ro7ram0 you s.oul' use t.e $attern *un-tion.
".en0 you only nee' to enter t.e name o* t.e *un-tion mo'ule @in,ut .el, is availableA. ".e
system t.en inserts t.e -all an' t.e e:-e,tion .an'lin7 @MESSAGE statementA into your
,ro7ram.
Fou assi7n ,arameters by name. ".e #ormal ,arameters are al+ays on t.e le#t si"e o* t.e
e:,ressions)
!(portin. ,arameters are passe" by t.e ,ro7ram. 1* a ,arameter is o,tional0 you 'o not
nee' to ,ass it. De*ault values are 'is,laye' i* t.ey e:ist.
5mportin. ,arameters are recei+e" by t.e *un-tion mo'ule. 5mportin. ,arameters are al+ays
o,tional.
Chan.in. ,arameters are bot. passe" an' recei+e". Fou 'o not .ave to list o,tional
,arameters. De*ault values are 'is,laye' i* t.ey e:ist.
".e system assi7ns a value to ea-. e:-e,tion0 be7innin7 at one an' -ontinuin7 to number t.em
seEuentially in t.e or'er t.ey are 'e-lare' in t.e *un-tion mo'ule 'e*inition. Fou -an assi7n a
value to all ot.er e:-e,tions t.at you .ave not s,e-i*i-ally liste' usin7 t.e s,e-ial e:-e,tion
6T3!RS.
1* you list t.e e:-e,tions an' one is tri77ere' in t.e *un-tion mo'ule0 t.e -orres,on'in7 value
is ,la-e' in t.e return -o'e *iel' &.6&02,+. 1* you 'i' not list t.e e:-e,tion in t.e *un-tion
-all0 a runtime error or a messa7e o--urs0 'e,en'in7 on t.e statement you use' in the #unction
mo"ule to tri77er t.e e:-e,tion.
SA A! "A#$0 $B%$2
7.,3
SAP AG 2002
0r"aniEation o) a Function %rou
0b1ect list /dit %oto 5tilities /n'ironment $!stem 9el
$b6ect (a&igator
)b;ect list
Display
BC402_FM_)%I#LIS# Function group
Class
Local ob;ects
Develop2ent class
progra2
Workbench /dit %oto /+tras /n'ironment $!stem 9el
$b6ect (a&igator
)b;ect na2e
:C+&/#F!DD#<AITLIST
Function 2odules
Fields
0:) 2odules
Screens
5*I titles
Includes
L:C+&/#F!DD#<AITLISTT)0
L:C+&/#F!DD#<AITLIST)&-
L:C+&/#F!DD#<AITLIST*&-

L:C+&/#F!DD#<AITLIST*&/
L:C+&/#F!DD#<AITLIST*&'
L:C+&/#F!DD#<AITLIST*&+
L:C+&/#F!DD#<AITLIST*&6
L:C+&/#F!DD#<AITLIST*&=
L:C+&/#F!DD#<AITLIST*44
Add >aiting custo2er
%e2ove >aiting custo2er
Display >aiting list
Shi$t >aiting list
%eturn position in >aiting list
Change position in list
Function modules Function modules Function modules Function modules Function modules
PB0 modules
%lobal declarations
Include modules in ro"ram
As 'es-ribe' in t.e A0A Runtime !n+ironment unit0 t.e A8A #or(ben-. .el,s you to
stru-ture your sour-e -o'e +.en you +or( +it. *un-tion 7rou,s an' *un-tion mo'ules.
=or+ar' navi7ation ensures t.at you al+ays enter t.e -orre-t obHe-t. 1n-lu'e ,ro7rams are
name' automati-ally0 an' t.e relevant -all statements are inserte' automati-ally in t.e -orre-t
,ositions.
Fou only .ave to observe t.e namin7 -onvention *or *un-tion 7rou,s) YH@1em_name2.
".e system t.en -reates a ty,e = ,ro7ram -alle' SAPLYH@1em_name20 +.i-. -ontains
automati-ally 7enerate' 5-C8/>! statements. ".e in-lu'e ,ro7rams are also name'
automati-ally) LYH@1em_name21a((e321n,m2.
".e system also inserts t.e in-lu'e ,ro7ram0 8?KL1em_name2UXXA +.i-. -ontains an
in-lu'e statement in t.e *orm 8?KL1em_name2U1n,mJ *or ea-. *un-tion mo'ule.
SA A! "A#$0 $B%$3
7.,4
SAP AG 2003
Workin" *ith 6ethods
Function %rous and Function 6odules
Function %rous and Function 6odules
Workin" *ith 6ethods
Workin" *ith 6ethods
Workin" *ith BAPIs
Workin" *ith BAPIs
SA A! "A#$0 $B%$4
7.,5
SAP AG 2003
Classes and 0b1ects
- attr1
- attr2
- &&&
- meth1
- meth2
- &&&
(ame
Attributes (data ob1ects)3
6ethods ()unctions)3
Class3
technical
descrition
o) ob1ects
attr1
attr2
meth1
@V11
&&&
meth2
attr1
attr2
meth1
12#
&&&
meth2
attr1
attr2
meth1
P
&&&
meth2
0b1ects3
8untime instances
in a class
At *irst 7lan-e0 a -lass is very mu-. li(e a *un-tion 7rou, sin-e it -ontains 'ata obHe-ts @attributesA
an' *un-tions @met.o'sA. ".ese -om,onents -an be ,rote-te' *rom a--ess by -om,onents o* ot.er
,ro7rams. ".en t.ey -an be a--esse' only by met.o's belon7in7 to t.e -lass.
1n -ontrast to *un-tion 7rou,s0 -lasses -an .ave multi,le instan-es0 t.at is0 more t.an one runtime
obHe-t -an be -reate' *or ea-. ,ro7ram in a -lass. 1n ot.er +or's0 a -lass -ontains t.e te-.ni-al
'es-ri,tion o* obHe-ts @instan-esA. All t.ese obHe-ts0 t.ere*ore0 .ave t.e same attributes an' ,rovi'e
t.e same met.o's. >o+ever0 t.ey -an be 'istin7uis.e' ,.ysi-ally. ".eir attributes -an .ave 'i**erent
*eatures.
&lasses -an be 'e*ine' eit.er lo-ally +it.in an e:e-utable ,ro7ram or 7lobally in t.e &lass 8uil'er.
".e A8A runtime system ,rovi'es su,,ort *or stan'ar' obHe-t%oriente' synta: elements as o*
Release 4.6A. =or more 'etails0 re*er to t.e SA online library.
SA A! "A#$0 $B%$5
7.,6
SAP AG 2003
ABAP ro"ram
Creatin" 0b1ects and Callin" 6ethods
DATA ,e1? TYPE REF TO +l%&&.
DATA ,e12 TYPE REF TO +l%&&.
CREATE O'QECT ,e1? ...
CREATE O'QECT ,e12 ...
CALL METHOD ,e1?6M"e$-?
EXPORTING ...
IMPORTING ...
EXCEPTIONS ...
CALL METHOD ,e126M"e$-?
EXPORTING ...
IMPORTING ...
EXCEPTIONS ...
...
re)1 re)2
meth1
meth1
"o -reate instan-es o* -lasses an' to be able to a--ess t.em0 you nee' re*eren-e variables0 +.i-. are
,ointers to t.ese instan-es. Fou 'e*ine t.ese re*eren-e variables usin7 DATA e!een-e_name
TYPE REF TO -'a++_name.
At ,ro7ram start0 t.e 'ata obHe-ts are -reate' in memory. >o+ever0 sin-e no instan-es .ave been
-reate' yet0 t.e re*eren-e variables are still em,ty.
At runtime0 you -an -reate as many instan-es o* -lasses as you +is. usin7
CR!AT! 60M!CT e!een-e_name%
1* ne-essary0 t.e im,ort ,arameters o* t.e s,e-ial met.o' &32S"R9&"3R must be *ille' +it.
values. ".is s,e-ial met.o' is e:e-ute' imme'iately a*ter t.e instan-e is -reate'. As a rule0 basi-
settin7s *or t.e a-tual instan-e are t.us -reate'.
Fou -an -all met.o's o* an instan-e usin7
CA88 %!T36> e!een-e_name6Mme#;od_name.
1n -ontrast to a *un-tion mo'ule -all0 t.e met.o' name is not su**i-ient .ere be-ause0 7enerally0
several instan-es o* a -lass e:ist *or ea-. ,ro7ram. 9sin7 t.e re*eren-e variable0 *ollo+e' by t.e
obHe-t -om,onent sele-tor )J0 you instru-t a particular instan-e to e:e-ute its met.o'.
SA A! "A#$0 $B%$6
7.,7
SAP AG 2003
/+amles o) $tandard Classes3 /n1o!$AP Controls
AA
001V
00?@
79
0@00
0@02
Airlines htt3//***&sa&com
Picture Control
Tree Control 9T67 Hie*er Control
As o* Release 4.6A0 t.e A8A #or(ben-. o**ers several ne+ 4nHoySA -ontrols in or'er to move
'ialo7 *un-tions *rom t.e a,,li-ation server to t.e ,resentation server. ".ese -ontrols are -alle' on
an obHe-t%oriente' basis usin7 -lasses0 t.at is0 t.e SA Control Frame*or'.
=or ea-. met.o' -all0 you sele-t t.e -ontrols *rom your A8A ,ro7ram. ".e &ontrol =rame+or(
sen's your reEuests to t.e ,resentation server +.ere t.ey are -onverte' on a ,lat*orm%s,e-i*i- basis.
Fou -an 7ive t.e user t.e o,tion o* tri77erin7 events on t.e ,resentation server. ".e &ontrol
=rame+or( t.en -onverts t.ese events an' you -an rea-t to t.em in your A8A ,ro7ram.
=or more 'etails on t.e 4nHoySA -ontrols an' t.e &ontrol =rame+or(0 re*er to t.e SA online
library.
SA A! "A#$0 $B%$B
7.,8
SAP AG 2003
Workin" *ith BAPIs
Function %rous and Function 6odules
Function %rous and Function 6odules
Workin" *ith 6ethods
Workin" *ith 6ethods
Workin" *ith BAPIs
Workin" *ith BAPIs
SA A! "A#$0 $B%$C
7.,C
SAP AG 2003
Business Alication Pro"rammin" Inter)ace
BAPI
A BAPI is a *ell4de)ined inter)ace to rocesses and
data o) a business alication s!stem2 imlemented
as a business ob1ect method in the
Business 0b1ect 8eositor! (B08)&
A 8A1 -an be vie+e' as t.e 'oor to t.e SA systemI t.is inter*a-e ,rovi'es a--ess to business 'ata
an' ,ro-esses in t.e SA system *rom t.e outsi'e.
4a-. obHe-t in t.e 83R -an .ave several met.o's0 one or more o* +.i-. -an be im,lemente' as
8A1s.
8A1s usually e:ist *or basi- *un-tions o* a business obHe-t0 su-. as)
&reatin7 obHe-ts
Queryin7 t.e attributes o* an obHe-t
&.an7in7 t.e attributes o* an obHe-t
SA A! "A#$0 $B%$9
7.20
SAP AG 2003
Business
Work)lo*
,istributed scenarios (A7/)
Internet /
Intranet
CustomerRs and artner:s
o*n code
JAHA2 C2 &&&
8/# Comonent
Creation
B
Business
Comonent
Business
Comonent
Business
Comonent
BAPI 5sa"e
A 8A1 -an be use' *or various a,,li-ations. =or e:am,le)
1nternet a,,li-ation -om,onents) De,i-tion o* in'ivi'ual SA R/3 *un-tions in t.e 1nternet or
intranet % *or e:am,le0 *or users +.o 'o not .ave SA R/3 e:,erien-e.
R/3 -om,onent -reation) &ommuni-ation bet+een t.e business obHe-ts o* 'i**erent SA R/3
-om,onents @solutionsA.
&ustomersU or ,artnersU -o'e) 4:ternal -lients @*or e:am,le0 alternative !91sA 'ire-tly a--ess
business 'ata an' ,ro-esses o* t.e SA R/3 System. 1n ,arti-ular0 8A1 -alls @as -alls o* R&%
enable' *un-tion mo'ules alsoA -an be im,lemente' in ot.er ,ro7rammin7 lan7ua7es.
SA A! "A#$0 $B%20
7.2,
SAP AG 2003
$tandardiEed BAPIs
%et7ist
$ulies a list o) ob1ect ke! )ields that satis)! selected
criteria (search )unction)
%et,etail
$ulies detailed in)ormation (attributes) on an ob1ect
(the )ull ke! must be seci)ied)
Create2 Chan"e2 ,elete2 Cancel
Creatin"2 chan"in"2 and deletin" ob1ects
AddItem2 8emo'eItem
Creatin" and remo'in" subob1ects ()or e+amle2
item in an order)
".ere are stan'ar' met.o's *or 8A1s +it. stan'ar'i<e' names.
Some o* t.e most im,ortant stan'ar' met.o' names are liste' .ere.
SA A! "A#$0 $B%2$
7.22
SAP AG 2003
Findin" BAPI Function 6odules
9ierarch! Alhabetical ,etail ,ocumentation Tools Pro1ect
Fli"htBookin"
Fli"htCustomer
Fli"htConnection
8eturn
Fli"ht,ata
%et7ist
6ethod (BAPI)
'API5SFLIGHT5GETDETAIL
AirlineCarrier
Connection(umber
,ate0)Fli"ht
%et,etail
6ethod
Business ob1ect
$hort te+t
(e* as o) release
Function module
()C
Fl*/-$ 8e$%*l&
Fl*/-$'N*#/
Ge$De$%*l
,ouble4click3
(a'i"ation in
Function Builder
1n Release 4.6&0 8A1s are im,lemente' usin7 *un-tion mo'ules.
=rom t.e SA 4asy A--ess menu0 you -all t.e 8A1 4:,lorer by -.oosin7 %ools ,usiness
Framewor- ,AP+ ,rowser.
9sin7 t.e 8A1 4:,lorer0 you -an navi7ate to t.e *un-tion mo'ule 'is,lay *or t.e sele-te' 8A1 in
t.e =un-tion 8uil'er.
Sele-t t.e 8A1 in t.e .ierar-.y se-tion.
1n t.e 'etaile' 'is,lay +in'o+0 -.oose t.e 'etail tab.
8y 'ouble%-li-(in7 on t.e name o* t.e *un-tion mo'ule0 you -an 'is,lay it in t.e =un-tion 8uil'er.
SA A! "A#$0 $B%22
7.23
SAP AG 2003
Characteristics o) a BAPI Function 6odule
$AP $!stem
%nterface %nterface
Function "rou
$ource code
$tructure o)
BAPICname
Inter)ace arameters t!ed
*ith a ,ictionar! structure
that is comiled )or the BAPI
(o user
dialo"s
(o C9A(%I(%
arameters
(o
e+cetions
/rror messa"es
throu"h /MP08T
arameter RETURN
(structure or
internal table)
8emote
caabilit!
=un-tion mo'ules *or 8A1s must *ul*ill t.e *ollo+in7 reEuirements)
2amin7 -onvention 'API5L20&*#e&&523e+$5#%"eM5L"e$-85#%"eM must be use'
Remote -a,ability
2o user 'ialo7s0 neit.er s-reens nor messa7es0 allo+e'
1nter*a-e ,arameters must be ty,e' +it. a Di-tionary stru-ture t.at +as -reate' *or t.is 8A1
Stru-tures must -om,ly +it. t.e namin7 -onvention 'API5L&$,0+$0,e5#%"eM an' are
-.an7e' only on a -om,atible basis
2o CHANGING ,arameters allo+e'
2o e:-e,tions allo+e'. 4rrors are re,orte' to t.e user t.rou7. t.e s,e-ial e:,ort ,arameter
RET*RN%
SA A! "A#$0 $B%23
7.24
SAP AG 2003
Callin" a BAPI Function 6odule )rom an ABAP
Pro"ram
ABAP ro"ram
CALL FUNCTION <'API5...< CALL FUNCTION <'API5...<
EXPORTING EXPORTING
... ...
IMPORTING IMPORTING
... ...
,e$0,# ,e$0,# ; ... ; ...
For currenc! and .uantit! )ields3
Possible con'ersion to
=e+ternal )ormat=
B08
For currenc! and .uantit! )ields3
Possible con'ersion to
=e+ternal )ormat=
BACH
1* you +oul' li(e to use a 8A1 in t.e SA R/3 System0 you -an -all t.e *un-tion mo'ule -ontainin7
it.
ay attention to t.e limitations alrea'y mentione'.
8A1 inter*a-es are -reate' a--or'in7 to t.e nee's *or t.e Le:ternalL -all0 t.at is0 *rom a non%R/3
System. Quantities are e:,e-te' in an e:ternal *ormat +it. 4 or 9 'e-imal ,la-es. ".e Euantities
must be trans*erre' to t.e inter*a-e in -onverte' *ormat0 even i* t.e -orres,on'in7 -urren-y .as no
'e-imal ,la-es.
=or t.is -onversion you -an use *un-tion mo'ules *rom t.e 0AC1 *un-tion 7rou, @'evelo,ment
-lass S0FD0A5A.
SA A! "A#$0 $B%24
7.25
SAP AG 2003
Create )unction "rous and )unction modules
Add )unction module calls to !our ro"ram
Add ob1ect instantiations and method calls to
!our ro"ram
Add the A7H "rid control to disla! data in a )i+ed
screen area
Create in)ormation usin" BAPIs
Add BAPI calls to !our ro"ram&
;ou are no* able to3
%lobal 6odulariEation3
5nit $ummar!
SA A! "A#$0 $B%25
7.26Function 4roups an" Function %o"ules !(ercises
/nit$ 4lo&al %o"ulari9ation
Topic$ Creatin. an" Callin. Function 4roups an"
Function %o"ules
At t.e -on-lusion o* t.ese e:er-ises0 you +ill be able to)
&reate an' im,lement *un-tion 7rou,s
1m,lement *un-tion mo'ules
&all *un-tion mo'ules
Fou are a 'evelo,er *or an airline -onsortium. Four tas( is to 'evelo,
evaluation ,ro7rams *or several airlines.
$. All ,lane ty,es t.at are available *or ea-. airline s.oul' be store' in a *un-tion 7rou, in an
internal table. =or sim,li-ity0 t.ese s.oul' .ave a *lat line stru-ture an' not a neste'
stru-ture.
AA is your t*o)"i.it .roup num&er
Mo'el solution)
TAW40_BASICS_FLIG/T
$%$ &reate *un-tion 7rou, @AA5TA7?)5FLIGHT.
$%2 Assi7n it to messa7e -lass TA7?).
Fou -an *in' t.e ,ro7ram 1D in t.e L"3 in-lu'eL
@LTA7?)5'ASICS5FLIGHTTOPA.
$%3 Do-ument your *un-tion 7rou,.
SA A! "A#$0 $B%26
2. A *un-tion mo'ule s.oul' *ill internal tables *or ,lane ty,es. 3nly t.e available
re,la-ement ty,es *or t.e airline +it. su**i-ient seats s.oul' be +ritten to t.e table.
=rom t.e total ,ri-es t.at are trans*erre'0 t.e avera7e ,ri-e *or ea-. seat s.oul' also be
-al-ulate'. ".e ,lane list s.oul' t.en be sorte' in 'es-en'in7 or'er be*ore it is returne'.
AA is your t*o)"i.it .roup num&er
Mo'el solutions)
TAW40_BASICS_FLIG/T
TAW40_BASICS_CREATE_PLANELIST
2%$ &reate *un-tion mo'ule @5AA5TA7?)5CREATE5PLANELIST +it.in your
*un-tion 7rou, @AA5TA7?)5FLIGHT.
2%2 De-lare t.e line ty,e $5+%,,5!l%#e as your *un-tion 7rou,Us 7lobal 'ata ty,e. 1t
s.oul' be stru-ture' as *ollo+s)
&om,onent "y,e
carri" s-ar,lan%-arri'
,lanety,e s-ar,lan%,lanety,e
seatsma: sa,lane%seatsma:
".e line ty,e assi7ns t.e airline to t.e ,lane ty,e.
2%3 De-lare t.e internal table *$5+%,,5!l%#e& +it. line ty,e $5+%,,5!l%#e as
t.e 7lobal 'ata obHe-t o* your *un-tion 7rou,. 1t s.oul' be in t.e *orm o* a sorte'
table +it. t.e uniEue (ey +%,,*8 an' !l%#e$.!e.
2%4 =ill t.e internal table *$5+%,,5!l%#e& *or ea-. array *et-. usin7 vie+
TA7?)5CARPLAN.
&.oose an a,,ro,riate time *or t.e event to o--ur. Remember t.at a
*un-tion 7rou, -annot be e:e-ute' 'ire-tly.
1m,lement t.e -orres,on'in7 event blo-( in a suitable in-lu'e
,ro7ram t.at you .ave a''e' to t.e main ,ro7ram at a suitable
lo-ation. A'.ere to t.e namin7 -onventions *or *un-tion 7rou,
in-lu'e ,ro7rams.
2%5 2o+ 'e-lare t.e im,ort ,arameter +it. ,ass by value *or your *un-tion mo'ule)
*!5&e%$&++ as an o,tional ,arameter +it. t.e 'e*ault value 00
*!5+%,,*80 *!5!%."e#$&0"0 *!5+0,,e#+..
2%6 De-lare t.e e:,ort ,arameter e!5!l%#el*&$ +it. ,ass by value. Assi7n a ty,e
usin7 t.e 7lobal table ty,e TA7?)5TYPS5PLANETA'.
2%B De-lare t.e e:-e,tion #5!l%#e& an' 'o-ument it.
SA A! "A#$0 $B%2B
2%C 1n t.e *un-tion mo'ule0 -reate lo-al stru-ture l54%5+%,,5!l%#e o* ty,e
$5+%,,5!l%#e.
2%9 =rom t.e 7lobal internal table0 rea' t.ose ,lane ty,es t.at are available to t.e airline
an' +.i-. .ave su**i-ient seats *or t.e boo(in7 t.at +as trans*erre'.
1n t.is loo, -al-ulate t.e avera7e ,ri-e *or ea-. seat *or ea-. ,lane ty,e. Also
'e-lare +or( area l54%5!l%#e as a lo-al 'ata obHe-t +it.in t.e *un-tion mo'ule.
Assi7n a ty,e usin7 t.e 7lobal stru-ture TA7?)5TYPS5PLANE.
Atta-. t.e completely #ille" +or( area to t.e internal table to be e:,orte'.
2%$0 8e*ore e:,ortin70 sort t.e internal table by t.e avera7e ,ri-e ,er seat.
2%$$ "ri77er t.e e:-e,tion i* no suitable ,lane ty,es -oul' be *oun'. 1m,lement t.e
tri77er usin7 error messa7e )()0 s,e-i*yin7 t.e airline.
2%$2 Do-ument your *un-tion mo'ule.
2%$3 "est your *un-tion mo'ule.
SA A! "A#$0 $B%2C
3. 1* a ,lane brea(s 'o+n t.at is alrea'y s-.e'ule' *or a *li7.t an' alrea'y .as boo(in7s0 a
re,la-ement ,lane must be use'. #rite a ,ro7ram t.at out,uts all t.e available
re,la-ement ,lane ty,es *or ea-. airline in a list. Fou -an obtain t.e 'ata *or t.e list usin7
t.e *un-tion mo'ule you -reate' in "as( 2.
Mo'el solution)
TAW40_BASICS_CALL_F*NCTION
3%$ &reate a ne+ ,ro7ram @AA5TA7?)5SU'STITUTE5PLANES.
3%2 1n t.e ,ro7ram0 'e*ine an internal table *$5!l%#el*&$ t.at stores t.e
re,la-ement ,lane ty,es. ".e ty,e o* t.is internal table results *rom t.e *un-tion
mo'ule inter*a-e.
3%3 ".e user s.oul' Euery t.e 1M3R"12! ,arameters o* t.e *un-tion mo'ule usin7 a
sele-tion s-reen0 +.ere t.e *iel' *or t.e airline must be a man'atory *iel'.
3%4 &all your *un-tion mo'ule @5AA5TA7?)5CREATE5PLANELIST @use SampleA
an' ,o,ulate t.e inter*a-e. &at-. t.e e:-e,tions +it. a,,ro,riate error messa7es
@error messa7es 40 an' 4$ o* messa7e -lass "A#$0A. 4nsure t.at users return to
t.e sele-tion s-reen +.en an e:-e,tion o--urs.
3%5 Dis,lay t.e table *$5!l%#el*&$ *ille' by t.e *un-tion mo'ule in a list. 9se a
*iel' symbol *or t.is.
SA A! "A#$0 $B%29
7.27Function 4roups an" Function %o"ules Solutions
/nit$ 4lo&al %o"ulari9ation
Topic$ Creatin. an" Callin. Function 4roups an"
Function %o"ules
$%$0 2%4 %o"el solution SAPLTA7?)5'ASICS5FLIGHT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: S$+#em.de!"ned In-',de.!"'e+% :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
INCLUDE l$%4?)52%&*+&51l*/-$$!. J G'o(a' Da#a
INCLUDE l$%4?)52%&*+&51l*/-$0BB. J F,n-#"on Mod,'e+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: *+e.de!"ned In-',de.!"'e+ E"! ne-e++a$F% :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
INCLUDE l$%4?)52%&*+&51l*/-$$!. J S,(po&am+
: INCL*DE LTAW40_BASICS_FLIG/TO%%% J PBO.Mod,'e+
: INCL*DE LTAW40_BASICS_FLIG/TI%%% J PAI.Mod,'e+
INCLUDE l$%4?)52%&*+&51l*/-$e)?. J E3en#+
$%20 2%20 2%3 %o"el solution LTA7?)5'ASICS5FLIGHTTOP
FUNCTION6POOL TA7?)5'ASICS5FLIGHT MESSAGE6ID $%4?).
TYPES:
'EGIN OF $5+%,,5!l%#e:
+%,,*8 TYPE &+%,!l%#6+%,,*8:
!l%#e$.!e TYPE &+%,!l%#6!l%#e$.!e:
&e%$&"%B TYPE &%!l%#e6&e%$&"%B:
END OF $5+%,,5!l%#e.
DATA:
*$5+%,,5!l%#e& TYPE SORTED TA'LE OF $5+%,,5!l%#e
7ITH UNIQUE CEY +%,,*8 !l%#e$.!e.
SA A! "A#$0 $B%30
2%4 %o"el solution LTA7?)5'ASICS5FLIGHTE)?
:............................................................:
: INCL*DE LTAW40_BASICS_FLIG/TE04 :
:............................................................:
LOAD6OF6PROGRAM.
SELECT +%,,*8 !l%#e$.!e &e%$&"%B
FROM $%4?)5+%,!l%#
INTO CORRESPONDING FIELDS OF TA'LE *$5+%,,5!l%#e&.
2%$0 2%5 D 2%$$ %o"el solution TA7?)5'ASICS5CREATE5PLANELIST
FUNCTION TA7?)5'ASICS5CREATE5PLANELIST.
:J............................................................
:J:JLo-a' "n#e!a-e<
:J IMPORTING
:J )AL*EEIP_SEATSOCCF TYPE SFLIG/T.SEATSOCC DEFA*LT 0
:J )AL*EEIP_CARRIDF TYPE SPFLI.CARRID
:J )AL*EEIP_PAYMENTS*MF TYPE SFLIG/T.PAYMENTS*M
:J )AL*EEIP_C*RRENCYF TYPE SFLIG/T.C*RRENCY
:J EKPORTING
:J )AL*EEEP_PLANELISTF TYPE TAW40_TYPS_PLANETAB
:J EKCEPTIONS
:J NO_PLANES
:J............................................................
DATA:
l54%5+%,,5!l%#e TYPE $5+%,,5!l%#e:
l54%5!l%#e TYPE $%4?)5$.!&5!l%#e.
LOOP AT *$5+%,,5!l%#e& INTO l54%5+%,,5!l%#e
7HERE +%,,*8 EQ *!5+%,,*8
AND &e%$&"%B GE *!5&e%$&++.
l54%5!l%#e6!l%#e$.!e ; l54%5+%,,5!l%#e6!l%#e$.!e.
l54%5!l%#e6&e%$&"%B ; l54%5+%,,5!l%#e6&e%$&"%B.
l54%5!l%#e6%v/5!,*+e ;
*!5!%."e#$&0" / l54%5+%,,5!l%#e6&e%$&"%B.
l54%5!l%#e6+0,,e#+. ; *!5+0,,e#+..
APPEND l54%5!l%#e TO e!5!l%#el*&$.
ENDLOOP.
IF &.6&02,+ NE ).
MESSAGE e)() RAISING #5!l%#e& 7ITH *!5+%,,*8.
ELSE.
SORT e!5!l%#el*&$ 'Y %v/5!,*+e DESCENDING.
ENDIF.
ENDFUNCTION.
SA A! "A#$0 $B%3$
3 %o"el solution TA7?)5'ASICS5CALL5FUNCTION
:C...........................................................:
:C Repo# TAW40_BASICS_CALL_F*NCTION :
:C :
:C...........................................................:
:C +o',#"on o! e0e-"+e 6 !,n-#"on &o,p+ :
:C and !,n-#"on mod,'e+ :
:C...........................................................:
REPORT #a940_(a+"-+_-a''_!,n-#"on%
DATA< "#_p'ane'"+# TYPE #a940_#$p+_p'ane#a(%
FIELD.SYMBOLS< 1p'ane2 TYPE LINE OF #a940_#$p+_p'ane#a(%
PARAMETERS< pa_-a TYPE +!'"&;#.-a"d OBLIGATORY7
pa_o-- TYPE +!'"&;#.+ea#+o--7
pa_pa$+, TYPE +!'"&;#.pa$men#+,m7
pa_-, TYPE +!'"&;#.-,en-$ DEFA*LT AE*RA%
AT SELECTION.SCREEN%
CALL F*NCTION ATAW40_BASICS_CREATE_PLANELISTA
EKPORTING
"p_+ea#+o-- = pa_o--
"p_-a"d = pa_-a
"p_pa$men#+,m = pa_pa$+,
"p_-,en-$ = pa_-,
IMPORTING
ep_p'ane'"+# = "#_p'ane'"+#
EKCEPTIONS
no_p'ane+ = 4
OT/ERS = 5%
CASE +$.+,(-%
W/EN 4%
MESSAGE e040E#a940F WIT/ pa_-a%
W/EN 5%
MESSAGE e044E#a940F%
ENDCASE%
START.OF.SELECTION%
LOOP AT "#_p'ane'"+# ASSIGNING 1p'ane2%
WRITE< > 1p'ane2.p'ane#$pe7
1p'ane2.+ea#+ma07
SA A! "A#$0 $B%32
1p'ane2.a3&_p"-e C*RRENCY 1p'ane2.-,en-$7
1p'ane2.+ea#+ma07
ENDLOOP%
SA A! "A#$0 $B%33
8
SAP AG 2002
Techni.ues )or callin" ro"rams
6emor! model
Techni.ues )or assin" data
5se
Contents3
Callin" Pro"rams and Passin" ,ata
SA A! "A#$0 $C%$
8.2
SAP AG 2002
,escribe the $AP 8/# memor! model
Call e+ecutable ro"rams
Call transactions
5se the 'arious memor! areas to ass data
At the conclusion o) this unit2 !ou *ill be able to3
Callin" Pro"rams and Passin" ,ata3 5nit 0b1ecti'es
SA A! "A#$0 $C%2
8.3
SAP AG 2002
Callin" Pro"rams and Passin" ,ata (1)
Callin" ro"rams
Callin" ro"rams
6emor! mana"ement
6emor! mana"ement
Passin" data
Passin" data
SA A! "A#$0 $C%3
8.4
SAP AG 2002
Callin" Pro"rams
2 2
3 3
Main
#e#ory
2 2
3 3
Main
#e#ory
3 3
(e* ro"ram
/nd insert
1 1
2 2
Pro"ram 1
Pro"ram 2
Ti#e
Insertion
Restart
Insert ro"ram
".ere are t+o +ays o* startin7 an A8A ,ro7ram *rom anot.er A8A ,ro7ram t.at is alrea'y runnin7)
".e -alle' ,ro7ram is inserte'0 t.at is t.e -urrent ,ro7ram is interru,te' to run t.e ne+ one. ".e
-alle' ,ro7ram is e:e-ute'0 an' a*ter+ar's0 ,ro-essin7 returns to t.e ,ro7ram t.at -alle' it.
".e -urrent ,ro7ram is terminate' an' t.e -alle' ,ro7ram is starte'.
&om,lete A8A ,ro7rams +it.in a sin7le user session -an only run seEuentially. #e re*er to t.is
te-.niEue as se=uential callin..
1* you +ant to run *un-tions in ,arallel0 you must use *un-tion mo'ules. =or *urt.er in*ormation about
t.is te-.niEue0 re*er to t.e -ourse 0C4,5 FCommunication 5nter#aces in A0AG or t.e 'o-umentation
*or t.e CALL FUNCTION ... STARTING NE7 TASC ... statement.
SA A! "A#$0 $C%4
8.5
SAP AG 2002
Callin" an /+ecutable Pro"ram
Pro"ram 1
...
SU'MIT !,/5#%"e52.
...
...
SU'MIT !,/5#%"e52
AND RETURN.
...
...
SU'MIT !,/5#%"e52
>IA SELECTION6SCREEN
AND RETURN.
...
ro"CnameC2
P80%8A6 &&&
&&&
7ist
$election $creen
Pro"ram 2
F#
F# F#
ro"CnameC2
P80%8A6 &&&
&&&
7ist
F#
ro"CnameC2
P80%8A6 &&&
&&&
7iste
Insertion
Restart
Insertion
"o start an e:e-utable ,ro7ram0 use t.e SU'MIT statement.
1* you use t.e >IA SELECTION6SCREEN a''ition0 t.e system 'is,lays t.e stan'ar' sele-tion s-reen
o* t.e ,ro7ram @i* one .as been 'e*ine'A.
1* you use t.e AND RETURN a''ition0 t.e system resumes ,ro-essin7 +it. t.e *irst statement a*ter t.e
SU'MIT statement on-e t.e -alle' ,ro7ram .as *inis.e'.
=or *urt.er in*ormation0 re*er to t.e 'o-umentation *or t.e SU'MIT statement.
SA A! "A#$0 $C%5
8.6
SAP AG 2002
Callin" a Transaction
$AP6 tCname
&&&
7/AH/ P80%8A6&
&&&
Pro"ram 1
...
LEA>E TO TRANSACTION AT_CODEA
GAND SCIP FIRST SCREENI.
...
1& $creen
2& $creen
F1B
Pro"ram 23 Transaction (C4E (C4E
$AP6 tCname
&&&
7/AH/ P80%8A6&
&&&
...
CALL TRANSACTION AT_CODEA
GAND SCIP FIRST SCREENI.
...
1& $creen
2& $creen
F1B
Insertion
Restart
#it. t.e LEA>E TO TRANSACTION <T_CODE< statement you terminate t.e -urrent ,ro7ram an'
start t.e transa-tion +it. transa-tion -o'e T5CODE. ".e statement is t.e eEuivalent to enterin7
/#1T_CODE2 in t.e -omman' *iel'.
CALL TRANSACTION AT_CODEA allo+s you to insert A8A ,ro7rams t.at .ave a transa-tion -o'e.
"o terminate an A8A ,ro7ram0 use t.e LEA>E PROGRAM statement. 1* t.e statement is use' in a
,ro7ram t.at you -alle' usin7 CALL TRANSACTION AT_CODEA or SU'MIT po&_name AND
RETURN0 t.e system resumes ,ro-essin7 at t.e ne:t statement a*ter t.e -all in t.e -allin7 ,ro7ram.
3t.er+ise0 t.e user returns to t.e a,,li-ation menu *rom +.i-. .e or s.e starte' t.e ,ro7ram.
1* you use t.e ... AND SCIP FIRST SCREEN a''ition0 t.e system 'oes not 'is,lay t.e screen
contents o* t.e *irst s-reen. >o+ever0 it 'oes ,ro-ess t.e *lo+ lo7i-.
1* t.e transa-tion T_CODE you -alle' +it. CALL TRANSACTION uses u,'ate te-.niEues0 you -an use
t.e UPDATE... a''ition to s,e-i*y t.e u,'ate te-.niEue @asyn-.ronous @'e*aultA0 syn-.ronous0 or
lo-alA t.at t.e ,ro7ram s.oul' use. =or *urt.er in*ormation0 re*er to -ourse 0C4,4 Fro.rammin.
>ata&ase /p"atesG an' t.e online 'o-umentation.
SA A! "A#$0 $C%6
8.7
SAP AG 2002
Callin" Pro"rams and Passin" ,ata (2)
Callin" ro"rams
Callin" ro"rams
6emor! mana"ement
6emor! mana"ement 6emor! mana"ement
Passin" data
Passin" data
SA A! "A#$0 $C%B
8.8
SAP AG 2002
7o"ical 6emor! 6odel
/+ternal session (*indo*) 1
A
B
A
P

m
e
m
o
r
!

1
Internal session 1&1
Pro"ram 1&1
/+ternal session (*indo*) 2
A
B
A
P

m
e
m
o
r
!

2
Internal session 2&1
Pro"ram 2&1
$AP memor!
5ser terminal session
Internal session 1&2
Pro"ram 1&2
".e +ay in +.i-. t.e main memory is or7ani<e' *rom t.e ,ro7ramYs ,oint o* vie+ -an be re,resente' in t.e
above lo7i-al mo'el. ".ere is a 'istin-tion bet+een internal an' e:ternal sessions)
!enerally0 an e(ternal session is -onne-te' to an R/3 +in'o+. Fou -an -reate a ne+ session by
-.oosin7 System 6ew Session or by enterin7 /1T_CODE2 in t.e -omman' *iel'. Fou -an
.ave u, to si: e:ternal sessions o,en simultaneously in one terminal session.
4:ternal sessions are sub'ivi'e' into internal sessions @,la-e' on a stac'A. 4a-. ,ro7ram t.at you
run o--u,ies its o+n internal session. 4a-. e:ternal session -an -ontain u, to nine internal
sessions.
Data *or a ,ro7ram is only +isi&le *ithin an internal session. ".e visibility o* t.e 'ata is 7enerally restri-te' to
t.e relevant ,ro7ram.
".e *ollo+in7 sli'es illustrate .o+ t.e sta-( insi'e an e:ternal session -.an7es +it. various ,ro7ram -alls.
SA A! "A#$0 $C%C
8.C
SAP AG 2002
Insertin" a Pro"ram (1)
E"ternal session &window) 3
A
B
A
P

m
e
m
o
r
y

3
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
Internal session 2&1
Pro"ram 2&1
SAP memory
#ser terminal session
SA A! "A#$0 $C%9
8.,0
SAP AG 2002
Insertin" a Pro"ram (2)
E"ternal session &window) 3
A
B
A
P

m
e
m
o
r
y

3
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
Internal session 2&1
Pro"ram 2&1
SAP memory
#ser terminal session
Internal session 1&2
Pro"ram 1&2 Pro"ram 1&2
-nsertion
#.en you insert a ,ro7ram0 t.e system -reates a ne+ internal session0 +.i-. in turn -reates a ne+
,ro7ram -onte:t.
".e ne+ session is ,la-e' on t.e sta-( ".e ,ro7ram -onte:t o* t.e -allin7 ,ro7ram also remains inta-t.
SA A! "A#$0 $C%$0
8.,,
SAP AG 2002
Terminatin" the Inserted Pro"ram
E"ternal session &window) 3
A
B
A
P

m
e
m
o
r
y

3
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
Internal session 2&1
Pro"ram 2&1
SAP memory
#ser terminal session
#.en t.e -alle' @inserte'A ,ro7ram *inis.es0 its internal session @t.e to, one in t.e sta-(A is 'elete'.
ro-essin7 is resume' in t.e ne:t%.i7.est internal session in t.e sta-(.
SA A! "A#$0 $C%$$
8.,2
SAP AG 2002
8estartin" an /+ecutable Pro"ram (1)
E"ternal session &window) 3
A
B
A
P

m
e
m
o
r
y

3
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
SAP memory
#ser terminal session
Internal session 1&2
Pro"ram 1&2
Internal session 1&#
Pro"ram 1&#
Internal session 2&1
Pro"ram 2&1
#.en you en' a ,ro7ram an' start a ne+ one0 t.ere is a 'istin-tion bet+een -allin7 an e:e-utable
,ro7ram an' -allin7 a transa-tion0 +it. re7ar' to memory areas.
SA A! "A#$0 $C%$2
8.,3
SAP AG 2002
8estartin" an /+ecutable Pro"ram (2)
E"ternal session &window) 3
A
B
A
P

m
e
m
o
r
y

3
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
SAP memory
#ser terminal session
Internal session 1&2
Pro"ram 1&2
Internal session 1&#:
Pro"ramm Pro"ramm 1&#: 1&#:
Internal session 2&1
Pro"ram 2&1
Restart
1* you -all an e:e-utable ,ro7ram usin7 its ,ro7ram name @terminatin7 t.e -allin7 ,ro7ramA0 t.e system
'eletes t.e internal session o* t.e ,ro7ram t.at you are terminatin7 @t.e to, one *rom t.e sta-(A.
".e system -reates a ne+ internal session0 +.i-. in turn -reates t.e ,ro7ram -onte:t o* t.e -alle'
,ro7ram.
".e ne+ session is ,la-e' on t.e sta-( 4:istin7 ,ro7ram -onte:ts remain inta-t. ".e to,most internal
session on t.e sta-( is re,la-e'.
SA A! "A#$0 $C%$3
8.,4
SAP AG 2002
8estartin" a Transaction (1)
/+ternal session (*indo*) 1
A
B
A
P

m
e
m
o
r
!

1
Internal session 1&1
Pro"ram 1&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
SAP memory
#ser terminal session
Internal session 1&2
Pro"ram 1&2
Internal session 1&#
Pro"ram 1&#
Internal session 2&1
Pro"ram 2&1
SA A! "A#$0 $C%$4
8.,5
SAP AG 2002
8estartin" a Transaction (2)
/+ternal session (*indo*) 1:
A
B
A
P

m
e
m
o
r
!

1
:
Interner 6odus 1:&1
Pro"ram 1:&1 Pro"ram 1:&1
E"ternal session &window) 2
A
B
A
P

m
e
m
o
r
y

2
SAP memory
#ser terminal session
Internal session 2&1
Pro"ram 2&1
Restart
(complete
initialization)
1* you start a ,ro7ram usin7 its transaction co"e @t.at is0 i* one +as 'e*ine'A0 all o* t.e internal
sessions on t.e sta-( are 'elete'.
".e system -reates a ne+ internal session0 +.i-. in turn -reates t.e ,ro7ram -onte:t o* t.e -alle'
,ro7ram.
A*ter t.e -all0 t.e A8A memory is initiali9e".
SA A! "A#$0 $C%$5
8.,6
SAP AG 2002
Callin" Pro"rams and Passin" ,ata (#)
Callin" ro"rams
Callin" ro"rams
6emor! mana"ement
6emor! mana"ement
Passin" data
Passin" data Passin" data
SA A! "A#$0 $C%$6
8.,7
SAP AG 2002
0'er'ie*3 Passin" ,ata Bet*een Pro"rams
Pro"ram A 3 3
@ @
4B 4B
Inter)ace
$AP memor!
($/T/%/T arameters)
ABAP memor!
2 2
3 3
Pro"ram B
> >
".ere are various +ays o* ,assin7 'ata to ,ro7rams runnin7 in se,arate internal sessions)
Fou -an use)
C".e inter*a-e o* t.e -alle' ,ro7ram @usually a stan'ar' sele-tion s-reenA
CA8A memory
CSA memory
CDatabase tables
C6o-al *iles on your ,resentation server
".e *ollo+in7 sli'es 'eal +it. t.e *irst t.ree o* t.ese met.o's.
=or *urt.er in*ormation re7ar'in7 t.e ,assin7 o* 'ata usin7 'atabase tables or t.e s*ared uffer0 re*er to
t.e 'o-umentation *or t.e EXPORT an' IMPORT statements.
=or *urt.er in*ormation on trans*errin7 'ata bet+een an A8A ,ro7ram an' a ,resentation server0 re*er
to t.e 'o-umentation *or t.e *un-tion mo'ules GUI5UPLOAD an' GUI5DO7NLOAD.
SA A! "A#$0 $C%$B
8.,8
SAP AG 2002
Passin" ,ata 5sin" the Pro"ram Inter)ace
Pro"ram A
4
a
t
a
4
a
t
a
Pro"ram B
Standard selection screen
#.en you -all A8A ,ro7rams t.at .ave a stan'ar' sele-tion s-reen0 you -an ,ass 'ata *or t.e in,ut *iel's in t.e
-all.
".ere are t+o +ays to 'o t.is)
8y s,e-i*yin7 a variant *or t.e sele-tion s-reen +.en you -all t.e ,ro7ram
8y s,e-i*yin7 values *or t.e in,ut *iel's +.en you -all t.e ,ro7ram
SA A! "A#$0 $C%$C
8.,C
SAP AG 2002
Preassi"nin" Halues )or Inut Fields
DATA &e$ TYPEHLICE RANGE OF $.!eH8%$%23e+$X.
SU'MIT !,/5#%"e AND RETURN G>IA SELECTION6SCREENI
7ITH !%,%"e$e, EQHNEH... v%l
7ITH &el5!$ EQHNEH... v%l SIGN <I<H<E<X
7ITH &el5!$ 'ET7EEN v%l? AND v%l2 SIGN <I<H<E<X
7ITH &el5!$ NOT 'ET7EEN v%l? AND v%l2 SIGN <I<H<E<X
7ITH &el5!$ IN &e$
... .
Insert attern

)ther pattern S*BMI#


Pattern for SUBMIT
statement inserts the
appropriate frame for the
program call into the
source coe
".e 7ITH a''ition to t.e SU'MIT statement allo+s you to ,reassi7n values *or ,arameters an'
sele-tion o,tions on a stan'ar' sele-tion s-reen o* t.e -alle' e:e-utable ,ro7ram. ".e abbreviations
LEQ0 NE0 ...I I0 EL .ave t.e same meanin7s as +it. sele-tion o,tions.
1* you +ant to ,ass several sele-tions *or a sele-tion o,tion0 you -an use t.e RANGE statement instea'
o* in'ivi'ual 7ITH a''itions. ".e RA2!4S statement -reates a sele-tion table0 +.i-. you -an *ill as
t.ou7. it +ere a sele-tion o,tion. Fou t.en ,ass t.e +.ole table to t.e e:e-utable ,ro7ram.
1* you +ant to 'is,lay t.e stan'ar' sele-tion s-reen +.en you -all t.e ,ro7ram0 use t.e >IA
SELECTION6SCREEN a''ition.
#.en you use t.e SU'MIT statement0 use t.e attern *un-tion in t.e A8A 4'itor to insert an
a,,ro,riate statement ,attern *or t.e ,ro7ram you +ant to -all. 1t automati-ally su,,lies t.e names o*
t.e ,arameters an' sele-tion o,tions t.at are available on t.e stan'ar' sele-tion s-reen.
=or *urt.er in*ormation about +or(in7 +it. variants an' about ot.er synta: variants o* t.e 7ITH
a''ition0 re*er to t.e 'o-umentation *or t.e SU'MIT statement.
SA A! "A#$0 $C%$9
8.20
SAP AG 2002
ABAP 6emor! and $AP 6emor!
/+ternal session (*indo*) 1
A
B
A
P

m
e
m
o
r
!

1
Internal session 1&1
Pro"ram 1&1
/+ternal session (*indo*) 2
A
B
A
P

m
e
m
o
r
!

2
Internal session 2&1
Pro"ram 2&1
$AP memor! ($/T /%/T arameters) $AP memor! ($/T /%/T arameters)
5ser terminal session
Internal session 1&2
Pro"ram 1&2
Internal session 2&2
Pro"ram 2&2
Fou -an use SA memory an' A8A memory to ,ass 'ata bet+een ,ro7rams.
SA memory is a user%s,e-i*i- memory area *or storin7 #iel" +alues. 1t is only o* limite' value *or
,assin7 'ata bet+een internal sessions. ;alues in SA memory are retaine' *or t.e 'uration o* t.e
userYs terminal session. ".e memory -an be use' bet+een sessions in t.e same terminal session.
Fou -an use t.e -ontents o* SA memory as 'e*ault values *or s-reen *iel's. All e(ternal sessions
-an use t.e SA memory.
A0A memory is also user%s,e-i*i-. ".ere is a lo-al A8A memory *or ea-. e:ternal session.
Fou -an use it to e:-.an7e any A0A +aria&les @*iel's0 stru-tures0 internal tables0 -om,le:
obHe-tsA bet+een t.e internal sessions in any one e:ternal session.
#.en t.e user e:its an e:ternal session @/* in t.e -omman' *iel'A0 t.e -orres,on'in7 A8A
memory is automati-ally initiali<e' or release'.
SA A! "A#$0 $C%20
8.2,
SAP AG 2002
Passin" ,ata 5sin" the ABAP 6emor!
PROGRAM !? ... .
DATA: !?5&!1l* TYPE &!1l*:
*$5&!1l* TYPE STANDARD TA'LE
OF &!1l*.
...
PROGRAM !2 ... .
DATA: !25&!1l* TYPE &!1l*:
*$5&!1l* TYPE STANDARD TA'LE
OF &!1l*.
...
*aC)li
itCs)li
6;CI,
ABAP memor!
6;CI,1 &&&
EXPORT EXPORT
4%51l* FROM !?5&!1l* 4%51l* FROM !?5&!1l*
*$5&!1l* *$5&!1l*
TO MEMORY ID <MY5ID<. TO MEMORY ID <MY5ID<.
IMPORT IMPORT
4%51l* TO !25&!1l* 4%51l* TO !25&!1l*
*$5&!1l* *$5&!1l*
FROM MEMORY ID <MY5ID<. FROM MEMORY ID <MY5ID<.
Internal session 1
Internal session 2
".e EXPORT ... TO MEMORY statement allo+s you to -o,y any number o* A8A 'ata obHe-ts
+it. t.eir -urrent values to t.e A8A memory @'ata -lusterA.
".e ID ... a''ition enables you to i'enti*y 'i**erent -lusters @ma:imum o* 60 -.ara-tersA.
1* you use a ne+ EXPORT TO MEMORY statement *or an e:istin7 'ata -luster0 t.e ne+ one +ill
over+rite t.e ol'.
".e IMPORT ... FROM MEMORY ID ... statement allo+s you to -o,y t.e 'ata *rom t.e A8A
memory into -orres,on'in7 'ata obHe-ts o* your A8A ,ro7ram.
1t is also ,ossible to only im,ort ,arts o* 'ata -lusters usin7 IMPORT.

".e 'ata obHe-ts t.at are to re-eive t.e 'ata *rom t.e A8A memory -luster must .ave t.e same ty,es
in bot. t.e -allin7 an' t.e -alle' ,ro7rams.
"o release a 'ata -luster0 use t.e FREE MEMORY ID ... statement.
8ear in min' t.at +.en you -all ,ro7rams usin7 transa-tion -o'es0 you -an only use t.e A8A
memory to ,ass 'ata *hen insertin. @CALL TRANSACTIONA.
SA A! "A#$0 $C%2$
8.22
SAP AG 2002
Passin" Parameters 5sin" the $AP 6emor!
$AP memor! $AP memor!
CA8 CA8
79
Pro0ram A Pro0ram A
Airline
Connection
79
or
or
Pro0ram B Pro0ram B
Airline
Connection
79
$/T

%/T

C0( C0(
@00
@00
@00
SET PARAMETER ID
<CON< FIELD &8.#5+##6+##*8.
CALL TRANSACTION ... .
GET PARAMETER ID
<CON< FIELD &8.#5+##6+##*8.
Fou -an 'e*ine memory areas @,arametersA in t.e SA memory in various +ays)
8y -reatin7 in,ut/out,ut *iel's +it. re*eren-e to t.e A8A Di-tionary. ".ese ta(e t.e ,arameter
name o* t.e 'ata element to +.i-. t.ey re*er.
Alternatively0 you -an enter a name in t.e attributes o* t.e in,ut/out,ut *iel's.
>ere0 you -an also -.oose +.et.er t.e entries *rom t.e *iel' s.oul' be trans*erre' to t.e ,arameter
@SETA0 or +.et.er t.e in,ut *iel' s.oul' be *ille' +it. t.e value *rom t.e ,arameter @GETA.
"o *in' out about t.e names o* t.e ,arameters assi7ne' to in,ut *iel's0 'is,lay t.e *iel' .el, *or t.e
*iel' @=$A0 t.en -.oose %ec*nical info.
Fou -an also *ill t.e memory areas 'ire-tly usin7 t.e SET PARAMETER ID APAR_IDA
FIELD 3a. statement an' rea' t.em usin7 GET PARAMETER ID <PAR_ID< FIELD
3a.
=inally0 you -an 'e*ine ,arameters in t.e O4ect 6avigator an' let t.e user *ill t.em +it. values.
SA A! "A#$0 $C%22
8.23
SAP AG 2002
Pre'ie*3 Passin" ,ata 5sin" an Internal Table
$AP6 tCname
&&&
7/AH/ P80%8A6&
&&&
1st screen
2nd screen
F1B
Pro"ram 23 Transaction (EC4E (EC4E Pro"ram 1
...
DATA:
2*5*$%2 TYPE TA'LE OF 28+8%$%:
2*54% TYPE 28+8%$%.
* fill bi_itab
...
* call other program
CALL TRANSACTION <T5CODE<
USING 2*5*$%2.
IF &.6&02,+ ; ).
...
ELSE.
...
biCitab
".e CALL TRANSACTION <T_CODE< USING ("_"#a( statement allo+s you to insert t.e transa-tion
T_CODE0 an' t.e s-reens are ,ro-esse' a--or'in7 to t.e internal table biOitab.
This internal ta&le must &e type" accor"in. to the structure 28+8%$% an" #ille" appropriately.
".e MODE a''ition allo+s you to s,e-i*y +.et.er t.e s-reen -ontents s.oul' all be 'is,laye' @AAA % t.e 'e*ault
settin7A0 only +.en an error o--urs @AEAA0 or not at all @ANAA.
".e MESSAGES INTO me++_"#a( a''ition is use' to s,e-i*y +.ere t.e system messa7es sent 'urin7 t.e
e:e-ution o* t.e -alle' transa-tion are +ritten.
The internal ta&le must &e type" accor"in. to the structure &"cms.coll.
Fou -an *in' out i* t.e transa-tion +as e:e-ute' su--ess*ully *rom t.e system *iel' &.6&02,+.
".is te-.niEue is use*ul i*0 *or e:am,le)
Fou are ,ro-essin7 in t.e *ore7roun'0 but t.e in,ut *iel's .ave not been *ille' usin7 GET
,arameters
SA A! "A#$0 $C%23
Fou +ant to ,ro-ess t.e transa-tion in t.e ba-(7roun'. 1n t.is -ase0 you normally .ave to ,ass
*un-tion -o'es as +ell.
".is te-.niEue is also one o* t.e ,ossible +ays o* trans*errin7 'ata *rom non%SA systems.
"o 'o so t.e internal table in t.e 28+8%$% *ormat must be *ille' -om,letely.
SA A! "A#$0 $C%24
8.24
SAP AG 2002
Fields o) the %lobal T!e bdcdata
1#%" 1#%" 8.#!, 8.#!, !,/,%" !,/,%"
,escrition
8.#2e/*# 8.#2e/*#
Pro"ram name
Field name Field name
1v%l 1v%l
?32 ?32 ( ( () () ? ?
7en"th 7en"th
?32 ?32
(ote *hen
)illin"
0nl! in 1st
record on screen
$creen number First record Field name Field 'alue
0nl! in 1st
record on screen
:M: )or 1st
record on
screen2
other*ise : :
Case4
sensiti'e
=illin7 t.e internal table in bat-. in,ut *ormat)
4a-. s-reen t.at is to be ,ro-esse' an' *ille' automati-ally in t.e transa-tion must be i'enti*ie' by
a line0 in +.i-. only t.e *iel's !,/,%"0 8.#!, an' 8.#2e/*# are *ille'.
A*ter t.e re-or' t.at i'enti*ies t.e s-reen0 use a se,arate 28+8%$% re-or' *or ea-. *iel' you +ant
to *ill. ".ese re-or's use t.e table *iel's 1#%" an' 1v%l. ".e *ollo+in7 *iel's -an be *ille')
\ 1n,ut/out,ut *iel's0 +it. 'ata
\ ".e -omman' *iel' @28+5N+8eA0 +it. *un-tion -o'es
\ ".e -ursor ,osition *iel' @28+5+0,&,A0 +it. *iel' names.
Fou also use t.e CALL TRANSACTION te-.niEue to trans*er "ata #rom e(ternal systems.
=urt.er in*ormation on t.is to,i- is available in t.e -ourse 0C420 F>ata Trans#erG an' in t.e online
'o-umentation.
SA A! "A#$0 $C%25
8.25
SAP AG 2002
/+amle3 Passin" ,ata 5sin" an Internal Table
1#%" 1#%" 8.#!, 8.#!, !,/,%" !,/,%" 8.#2e/*# 8.#2e/*#
SAP'C()?5CALD5CREATE5CUSTOMER
1v%l 1v%l
)?)) X
SCUSTOM6NAME L+0,,e#$5#%"eM
SCUSTOM6CITY L+0,,e#$5+*$.M
'DC5OCCODE SA>E
DATA:
4%528+8%$% TYPE 28+8%$%:
*$528+8%$% LICE TA'LE OF 4%528+8%$%.
* fill the bdcdata-table ...
CALL TRANSACTION <'C()?5CALD5CRE5CUST<
USING *$528+8%$%
MODE <N<.
IF &.6&02,+ LM ).
MESSAGE ... 7ITH &.6&02,+.
ENDIF.
28+8%$% 28+8%$%
USING USING
MODE MODE
I! for comman
fiel
Save
".is e:am,le re*ers to t.e transa-tion 'C()?5CALD5CTA5U. 1* you reEuest t.e -reation o* a ne+
-ustomer entry .ere0 t.e transa-tion 'C()?5CALD5CRE5CUST is inserte'. ".is transa-tion .as not
im,lemente' an im,ort *rom t.e A8A memory0 an' its in,ut *iel's are not set as GET ,arameters. ".e
-ustomer 'ata is t.ere*ore ,asse' usin7 an internal table an' t.e transa-tion ,ro-esse' in t.e
ba-(7roun'.
1* t.e o,eration is su--ess*ul0 t.e ne+ -ustomer 'ata re-or' -an be entere' in t.e +aitin7 list.
".e relevant internal table in 28+8%$% *ormat is s.o+n above. -urrentOname is t.e -ustomer
name a'o,te' *rom t.e in,ut *iel' at runtime0 -urrentO-ity is t.e -ity.
Fou a''ress t.e -omman' *iel' usin7 'DC5OCCODE. >ere you enter t.e *un-tion -o'e t.at is tri77ere'
by t.e user -.oosin7 a *un-tion (ey0 ,us.button0 or menu entry 'urin7 t.e 'ialo7 *lo+ @or by enterin7 a
-o'e 'ire-tly in t.e -omman' *iel'A.
SA A! "A#$0 $C%26
8.26
SAP AG 2002
,escribe the $AP 8/# memor! model
Call e+ecutable ro"rams
Call transactions
5se the 'arious memor! areas to ass data
;ou are no* able to3
Callin" Pro"rams and Passin" ,ata3 5nit $ummar!
SA A! "A#$0 $C%2B
C
SAP AG 2003
Aendi+
This section contains sulementar! material
to be used as re)erence&
This material is not art o) the standard course&
There)ore2 the instructor mi"ht not co'er this durin"
the course resentation&
SA A! "A#$0 $9%$
C.2
SAP AG 2003
Pro"ram T!es
Pro"ram T!es
Pro"ram T!es
,ata T!es2 ,ata 0b1ects2 and $tatements
,ata T!es2 ,ata 0b1ects2 and $tatements
7o"ical ,atabases
7o"ical ,atabases
Pre'ie*
Pre'ie*
SA A! "A#$0 $9%2
C.3
SAP AG 2003
Include3 TincludeCnameU
( Pro"ram t!e3 Include )
Pro"ram3 Tro"ramCnameU
REPORT L!,/,%"5#%"eM.
:
INCLUDE L*#+l08e5#%"eM.
:
ABAP statements
Pro"rams o) =Include= T!e
SA A! "A#$0 $9%3
C.4
SAP AG 2003
REPORT L#%"eM.
TYPES:...
DATA: ...
Pro"ram3 TnameUT0P
Pro"ram t!e3 Include
Pro"ram3 TnameU
Pro"ram t!e3 e+ecutable
INCLUDE L#%"eMTOP.
START6OF6SELECTION.
:
Create ro"ram
ro"ram TnameU
With T0P4Include
8eositor! Bro*ser3
Create ro"ram
T0P Include
SA A! "A#$0 $9%4
C.5
SAP AG 2003
$tandard Includes )or Function %rous
The 0b1ect 7ist /dit %oto 5tilities /n'ironment $!stem 9el
$b6ect (a&igator
The )b;ect List
Display
BC402_FM_)%I#LIS# Function group
Class
Local )b;ects
Develop2ent class
progra2
Workbench /dit %oto /+tras /n'ironment $!stem 9el
$b6ect (a&igator
)b;ect na2e
:C+&/#F!DD#<AITLIST
Function 2odules
Fields
0:) 2odules
Screens
5*I title
Includes
L:C+&/#F!DD#<AITLISTT)0
L:C+&/#F!DD#<AITLIST)&-
L:C+&/#F!DD#<AITLIST*&-

L:C+&/#F!DD#<AITLIST*&/
L:C+&/#F!DD#<AITLIST*&'
L:C+&/#F!DD#<AITLIST*&+
L:C+&/#F!DD#<AITLIST*&6
L:C+&/#F!DD#<AITLIST*&=
L:C+&/#F!DD#<AITLIST*44
Add >aiting custo2er
<aiting custo2er $ro2 list
Display >aiting list
!ove up >aiting custo2er
%eturn position in list
Change >aiting position
Function modules Function modules Function modules Function modules Function modules
PB0 modules
%lobal declarations
Include )unction modules
#.en you +or( +it. *un-tion 7rou,s an' mo'ules0 you -an use t.e A8A #or(ben-. to arran7e
t.e ,ro7ram sour-e -o'e in overvie+ *orm an' stru-ture it +it. ease.
1n t.e 2avi7ation *un-tion0 you al+ays bran-. to t.e -orre-t obHe-t0 an' 1n-lu'e ,ro7rams are 7iven
names an' -reate'. ".e res,e-tive -all statements are automati-ally entere' at t.e -orre-t ,osition.
".e -all statements must -ontain only t.e name -onvention *or *un-tion 7rou,s) YH
@1em_name2%
".e system t.en -reates a ,ro7ram o* = ty,e0 SAPLYH@1em_name2% ".is -ontains only
INCLUDE statements t.at +ere -reate' automati-ally. ".e 1n-lu'e ,ro7rams are automati-ally 7iven
t.e name LYH@1em_name21a((e321n,m2%
1n a''ition0 t.e system in-lu'es t.e 1n-lu'e ,ro7ram0 LYH@1em_name2UXX. >ere0 t.ere is a -all
*or an a,,ro,riate 1n-lu'e ,ro7ram0 8?KLXremOnameJ/XnumJ0 *or ea-. *un-tion mo'ule.
SA A! "A#$0 $9%5
C.6
SAP AG 2003
,ata T!es2 ,ata 0b1ects2 and $tatements
Pro"ram T!es
Pro"ram T!es
,ata T!es2 ,ata 0b1ects2 and $tatements
,ata T!es2 ,ata 0b1ects2 and $tatements
7o"ical ,atabases
7o"ical ,atabases
Pre'ie*
Pre'ie*
SA A! "A#$0 $9%6
C.7
SAP AG 2003
$tructures and internal Tables Can be (ested
Stru-ture ty,es -an -ontain ot.er stru-ture ty,es or table ty,es.
"able ty,es -an -ontain stru-ture ty,es an' table ty,es.
1n t.e (ey+or' 'o-umentation *or t.e (ey+or' TYPES0 you +ill *in' t.e synta: *or 'e*inin7 table
ty,es.
SA A! "A#$0 $9%B
C.8
SAP AG 2003
TYPE6POOL @()).
TYPES: P())5#%"e5$.!eD2VE TYPE C:
'EGIN OF P())51l*/-$,e+5$.!e:
... :
END OF P())51l*/-$,e+5$.!e.
REPORT ... .
TYPE6POOLS P()).
DATA: #%"e TYPE P())5#%"e5$.!e:
4% TYPE P())51l*/-$,e+5$.!e.
... .
ABAP
T!e %rous in the ABAP ,ictionar!
1n a''ition to 'e-larin7 a 'ata ty,e +it.in an A8A ,ro7ram0 you -an also 'e-lare 'ata ty,es in a
ty,e 7rou, in t.e A8A Di-tionary.
".e ty,e 7rou, name in t.e A8A Di-tionary .as a ma:imum o* *ive -.ara-ters. "y,e names +it.in
t.e ty,e 7rou, 1#$ppoo'2 must be7in +it. 1#$ppoo'2 *ollo+e' by an un'ers-ore.
".e ty,es in a ty,e 7rou, must be 'e-lare' in A8A ,ro7rams +it. t.e TYPE.POOLS -omman'.
SA A! "A#$0 $9%C
C.C
SAP AG 2003
T!e Con'ersion
When are t*o t!es comatibleA
T*o elementar! t!es are comatible i) the! are identical in
t!e and len"th (and number o) decimal laces in the case o)
acked numbers)&
T*o structure t!es are comatible i) the! ha'e the same
structure and their comonents are comatible&
T*o table t!es are comatible i) their line t!es are
comatible and their ke! de)initions2 ke! cate"ories2 and table
t!es are identical&
,ata ob1ects *ith comatible t!es can be assi"ned
*ithout con'ersion&
(on4comatible t!es can be con'erted i) a con'ersion
rule has been de)ined&
1* t+o 'ata ty,es are not -om,atible0 but a -onversion rule e:ists0 t.en t.e system
,er*orms ty,e -onversions *or value assi7nments0 -al-ulations0 or -om,arisons.
".e *ollo+in7 7ra,.i-s intro'u-e t.e basi- *orms o* -onversion rules an' 7ive e:am,les
o* t.e most im,ortant -ases. All t.e -onversion rules -an be *oun' in t.e A8A 'o-umentation
on t.e M3;4 statement.
1* no -onversion rule is 'e*ine' *or a statement0 t.e systemYs rea-tion 'e,en's u,on
t.e ,arti-ular ,ro7ram -onte:t)
1n t.e -ase o* statistical typesA t.e system issues a synta( error.
!(ample)
DATA: 8%$e TYPE 8 >ALUE <?YYY?23?<: $*"e TYPE $.
FIELD6SYM'OLS: L1&58%$eM TYPE 8: L1&5$*"eM TYPE $.
ASSIGN: 8%$e TO L1&58%$eM: $*"e TO L1&5$*"eM.
L1&5$*"eM ; L1&58%$eM.
1n t.e -ase o* "ynamic ty,es0 t.e system issues a runtime error sin-e t.e t.e *iel' symbols are
ty,e' only +.en t.e 'ata obHe-ts are assi7ne' at runtime.
!(ample @rest as aboveA)
&&&
FIELD6SYM'OLS: L1&58%$eM TYPE ANY: L1&5$*"eM TYPE ANY&
&&&
SA A! "A#$0 $9%9
C.,0
SAP AG 2003
7o"ical /+ressions
* +"!%,*&#& 1, %ll 8%$%$.!e&:
.. L823M ZEQH;X ZLl*$e,%lMHL823MX .. 9eJ0%l
.. L823M ZNEHLMX ZLl*$e,%lMHL823MX .. 9#$ eJ0%l
.. L823M ZGTHMX ZLl*$e,%lMHL823MX .. 9/,e%$e, $-%#
.. L823M ZGEHM;X ZLl*$e,%lMHL823MX .. 9/,e%$e, , eJ0%l
.. L823M ZLTHLX ZLl*$e,%lMHL823MX .. 9le&& $-%#
.. L823M ZLEHL;X ZLl*$e,%lMHL823MX .. 9le&& , eJ0%l
.. L823M 'ET7EEN ZLl*$MHL823MX AND ZLl*$MHL823MX ..
.. L823M IS INITIAL ..
* #e&$*#/ l/*+ eB!,e&&*#&:
.. L#e&$5!M D LeB!,?M L#e&$5!M LeB!,2M E L#e&$5!M ..
* !&&*2le !e,%$,& L#e&$5!M:
.. AND .. 9%ll eB!,e&&*#& "0&$ 2e $,0e
.. OR .. 9#e 1 $-e eB!,e&&*#& "0&$ 2e $,0e
* #e/%$*#:
.. NOT LeB!,M .. 9$,0e: *1 LeB!,M 1%l&e
1* you .ave a -om,arison o* non)numeric 'ata obHe-ts0 t.ese are inter,rete' 'i**erently0 'e,en'in7
u,on ty,e.
1* ,ossible) -onversion in numbers @.e:a'e-imal0 *or e:am,le0 as binary numberA
Date an' time) inter,rete' as earlier or laterI *or e:am,le0 $2/3$/$999 X 0$/0$/2000
3t.er -.ara-ters) le:o7ra,.i-al inter,retation a--or'in7 to -.ara-ter -o'eI a'a,t len7t. by *illin7
in blan(s
Re*eren-es) -om,arison o* a''ress an' 'ata ty,e0 only Si'enti-alS -an be inter,rete' suitably
=or -om,arisons o* strin7s an' bits0 more relational o,erators are available @see online
'o-umentation *or 1=A.
1n t.e -ase o* lin(s an' ne7ations0 t.e stan'ar' rules *or lo7i-al e:,ressions a,,ly)
-6T is more ,o+er*ul t.an A->0 A-> is more ,o+er*ul t.an 6R.
!(ample
-6T #, N #2 6R #3 N #4 A-> #5 N #6 t.ere*ore -orres,on's to
F -6T F #, N #2 G G 6R F #3 N #4 A-> #5 N #6 G.
"o .ave a better overvie+ an' *or se-urity reasons0 ,la-e your ,artial e:,ressions in bra-(ets0 even i*
it is not absolutely ne-essary.
8y settin7 u, your e:,ressions -are*ully0 you -an in*luen-e t.e runtime reEuirement in a ,ositive
+ay.
SA A! "A#$0 $9%$0
C.,,
SAP AG 2003
0'er'ie*3 Termination $tatements
7oos3
,0 W9I7/
$/7/CT 700P
/'ents I3
70A,40F4P80%8A6&
$TA8T40F4$/7/CTI0(&
%/T TnodeU Y7AT/Z&
/(,40F4$/7/CTI0(&
/'ents II3
I(ITIA7IDATI0(&
AT $/7/CTI0(4$C8//( Y05TP5TZ&
T0P40F4PA%/&
/(,40F4PA%/&
AT 7I(/4$/7/CTI0(&
AT 5$/84C066A(,&
6odulariEation units
,isla! messa"e
then
ro"ram end
and
delete all internal
modes
MESSAGE %.. EXIT CHECC
LEA>E
PROGRAM
LEA>E TO
TRANSACTION
Pro"ram end
(e+trun
7ea'eloo
,isla!
list bu))er[
/+ecute
e'ent
blocks II
/nd current
rocessin" block
and roceed
*ith ne+t
rocessin" block
A8A event blo-(s or mo'ulari<ation units @subroutines0 mo'ulesA are -alle' processin. &loc's.
".e C/ECK 'o&"-_e0p statement .as t.e *ollo+in7 e**e-t)
6utsi"e a loop0 you -an terminate a ,ro-essin7 blo-( ,rematurely. ".e blo-( statements a*ter t.e
&>4&K statement are s(i,,e' i* t.e lo7i-al -on'ition is not *ul*ille'. ".e system t.en -ontinues
+it. t.e *irst statement in t.e ne:t ,ro-essin7 blo-(.
;ithin a loop0 it .as t.e e**e-t t.at t.e ne:t loo, is ,ro-esse'.
".e EKIT statement rea-ts in t.ree 'i**erent +ays)
#it.in ea-. loo,0 loo, ,ro-essin7 is -om,lete' to t.e en'.
3utsi'e o* t.e loo,s0 but +it.in t.e *irst events liste' on t.is sli'e0 t.e system 'is,lays t.e list
bu**er +it. t.e -urrent -ontent. A*ter+ar's0 t.e events o* t.e ot.er 7rou, are tri77ere' an' t.ose
events liste' be*ore START.OF.SELECTION are initiate' at t.e LOAD.OF.PROGRAM event.
At all ot.er ,oints0 EKIT .as t.e same e**e-t as C/ECK.
9sin7 t.e LEA)E PROGRAM or LEA)E TO TRANSACTION t-o'e statements0 you -an terminate
t.e -urrent ,ro7ram.
A*ter a termination messa7e0 t.e system terminates not only t.e -urrent ,ro7ram0 but also t.e entire
pro.ram stac'.
SA A! "A#$0 $9%$$
C.,2
SAP AG 2003
The 6/$$A%/ $tatement2 6essa"e Classes2 and
6essa"es
,e)inition
5se
MESSAGE ID <L"e&&%/e +l%&&M< TYPE <L"e&&%/e $.!eM<
NUM'ER <L"e&&%/e #0"2e,M< .
BC@00
6essa"e short te+t
0@0
0@1
002
Tmessa"e classU
6essa"e class3
6essa"e
The name o) the airline \1 is \2
Airline \1 is not a'ailable
Tmessa"e numberU
Attributes 6essa"es
,
o
u
b
l
e
,
o
u
b
l
e
4 4
c
l
i
c
k
c
l
i
c
k
ID <L ID <L"e&&%/e +l%&& "e&&%/e +l%&&M< M<
NUM'ER <L NUM'ER <L"e&&%/e #0"2e, "e&&%/e #0"2e,M< M<
L"e&&%/e +l%&&M
L"e&&%/e #0"2e,M
L"e&&%/e +l%&&M
L"e&&%/e #0"2e,M
"o tri77er a messa7e 'ialo7 in a ,ro7ram0 enter t.e MESSAGE statement +it. t.e *ollo+in7
a''itions)
ID <L"e&&%/e +l%&&M< *or t.e messa7e -lass
NUM'ER <L#0"2e,M[ *or t.e messa7e number
"o 'is,lay t.e messa7e te:t *or a MESSAGE statement in a ,ro7ramYs sour-e -o'e0 'ouble%-li-( t.e
messa7e number to 7o to t.e asso-iate' messa7e -lass te:ts.
3t.er synta: variants are available *or t.e MESSAGE statement. =or more in*ormation0 re*er to t.e
(ey+or' 'o-umentation *or t.e MESSAGE statement.
SA A! "A#$0 $9%$2
C.,3
SAP AG 2003
$el)4/+lanator! 6essa"es or 6essa"es *ith 7on"
Te+ts
6essa"e class BC@00
$el)4e+lanator!
,e)inition
$hort te+t
Tshort te+tU
Tshort te+tU
(umber
000
001
7on" te+t
7s"ort te8t9
,ia"nosis
Pte"t#
$!stem acti'ities
Pte"t#
Procedure
Pte"t#
Procedure )or s!stem administrator
Pte"t#
7on" te+t
6essa"e class3
(umber
2
1
3 6essa"e is sel)4e+lanator!
There is a lon" te+t
e+lainin" the messa"e
1* a messa7e s.ort te:t -ontains all t.e in*ormation t.e user nee's0 t.e messa7e is 'es-ribe' as sel#)
e(planatory.
!(ample) L".e ,ro7ram .as been save'.L
Sel*%e:,lanatory messa7es are *la77e' as su-. in t.e messa7e -lass.
1* you +ant to ,rovi'e more 'etaile' in*ormation *or t.e user0 you -an 'o so by storin7 a lon7 te:t
+it. t.e messa7e. 1n t.e 0essage 0aintenance s-reen0 t.e Self-Explanatory *la7 in'i-ates +.et.er
or not a messa7e is in'ee' sel*%e:,lanatory. "o 'is,lay t.e lon7 te:t0 sele-t t.e messa7e line an'
-.oose Long %ext. ".e system t.en 'is,lays t.e maintenan-e *ormats. Fou -an 'is,lay t.e *ormatte'
te:t by -.oosin7 Screen Output" Fou usually -reate t.e lon7 te:t *rom a tem,late0 +.i-. -ontains t.e
.ea'in7s 'iagnosis# System Activities# Procedure# an' Procedure for t*e System Administrator" ".e
system 'oes not 'is,lay t.e .ea'in7 to t.e user i* t.ere is no te:t store' un'er it.
SA A! "A#$0 $9%$3
C.,4
SAP AG 2003
6essa"es *ith Placeholders
,e)inition
5se
MESSAGE ID <L"e&&%/e +l%&&M< TYPE <L"e&&%/e $.!eM<
NUM'ER L###M
7ITH Lv%,?M Lv%,2M Lv%,3M Lv%,(M . 7ITH Lv%,?M Lv%,2M Lv%,3M Lv%,(M
T? T2 T3 T(
BC@00
6essa"e short te+t
0#L
0@0
0@1
6essa"e class3
6essa"e
The name o) the airline \1 is \2
Airline \1 is not a'ailable
Attributes 6essa"es
Fou -an in-lu'e u, to *our ,la-e.ol'ers in a messa7e @G$0 G20 G3 an' G4A. Fou -an t.en assi7n
-urrent ,arameters to t.em in t.e M4SSA!4 statement usin7 t.e #1"> a''ition. Fou -an use
literals0 te:t symbols0 or variables. Fou must in-lu'e a s,a-e bet+een ea-. one. ".e -urrent
,arameters are assi7ne' to t.e ,la-e.ol'ers G$0 G20 G30 an' G4 in or'er.
1n t.e lon7 te:t0 t.e ,la-e.ol'ers are 7iven t.e names G;$G0 G;2G0 G;3G0 an' G;4G an'
re,la-e' at run time in or'er0 a--or'in7 to t.e same lo7i-. "o insert a ,la-e.ol'er in t.e lon7 te:t)
la-e your -ursor in t.e te:t +.ere you +ant to insert t.e ,la-e.ol'er.
&.oose Edit?(ommand?+nsert command . ".e system 'is,lays a 'ialo7 bo:. 1n Symols0 enter
G;$G @or G;iG i W 20 3 or 40 as a,,ro,riateA.
&.oose Enter to -on*irm t.e 'ialo7 bo:.
SA A! "A#$0 $9%$4
C.,5
SAP AG 2003
Creatin" 6essa"e Classes and 6essa"es
In the 0b1ect (a'i"ator3
Create usin" )or*ard na'i"ation
MESSAGE ID <L"e&&%/e +l%&&M< TYPE <L"e&&%/e $.!eM<
NUM'ER <L"e&&%/e #0"2e,M< .
6essa"e class a'ailableA
,ouble4click
,ouble4click
Create messa"e class
(o
Create messa"e
;es
L"e&&%/e +l%&&M
L"e&&%/e #0"2e,M
,e'eloment class
DBC@00C12 Create &&&
6essa"e class Pro"rams
&&&
6essa"e classes
DBC@00C6C12
&&&
Chan"e
,isla!
DBC@00C12
(ote3 6essa"es can
be translated& The!
then aear in the
user:s lo"on lan"ua"e&
"o -reate your o+n messa7e -lass0 7ive it a name in t.e -ustomer names,a-e0 t.at is0 a name
be7innin7 +it. F0 V0 or t.e names,a-e ,re*i:.
"o -reate a messa7e0 assi7n a t.ree%'i7it number an' a messa7e -lass to it.
Fou -an -reate bot. t.e messa7e -lass an' t.e messa7e itsel* usin7 *or+ar' navi7ation *rom t.e
MESSAGE statement.
1n t.e 3bHe-t 2avi7ator0 you -an -reate an' e'it a messa7e -lass in any o* t.e *ollo+in7 +ays)
=rom t.e -onte:t menu belon7in7 to t.e root no'e in t.e obHe-t list o* t.e res,e-tive 'evelo,ment
-lass
=rom t.e -onte:t menu belon7in7 to t.e 0essage class no'e in t.e obHe-t list o* t.e a,,ro,riate
'evelo,ment -lass
=rom t.e Ot*er o4ect""" i-on
A 'ialo7 bo: -ontainin7 a tab a,,ears. 1n t.e Ot*er tab0 enter a messa7e -lass0 or a messa7e +it.
its messa7e -lass0 an' t.en 'is,lay0 -reate0 or -.an7e it by -.oosin7 t.e a,,ro,riate i-on.
SA A! "A#$0 $9%$5
C.,6
SAP AG 2003
Colors in 7ists 1
Fli"ht )rom to
AA 001V (/W ;08F $A( F8A(CI$C0
79 0@00 F8A(FF58T (/W ;08F
79 0@02 F8A(FF58T B/87I(
Creation date3 01/01/2001
Created b!3 WITT6A((
REPORT &%!2+())0885eB%"!le5?%.
INCLUDE LLISTM.
:
7RITE: / 4%5&!1l*6+%,,*8 COLOR +l5Ne.:
*+#58%$e AS ICON:
W8IT/ Tdata ob1ectU TotionU &
Colors/Icons/$!mbols in 7ists
Fou -an set several list 'is,lay attributes +it.in a WRITE statement. 3ne su-. attribute is color0
+.i-. -an be a'Huste' usin7 t.e *ormattin7 o,tion COLOR 1n2% Fou -an -.oose *rom seven
ba-(7roun' -olors t.at are a-tivate' by eit.er a numeri- value or a symboli- name.
0 -olOba-(7roun' 8a-(7roun'
$ -olO.ea'in7 >ea'ers
2 -olOnormal 6ist entries
3 -olOtotal "otals
4 -olO(eyKey -olumns
5 -olO,ositive ositive t.res.ol' value
6 -olOne7ative 2e7ative t.res.ol' value
B -olO7rou, &ontrol levels
SA ,rovi'es 7ui'elines *or -reatin7 lists in -olor. lease -onsult transa-tion LIBS *or e:am,les.
#it. t.e .el, o* one more ,arameter o* t.e WRITE statement AS ICON 0 you -an use i-ons in
your list. =or t.is ,ur,ose0 you must in-lu'e t.e 1n-lu'e X61S"J statement in your ,ro7ram.
Fou -an *in' an overvie+ o* all available i-ons in eit.er t.e (ey+or' 'o-umentation un'er WRITE0
or in t.e WRITE statement stru-ture.
SA A! "A#$0 $9%$6
C.,7
SAP AG 2003
P'O PAI
CALL SCREEN ?))
100 P'O PAI
Screen attri$utes
$creen number 100
(e+t screen 100
Screen attri$utes
$creen number 200
(e+t screen 200
200
0
200
0
,!namic $creen $e.uence
Fou -an use t.is te-.niEue to ,ro7ram -lusters o* s-reens +it. -om,li-ate' lin(s +it.out .avin7 to
-ontinually return to t.e sour-e -o'e an' -all t.em usin7 &A66 S&R442.
SA A! "A#$0 $9%$B
C.,8
SAP AG 2003
/+cetions )or Function 6odules
Function module /dit %oto 5tilities /n'ironment $!stem 9el
2unction .uilder Display .!314+2MDD+5ET+2REE+SEATS
Function 2odule BC402_FM_!"#_F$""_S"%#S Active
tables Changing 1xport
Function 2odule docu2entation
I2port Attributes
1xception Short text
Freight carrier
Source code 1xceptions
")#S1ATS
overboo.ed )91%L)AD
RAISE 1e0-ep#"on2.
*** 4*$- 8e1%0l$ "e&&%/e:
MESSAGE 18"nd21n,m2D1"d2E
RAISING 1e0-ep#"on2.
no data D:#FAIL*%1
Fou -an .ave a *un-tion mo'ule tri77er a Raise !(ceptions.
=or t.is ,ur,ose0 you must *irst "e#ine e:-e,tions in t.e inter*a-e 'e*inition0 t.at is0 you must
'e*ine 'istin7uis.able i"enti#iers *or your e:-e,tions.
1n t.e sour-e -o'e0 you ,ro7ram t.e tri..erin. o* an e:-e,tion un'er t.e reEuire'
-on'itions. At runtime0 t.e *un-tion mo'ule e:e-ution is interru,te' i* an e:-e,tion .as
been tri77ere'. &.an7es to E0po# an' C;an&"n& ,arameters .ave t.e same e**e-t as
+it. subroutine -alls. ".ere are t+o statement variants. >ere0 e:-e,tion stan's *or
an e:-e,tion you .ave 'e-lare'0 t.at is0 *or t.e i"enti#ier. De,en'in7 u,on +.et.er t.e e:-e,tion
is -arrie' out +.en t.e *un-tion mo'ule is -alle'0 t.e statements -an .ave 'i**erent e**e-ts.
RAISE 1e0-ep#"on2
1* t.e e:-e,tion is e:e-ute' in t.e -allin7 ,ro7ram0 -ontrol is ,asse' ba-( to t.e same. 3t.er+ise a
runtime error o--urs.
MESSAGE 18"nd21n,m2D1"d2E RAISING 1e0-ep#"on2
1* t.e e:-e,tion is liste' in t.e -allin7 ,ro7ram0 t.is statement -orres,on's to t.e *irst variant. 1* t.e
e:-e,tion is not e:e-ute'0 t.e system 'is,lays a messa7e n,m o* messa7e -lass "d +it. be.avior
8"nd% ".ere*ore0 a runtime error 'oes not o--ur in t.is situation.
SA A! "A#$0 $9%$C
C.,C
SAP AG 2003
7o"ical ,atabases
Pro"ram T!es
Pro"ram T!es
,ata T!es2 ,ata 0b1ects2 and $tatements
,ata T!es2 ,ata 0b1ects2 and $tatements
7o"ical ,atabases
7o"ical ,atabases
Pre'ie*
Pre'ie*
SA A! "A#$0 $9%$9
C.20
SAP AG 2003
$PF7I
/+amle3 7o"ical ,atabase F1$
$F7I%9T
$B00F
8eadin" 7o"icall! ,eendent ,ata
Fou -an use easy%to%use rea' ,ro7rams @lo7i-al 'atabasesA to rea' lo7i-ally -onne-te' 'ata. 4a-.
lo7i-al 'atabase .as a stru-ture -ontainin7 a .ierar-.y o* t.ose tables an' vie+s t.at are to be rea'.
Fou -an atta-. e:a-tly one lo7i-al 'atabase to ea-. ty,e $ ,ro7ram. ".e lo7i-al 'atabase t.en
su,,lies your ,ro7ram +it. entries *rom tables an' vie+s. ".is means t.at you nee' to ,ro7ram t.e
'ata ,ro-essin7 statements only.

SA A! "A#$0 $9%20
C.2,
SAP AG 2003
;ou can attach a lo"ical database to each t!e 1 ro"ram
usin" the ro"ram attributes&
$ecial e'ent blocks are also a'ailable )or rocessin"
indi'idual records&
;ou can attach a lo"ical database to each t!e 1 ro"ram
usin" the ro"ram attributes&
$ecial e'ent blocks are also a'ailable )or rocessin"
indi'idual records&
7o"ical ,atabases
$ecial data collection ro"rams deli'ered b! $AP
Pro'ide !our ro"ram *ith data in a hierarchicall! lo"ical
se.uence
Contain data base accesses that ha'e been otimiEed )or
er)ormance
$ul! a d!namic selection screen
Contain all necessar! authoriEation checks
4a-. lo7i-al 'atabase is an en-a,sulate' 'ata -olle-tion ,ro7ram *or *reEuent 'atabase a--ess.
Database a--ess .as been o,timi<e' usin7 3,en SQ6.
1* you are +or(in7 +it. a lo7i-al 'atabase0 you 'o not nee' a sele-tion s-reen *or user entry0 be-ause
it is -reate' automati-ally.
".e system ,er*orms aut.ori<ation -.e-(s a--or'in7 to t.e SA aut.ori<ation -on-e,t.
SA A! "A#$0 $9%2$
C.22
SAP AG 2003
Pro"ram
NODES &1l*/-$.
GET &1l*/-$ ...
:
$PF7I
$F7I%9T
$B00F
,ata )rom
the 7,B
Controllin" an 7,B )rom Within a Pro"ram
".e NODES L#8eM statement ,er*orms t+o *un-tions)
1t 'e*ines a 'ata obHe-t @a stru-tureA as a table +or( area t.at .as t.e same stru-ture as t.e 'atabase
table. ".is stru-ture is t.en *ille' at run time +it. all t.e 'ata re-or's t.at t.e lo7i-al 'atabase .as
rea' *rom t.e 'atabase an' ma'e available to t.e ,ro7ram.
1t -ontrols t.e e:e-utability o* t.e sele-tion s-reen. ".e sele-tion s-reen +as 'e*ine' in t.e lo7i-al
'atabase s.oul' -ontain only t.ose (ey in*ormation in,ut *iel's t.at t.e ,ro7ram nee's. ".e
NODES statement allo+s you to ensure t.at only in*ormation *rom relevant tables is available to
t.e lo7i-al 'atabase.
6o7i-al 'atabases rea' a--or'in7 to t.eir stru-ture0 t.at is0 *rom to, to bottom. ".e "epth o* 'ata
rea' 'e,en's on a ,ro7ramYs GET statements. ".e 'ee,est !4" statement *rom t.e stru-tural vie+ o*
t.e lo7i-al 'atabase 'etermines t.e level.
SA A! "A#$0 $9%22
C.23
SAP AG 2003
Pro"ram
ABAP
runtime
s!stem
START6OF6SELECTION.
Basic list
GET &!1l*.
GET &1l*/-$.
END6OF6SELECTION.
NODES: SPFLI:
SFLIGHT.
7o"ical
database
$PF7I
$F7I%9T
$B00F
/'ent Blocks in 7o"ical ,atabases
Fou -an in-lu'e a lo7i-al 'atabase in every e:e-utable ,ro7ram @ty,e $A usin7 t.e ,ro7ram
attributes.
4a-. no'e in t.e .ierar-.y o* t.e lo7i-al 'atabase also ,rovi'es you +it. a !4" event blo-( in
a''ition to t.e ot.er event blo-(s @!4" S=610 !4" S=61!>"0 an' !4" S833K in t.e e:am,le in
t.e 7ra,.i-A.
Fou -an ,ro7ram in'ivi'ual re-or' ,ro-essin7 usin7 t.ese !4" event blo-(s.
At run time0 t.e event blo-(s t.at -reate lists are ,ro-esse' in t.e *ollo+in7 or'er)
S"AR"%3=%S464&"132.
!4" S=61 an' !4" S=61!>" are -alle' several times in neste' S464&" lo7i- a--or'in7 to t.e
stru-ture o* t.e lo7i-al 'atabase.
42D%3=%S464&"132 is -alle' a*ter all !4" events0 an' imme'iately be*ore t.e list is sent to t.e
,resentation server
SA A! "A#$0 $9%23
C.24
SAP AG 2003
$TA8T40F4$/7/CTI0(
%/T $PF7I
%/T $F7I%9T
%/T $F7I%9T
%/T $PF7I 7AT/
%/T $PF7I
/(,40F4$/7/CTI0(
,7 1?LL
2B&0P&1LLP
2V&0L&1LLP
,7 1LP@
%/T $F7I%9T
%/T $F7I%9T
%/T $PF7I 7AT/
2B&0P&1LLP
2V&0L&1LLP
%/T $F7I%9T 2L&0L&1LLP
REPORT 2+())85l/*+%l58%$%2%&e.
NODES: &!1l*: &1l*/-$.
START6OF6SELECTION.
7RITE: / <START6OF6SELECTION<
+l, 3.
GET &!1l* FIELDS +%,,*8 +##*8.
7RITE: / <GET SPFLI< +l, ?:
&!1l*6+%,,*8:
&!1l*6+##*8.
GET &1l*/-$ FIELDS 1l8%$e.
7RITE: / <GET SFLIGHT< +l, 2:
&1l*/-$61l8%$e.
GET &!1l* LATE.
7RITE :/ <GET SPFLI LATE<.
END6OF6SELECTION.
7RITE: <END6OF6SELECTION<
+l, 3.
$!nta+ /+amle3 /'ent $e.uence
%/T s)li
%/T s)li"ht
%/T s)li 7AT/&
At run time0 t.e event blo-(s t.at -reate lists are ,ro-esse' in t.e *ollo+in7 or'er)
S"AR"%3=%S464&"132.
!4" s,*li) ".e *irst 'ata re-or' *rom 'atabase table S=61 t.at -orres,on's to t.e sele-tion
-riteria is ,la-e' in +or( area s,*li an' t.e event blo-( is ,ro-esse'.
!4" s*li7.t) ".e *irst 'ata re-or' *rom S=61!>" t.at -orres,on's to t.e sele-tion -riteria as +ell
as to t.e (ey o* t.e -urrent S=61 re-or' are ,la-e' in +or( area s*li7.t an' t.e event blo-( is
,ro-esse'.
!4" s*li7.t) ".e ne:t 'ata re-or' *rom 'atabase table S=61!>" is ,la-e' into +or( area s*li7.t
an' t.e event blo-( is ,ro-esse' a7ain.
!4" s*li7.t) ".is is -alle' a7ain until no *urt.er -orres,on'in7 'ata re-or's are *oun'.
!4" s,*li 6A"4 is -alle' be*ore t.e ne:t 'ata re-or' *rom S=61 is ,la-e' into +or( area s,*li.
!4" s,*li) ".e lo7i-al 'atabase ,la-es t.e ne:t -orres,on'in7 'ata re-or' *rom S=61 in +or(
area s,*li.
42D%3=%S464&"132 is -alle' imme'iately be*ore t.e list is 'is,laye'.
SA A! "A#$0 $9%24
C.25
SAP AG 2003
ABAP3 ABAP3 Pro"ram attributes Pro"ram attributes
7o"ical ,atabase
Alication $
F1$
T!e 1
NODES :&!1l*: &1l*/-$.
START6OF6SELECTION.
7RITE: / <START6OF6SELECTION<
+l, 3.
GET &!1l* FIELDS +%,,*8 +##*8.
7RITE: / <GET SPFLI< +l, ?:
&!1l*6+%,,*8:
&!1l*6+##*8.
GET &1l*/-$ FIELDS 1l8%$e.
7RITE: / <GET SFLIGHT< +l, 2:
&1l*/-$61l8%$e.
GET &!1l* LATE.
7RITE :/ <GET SPFLI LATE<.
END6OF6SELECTION.
7RITE: <END6OF6SELECTION<
+l, 3.
$PF7I $PF7I
$F7I%9T $F7I%9T
$B00F $B00F
Attributes
$ummar!
GET &!1l*
GET &1l*/-$
GET &!1l* LATE.
(0,/$
6o7i-al 'atabases are in-lu'e' in ty,e $ ,ro7rams as ,ro7ram attributes. 3nly one lo7i-al 'atabase
-an be use' *or ea-. ,ro7ram.
Fou -an su,,ly a lo7i-al 'atabase +it. t.e in*ormation re7ar'in7 +.i-. *iel's you nee' *rom t.e
'atabase usin7 t.e !4" a''ition =146DS. 1* t.e lo7i-al 'atabase su,,orts t.is a-tion0 it +ill rea'
*rom t.e 'atabase only t.ose *iel's you reEuire.
1*0 *or your list0 you nee' 'atabase table 'ata t.at is not su,,lie' by your lo7i-al 'atabase0 you -an
,ro7ram any a''itional 'atabase a--ess nee'e' usin7 S464&".
SA A! "A#$0 $9%25
C.26
SAP AG 2003
Pre'ie*
Pro"ram T!es
Pro"ram T!es
,ata T!es2 ,ata 0b1ects2 and $tatements
,ata T!es2 ,ata 0b1ects2 and $tatements
7o"ical ,atabases
7o"ical ,atabases
Pre'ie*
Pre'ie*
SA A! "A#$0 $9%26
C.27
SAP AG 2003
$e.uential
Files
$AP
Inter)aces /
Checks
/+ternal
$er'er
/+ternal ,ata Trans)er I
#.en you trans*er 'ata *rom anot.er SA or e:ternal system to your o+n SA system0 it is
im,ortant to ensure 'ata inte7rity.
".us0 it is ne-essary to subHe-t t.is ty,e o* 'ata trans*er to t.e same -.e-(s as 'ata trans*er in 'ialo7
mo'e.
Sin-e 'ialo7 mo'e -.e-(s in transa-tions are -om,re.ensive an'0 in ,art0 'one on a -ross%a,,li-ation
basis0 it is e:tremely 'i**i-ult to ,ro7ram t.em yoursel*.
".ere*ore0 it is mu-. easier to use t.e online -.e-(s ,rovi'e' *or SA transa-tions be-ause t.ese
SA transa-tions are use' also *or t.e 'ata trans*er.
".e te-.niEues use' *or e:ternal 'ata trans*er are -alle' &atch)input processes.
SA o**ers stan'ar'i<e' ,ro-e'ures *or e:ternal 'ata trans*er *or many areas +it.in R/3. ".ese
,ro-e'ures use t.ese ,ro7rammin7 te-.niEues) bat-. in,ut0 -all transa-tion0 an' 'ire-t in,ut. ".e
SA stan'ar' 'ata trans*er ,ro-e'ures are -alle' usin7 t.e >ata Trans#er ;or'&ench @transa-tion
S5DAA. 1* no SA 'ata trans*er ,ro-e'ures are available0 trans*er -an be ,ro7ramme' in'ivi'ually
usin7 bat-. in,ut or -all transa-tion.
SA A! "A#$0 $9%2B
C.28
SAP AG 2003
$e.uential
)ile
Gueue )ile
$AP
database
Alication )unction
Alication )unction
Batch inut )unction
Batch inut )unction
B,C table
B,C B,C table table
BATC9 I(P5T3 BATC9 I(P5T3
$e.uential
)ile
$AP
database
Alication )unction
Alication )unction
B,C table
B,C B,C table table
CA77 T8A($ACTI0(3 CA77 T8A($ACTI0(3
CA77
T8A($ACTI0(
$e.uential
)ile
$AP
database
,I8/CT I(P5T3 ,I8/CT I(P5T3
$AP
trans)er
ro"ram
/+ternal ,ata Trans)er II
SA A! "A#$0 $9%2C
C.2C
SAP AG 2003
5date rocess
UPDATE UPDATE INSERT INSERT DELETE DELETE
,ialo" rocess
7o" 7o"
table table
,/7/T/ re.&
5P,AT/ re.&
I($/8T re.&
,atabase rocess
PB0 PAI PB0 PAI PAI PB0
INSERT
ReJ0e&$
UPDATE
ReJ0e&$
DELETE
ReJ0e&$
C066IT W08F C066IT W08F
5date
Anot.er +ay o* bun'lin7 'atabase -.an7es at t.e en' o* an SA 69# is to use t.e u,'ate te-.niEue.
>ere0 you 'o not ,ass u,'ates 'ire-tly to t.e 'atabase0 but enter t.em as u,'ate reEuests in a lo7
table instea'.
9sin7 t.e A8A statement COMMIT WORK0 you en' SA 69# in 'ialo7 mo'e. ".e SA system
t.en tri77ers a s,e-ial +or( ,ro-ess -alle' an u,'ate +or( ,ro-ess t.at0 base' u,on your lo7 entries0
e:e-utes t.e a-tual -.an7es to t.e 'atabase +it.in a 'atabase transa-tion. ".e SA 69# en's only
+.en t.e u,'ate ,ro-ess .as *inis.e'.
".e ,ro7ram ,art in t.e 'ialo7 an' u,'ate ,ro-ess -an run eit.er syn-.ronously or asyn-.ronously.
".e a'vanta7e o* u,'ate in -ontrast to bun'lin7 usin7 subroutines is t.at you -an store t.e 'ata *or
t.e 'atabase -.an7e in t.e lo7 table at any time an' 'o not .ave to (ee, it in t.e ,ro7ram +or( area.
1ts 'isa'vanta7e lies in t.e e**ort reEuire' *or a''itional lo77in7.
9se asyn-.ronous u,'ate +.en res,onse times are im,ortant an' t.e 'atabase u,'ates are
-om,li-ate' enou7. t.at t.ey Husti*y t.e e:tra +or( involve' in usin7 t.e lo7 table.
9se syn-.ronous u,'ate +.enever you nee' t.e -.an7e' 'ata imme'iately an' +.en t.e 'atabase
u,'ates are -om,li-ate' enou7. to Husti*y t.e e:tra +or( involve' in usin7 t.e lo7 table.
SA A! "A#$0 $9%29

You might also like