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

SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs: Contents
Different types of user dialog:
Lists with details lists
Selection screens
User messages
Screens
Designing Interfaces with the Menu Painter
Titles
Menu bars
Standard toolbars
Application toolbars

SAP AG BC400 4.0 ABAP Workbench Basics 91
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs: Unit Objectives
Create lists selection screens and screens
and learn !ore about their uses
Progra! user !essages
Create interfaces using the Menu Painter
"t the conclusion of this unit you will be able to:

SAP AG BC400 4.0 ABAP Workbench Basics 92
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens

SAP AG BC400 4.0 ABAP Workbench Basics 9!
SAP Australia 12 October 1998 BC400

SAP AG
R
%he R&' Client&$erver "rchitecture
"pplication
Presentation
Database


"("P "("P


"("P "("P
"his unit intro#uces the $arious t%&es o' user #ialo(.

SAP AG BC400 4.0 ABAP Workbench Basics 94
SAP Australia 12 October 1998 BC400

SAP AG
R
Overview
Develop!ent object )dit *oto $yste! +elp
SAP R/3 SAP R/3

Flight ino
Interface
$tatus bar
$creen objects
All )in#o)s in user #ialo( ha$e an inter'ace an# a status bar.
"he screen area can contain a screen* a selection screen* or a list.
+rror #ialo(s are another t%&e o' user #ialo(. "he% a&&ear either in the status bar or as a #ialo( bo,.

SAP AG BC400 4.0 ABAP Workbench Basics 9-
SAP Australia 12 October 1998 BC400

SAP AG
R
User Dialogs
$election screens
$creens
#ists
User dialogs
"here are three #i''erent t%&es o' screen ob.ects/
Lists out&ut #ata
Selection screen allo) %ou to or(anise #ata in a co0&le, 0anner so as to 'acilitate subse1uent #ata
selection
Screens are use# 'or both #ata entr% an# #ata #is&la%. "he 0ain stren(th o' a screen is its link to ABAP
2ictionar% technolo(%. "his allo)s %ou to check the consistenc% o' #ata entere# b% the user.

SAP AG BC400 4.0 ABAP Workbench Basics 93
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs , #ists
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens
At the conclusion o' this &art o' the #ialo( unit* %ou )ill be able to/
Create a list )ith colors an# icons
Create a si0&le interacti$e list

SAP AG BC400 4.0 ABAP Workbench Basics 94
SAP Australia 12 October 1998 BC400

SAP AG
R
#ists
C" ID PRIC)
"" -./- -0//
"" -./- -1//

%otal 23//
$creen $creen
Printer Printer
Multilingual Multilingual
capability capability
yes
ja
4ui
si
"he 0ain &ur&ose o' a list is to out&ut #ata in a 0anner that can be easil% un#erstoo# b% the user5 this out&ut
o'ten takes on the 'or0 o' a table. 6ists in 78! take into account s&ecial business #ata re1uire0ents/
"he% are lan(ua(ein#e&en#ent. "e,ts an# hea#ers a&&ear in the lo(on lan(ua(e )hene$er the
a&&ro&riate translation is a$ailable.
"he% can out&ut 0onetar% $alues in nu0erous currencies.
9ou can out&ut list #ata in the 'ollo)in( )a%s/
to the screen5 here %ou can a## colors an# icons
to the &rinter
to the :nternet8intranet/ Auto0atic con$ersion to ;"<6
%ou can also sa$e lists in the 78! S%ste0 or out&ut the0 'or &rocessin( b% e,ternal co00ercial so't)are
a&&lications like s&rea#sheet &ro(ra0s

SAP AG BC400 4.0 ABAP Workbench Basics 98
SAP Australia 12 October 1998 BC400

SAP AG
R
#ist Operations
(ac5&)6it&Cancel
$croll
Print
7ind 8in #ist9
$ave
:
#ist
:
$yste! :::
"he stan#ar# list inter'ace o''ers the user se$eral na$i(ation 'eatures/
Back
+,it
Cancel
Print
=in# >in 6ist?
Sa$e/ sa$es the list either as a 'ile* in a re&ort tree* or to the bu''er
Sen#/ sen#s the list in e0ail 'or0
=or 'urther in'or0ation on ho) %ou can a#.ust the stan#ar# list inter'ace to 'it %our in#i$i#ual nee#s see
2ialo(s :nter'ace.

SAP AG BC400 4.0 ABAP Workbench Basics 99
SAP Australia 12 October 1998 BC400

SAP AG
R
#ist header
Colu!n header
$ave
:
#ist
:
$yste! ::: %e6t ele!ents
%itle&+eaders
7ro! within a list: 7ro! the "("P )ditor:
Page +eaders
+ach list can ha$e a list hea#er an# u& to 'our lines o' colu0n hea#ers. "hese can be create# in one o' the
'ollo)in( )a%s/
'ro0 )ithin the +#itor usin( the te,t ele0ent 0aintenance 'unctions
'ro0 )ithin the list itsel'. :' %ou sa$e %our &ro(ra0 an# then run it to create the list* %ou can enter both list
an# colu0n hea#ers b% choosin( the 0enu &ath System -> List -> List headers. "he 0ain a#$anta(e o'
usin( this 0etho# is that the list is still #is&la%e# on the screen. "his 0akes it easier to &osition colu0n
hea#ers.
"he ne,t ti0e %ou start the &ro(ra0* the ne) hea#ers )ill a&&ear in the list auto0aticall%.
When no hea#er te,t is entere#* the &ro(ra0 title is inserte# in the hea#er.

SAP AG BC400 4.0 ABAP Workbench Basics 910
SAP Australia 12 October 1998 BC400

SAP AG
R
REPORT bc400_list_text.
:
SKIP 2.
WRITE: /15 text-001,
35 sy-!t"#,
/15 text-002,
35 sy-"$!#e.
REPORT bc400_list_text.
:
SKIP 2.
WRITE: /15 text-001,
35 sy-!t"#,
/15 text-002,
35 sy-"$!#e.
$ource code %e6t ele!ents
%itle&+eaders
Progra!
%e6t sy!bols
); Creation Date
D) )rstellungsdatu!
7R :::
); Creation Date
D) )rstellungsdatu!
7R :::
:
); Created by
//<
//-
#ist header
Creation date: /<&/<&<==3
Created by: >I%%M";;
Multilingual Capability
Titles and headers are &art o' a &ro(ra0@s te,t ele0ents. 9ou can translate all te,t ele0ents into other
lan(ua(es. "he lo(on lan(ua(e settin( on the lo(on screen #eter0ines in )hich lan(ua(e te,t ele0ents )ill be
#is&la%e#. "his 'eature is es&eciall% use'ul 'or lar(e international cor&orations.
"e,t s%0bols are another kin# o' text element. "hese are s&ecial te,t literal #ata ob.ects. Co0&are# to nor0al
te,t literals* te,t s%0bols ha$e the a#$anta(e that the% can be translate# into #i''erent lan(ua(es )ithout ha$in(
to chan(e a &ro(ra0@s source co#e. "e,t s%0bols allo) %ou to create lists in#e&en#ent o' lan(ua(e.
9ou can )rite te,t s%0bols into %our &ro(ra0 in either o' the 'ollo)in( )a%s/
- TEXT-<xxx> >)here ,,, is a character strin( three characters lon(?
- 'string' (<xxx>).

SAP AG BC400 4.0 ABAP Workbench Basics 911
SAP Australia 12 October 1998 BC400

SAP AG
R
Colors in #ists <
7light fro! to
"" //<2 ;)> ?OR@ $"; 7R";CI$CO
#+ /0// 7R";@7UR% ;)> ?OR@
#+ /0/- 7R";@7UR% ()R#I;

Creation data: /<&/<&<==3
Created by: >I%%M";;
REPORT s!%bc400"_ex!#%le_1!.
I&'()*E +(IST,.
:
WRITE: / -!_s%.li-c!//i 'O(OR c0l_1ey,
ic0$_!te 2S I'O&,
WRITE Adata objectB AoptionB :
Colors&Icons&$y!bols in #ists
9ou can set se$eral list #is&la% attributes )ithin a W7:"+ state0ent. One such attribute is color* )hich can be
a#.uste# usin( the 'or0attin( o&tion CO6O7 AnB. 9ou can choose 'ro0 se$en back(roun# colors that are
acti$ate# b% either a nu0eric $alue or a s%0bolic na0e base# on )here the% a&&ear on a nor0al list.
0 COL_BACKGROUND Back(roun#s
1 COL_HEADING ;ea#ers
2 COL_NORAL 6ist entries
! COL-TOTAL "otals
4 COL_KE! Ce% colu0ns
- COL-"O#ITI$E Positi$e threshol# $alues
3 COL_NEGATI$E De(ati$e threshol# $alues
4 COL_GROU" Control le$els
SAP &ro$i#es (ui#elines 'or creatin( lists in color. Please consult transaction LIB# 'or e,a0&les.
"he a##ition A# ICON )ithin a %RITE state0ent allo)s %ou to a## icons to %our list. :n or#er to be able to
use A# ICON %ou 0ust* ho)e$er* a## the inclu#e <LI#T> to %our &ro(ra0.
9ou can 'in# an o$er$ie) o' all a$ailable icons in either the ke%)or# #ocu0entation un#er %RITE* or in the
%RITE state0ent structure.

SAP AG BC400 4.0 ABAP Workbench Basics 912
SAP Australia 12 October 1998 BC400

SAP AG
R
#ists in )6ecutable Progra!s
Progra!
"("P
runti!e
syste!


ST2RT-O3-SE(E'TIO&.
WRITE ...
SKIP.
)(I&E.
#ist buffer
(asic list
:n e,ecutable &ro(ra0s >t%&e 1?* lists are auto0aticall% #is&la%e# a'ter their corres&on#in( e$ent blocks ha$e
been &rocesse# )hene$er these e$ent blocks contain a state0ent that (enerates a list. "hese are %RITE #KI"
an# ULINE.
+$ent blocks are calle# in a se1uence #esi(ne# 'or list &rocessin(/
Prior to sen#in( the selection screen/ INITIALI&ATION
A'ter lea$in( the selection screen/ #TART-O'-#ELECTION
All out&ut 'ro0 #TART-O'-#ELECTION e$ent blocks* subroutines* an# 'unction 0o#ules that is &rocesse#
be'ore a list is #is&la%e# is te0&oraril% store# in the list bu''er.
Once all list creation &rocessin( blocks >'or e,a0&le #TART-O'-#ELECTION? ha$e been &rocesse#* all #ata
'ro0 the list bu''er is out&ut in the 'or0 o' a list.

SAP AG BC400 4.0 ABAP Workbench Basics 91!
SAP Australia 12 October 1998 BC400

SAP AG
R
Details #ists
Progra!
"("P
runti!e
syste!


ST2RT-O3-SE(E'TIO&.
WRITE ...
SKIP.
)(I&E.
#ist buffer
2T (I&E-SE(E'TIO&
WRITE ...
SKIP.
)(I&E.
(asic list
Details list
Details list
buffer
:n e,ecutable &ro(ra0s* %ou can use the e$ent block AT LINE-#ELECTION to create #etails lists.
"he ABAP runti0e s%ste0/
2is&la%s basic lists a'ter the a&&ro&riate e$ent blocks ha$e been &rocesse# >'or e,a0&le* a'ter #TART-O'-
#ELECTION?. :n this case* s%ste0 'iel# s(-)sin* contains the $alue 0.
:nserts those 'unction co#es assi(ne# to the 0enu 'unctions an# icons o' a &articular GE: status in 'iel# s(-
+,-.. )hen a corres&on#in( user entr% is 0a#e. "here is a stan#ar# status 'or lists. "o 'in# out ho) to re&lace
this stan#ar# status )ith a status %ou ha$e #e'ine# %oursel'* re'er to the &art o' this unit on inter'aces.
Processes the e$ent block AT LINE-#ELECTION usin( the 'unction co#e '"ICK' each ti0e %ou #ouble
click on an entr% or choose an action 'or the s%ste0 to &er'or0. :' %ou are usin( a stan#ar# status* this ha&&ens
auto0aticall% e$er% ti0e %ou choose an icon* a 0enu 'unction* or the 'unction ke% =2.
2is&la%s #etails lists a'ter the AT LINE-#ELECTION e$ent block has been &rocesse# an# increases the $alue
containe# in s(-)sin* b% one.
2is&la%s the #etails list 'ro0 the &re$ious le$el in the list hierarch% >n1? e$er% ti0e %ou choose the (reen arro)
icon 'ro0 the current #etails list >n?.

SAP AG BC400 4.0 ABAP Workbench Basics 914
SAP Australia 12 October 1998 BC400

SAP AG
R
)6a!ple: " $i!ple Details #ist
(asic list
Details list <
De!onstration Progra! :::
!asic List !asic List
sy-lsi$ "

Details #ist Details #ist
sy-"c0##
sy-lsi$

Details list - Details #ist Details #ist
sy-"c0##
sy-lsi$

Up to twenty details lists
P#$%
&
P#$%
'
"he lists in the e,a0&le &ro(ra0 shoul# 'unction as 'ollo)s/
"he basic list shoul# #is&la% the te,t FBasic 6istF an# s%ste0 'iel# s(-)sin*.
"he user shoul# be able to call the initial #etails list usin( a #oubleclick or b% choosin( its corres&on#in(
icon 'ro0 the a&&lication toolbar or its 0enu entr% or b% usin( the 'unction ke% =2. "his list shoul# #is&la%
the te,t F2etails 6istF an# s%ste0 'iel#s s%uco00 )ith $alue '"ICK' an# s%lsin# )ith $alue 1.
7e&eatin( this action shoul# call the secon# #etails list* )here s%ste0 'iel# s%uco00 once a(ain contains
the $alue '"ICK' but s%lsin# contains the $alue 2 instea# >re&resentin( the current #etails list le$el?.
7e&eatin( the action shoul# consecuti$el% increase s%lsin#Fs $alue b% one u& to a $alue o' t)ent% >the total
nu0ber o' #etails lists su&&orte#?.
Choosin( the (reen arro) takes the user back a sin(le #etails list le$el at a ti0e until the basic list is
reache#.

SAP AG BC400 4.0 ABAP Workbench Basics 91-
SAP Australia 12 October 1998 BC400

SAP AG
R
$ynta6: " $i!ple Details #ist
REPORT s!%bc400"_sec0$!/y_list_!.
ST2RT-O3-SE(E'TIO&.
WRITE: / text-001 'O(OR c0l_4e!i$5,
/ 6sy-lsi$6,
sy-lsi$ c0l0/ 2.
2T (I&E-SE(E'TIO&.
WRITE: / text-002 'O(OR c0l_4e!i$5.
)(I&E.
WRITE: / 6sy-"c0##6,
sy-"c0## c0l0/ 3,
/ 6sy-lsi$6,
sy-lsi$ c0l0/ 4.
%e6t sy!bols:
//<
//-
(asic list
Details list
A #etails list can be &ro(ra00e# in the 'ollo)in( )a%/
9ou create a basic list b% 'illin( the basic list bu''er at an a&&ro&riate e$ent block > here #TART-O'-
#ELECTION? usin( either %RITE/ #KI"* or ULINE.
Ese the e$ent block AT LINE-#ELECTION )hen &ro(ra00in( #etails lists. Whene$er %ou use %RITE/
#KI"* or ULINE )ith this e$ent block* %ou 'ill the #etails list bu''er 'or the ne,t le$el >the #etails list
bu''er )ith a le$el $alue one (reater than the le$el on )hich the user &er'or0e# his or her action?.
9ou can &re#eter0ine na$i(ation bet)een #etails lists b% 1uer%in( s%ste0 'iel# s(-)sin* at the e$ent
block AT LINE-#ELECTION.

SAP AG BC400 4.0 ABAP Workbench Basics 913
SAP Australia 12 October 1998 BC400

SAP AG
R
Details #ist: )6a!ple
Flight From To (eparting at Flight From To (eparting at
L) "*"" FRA Fran+urt ,F% -ew .or+ &"/&"/""
L) "*"' FRA Fran+urt ,F% -ew .or+ &3/3"/""
000
S1 """' S#- Singapore SF2 San Francisco "3/3"/""

.ou ha4e chosen light L) "*"'
%i!etable %i!etable
7light Details 7light Details
Flight date
&'/&3/&335
&'/'"/&335
&'/'*/&335
Ma60
35"
35"
35"
2cc0
'*"
'7"
35"
We )ill no) )rite a &ro(ra0 usin( both basic lists an# #etails lists/
"he basic list in %our &ro(ra0 shoul# contain 'li(ht #ata such as carrier :2 an# 'li(ht nu0bers* #e&arture
cit% an# air&ort* #estination cit% an# air&ort* as )ell as #e&arture an# arri$al ti0es. "his #ata can be 'oun#
in the #atabase table #"'LI.
"he user shoul# be able to access in'or0ation about an% &articular 'li(ht b% #oubleclickin( its carrier :2
an# 'li(ht nu0ber. =li(ht #ate an# occu&anc% shoul# be #is&la%e#. "his #ata can be 'oun# in the #atabase
table #'LIGHT. 9ou 0ust use the #"'LI ke% 'iel#s in this #etails list in or#er to rea# the a&&ro&riate #ata
in #'LIGHT. "he 'ollo)in( sli#es #e0onstrate ho) this is #one.
"he e,a0&le &ro(ra0 is na0e# #A"BC011UDD_EXA"LE_2 an# is &art o' #e$elo&0ent class #A"BC011.

SAP AG BC400 4.0 ABAP Workbench Basics 914
SAP Australia 12 October 1998 BC400

SAP AG
R
+ID) "reas
REPORT s!%bc400"_ex!#%le_2.
...
ST2RT-O3-SE(E'TIO&.
SE(E'T 7 3RO8 s%.li I&TO -!_s%.li.
WRITE:/ -!_s%.li-c!//i, -!_s%.li-c0$$i,
-!_s%.li-!i/%./0#, -!_s%.li-!i/%t0,
-!_s%.li-e%ti#e.
9I*E: -!_s%.li-c!//i, -!_s%.li-c0$$i.
E&*SE(E'T.
+ID) area
9I*E Adata objectB.
(asic list buffer
L) "*"" FRA ,F% &"/&"/""
L) "*"' FRA ,F% &3/3"/""
000
S1 """' S#- SF2 "3/3"/""

#ine
:::
1
.
:::
<<
#ine
:::
1
.
:::
<<
-!_s%.li-
c!//i
:::
#+
#+
:::
$C
-!_s%.li-
c0$$i
:::
/0//
/0/-
:::
///-
When the e$ent AT LINE-#ELECTION is &rocesse#* a &ro(ra0@s #ata ob.ects contain the sa0e $alues as
be'ore basic list #is&la%. A #etails list* ho)e$er* o'ten nee#s #ata selecte# )ithin the basic list itsel'. 9ou can
use the HIDE area to store certain #ata 'ro0 the line that %ou ha$e selecte# an# then auto0aticall% insert )here
%ou nee# it in the corres&on#in( #ata ob.ect 'or a #etails list.
9ou can &re#eter0ine )hich in'or0ation shoul# be classi'ie# b% its line &osition )hen %ou are creatin( a basic
list.
"o #o this* %ou use the ABAP ke%)or# HIDE 'ollo)e# b% a list o' the #ata ob.ects that %ou nee#. "he runti0e
s%ste0 auto0aticall% recor#s the na0e an# contents o' the #ata ob.ect in relation to its line &osition in the list
currentl% bein( create#.

SAP AG BC400 4.0 ABAP Workbench Basics 918
SAP Australia 12 October 1998 BC400

SAP AG
R
#ine $election
REPORT s!%bc400"_ex!#%le_2.
2T (I&E-SE(E'TIO&.
WRITE: text-001,
-!_s%.li-c!//i,
-!_s%.li-c0$$i.
Flight From To (eparting at
L) "*"" FRA ,F% &"/&"/""
L) "*"' FRA ,F% &3/3"/""
000
S1 """' S#- SF2 "3/3"/""

+ID) area
#ine
:::
1
.
:::
<<
-!_s%.li-c!//i
:::
#+
#+
:::
$C
-!_s%.li-c0$$i
:::
/0//
/0/-
:::
///-
-!_s%.li #+ /0/- DD DD DD DD
%e6t sy!bols:
//< 7lights for connection
As soon as an interacti$e e$ent >AT LINE-#ELECTION in this e,a0&le? is calle# b% &lacin( the cursor on a
s&eci'ic line an# then either #oubleclickin( or choosin( a &ushbutton* the $alues 'or this line store# in the
HIDE area are inserte# into the corres&on#in( #ata ob.ects.

SAP AG BC400 4.0 ABAP Workbench Basics 919
SAP Australia 12 October 1998 BC400

SAP AG
R
#ine $election: $ynta6
REPORT s!%bc400"_ex!#%le_2.
...
2T (I&E-SE(E'TIO&.
WRITE: text-001,
-!_s%.li-c!//i,
-!_s%.li-c0$$i.
SE(E'T .l!te se!ts#!x se!ts0cc
3RO8 s.li54t
I&TO 'ORRESPO&*I&: 3IE(*S O3 -!_s.li54t
W9ERE c!//i ; -!_s%.li-c!//i
2&* c0$$i ; -!_s%.li-c0$$i.
WRITE:/ -!_s.li54t-.l!te,
-!_s.li54t-se!ts#!x,
-!_s.li54t-se!ts0cc.
E&*SE(E'T.
%e6t sy!bols:
//< 7lights for connection

SAP AG BC400 4.0 ABAP Workbench Basics 920
SAP Australia 12 October 1998 BC400

SAP AG
R
"dvanced %echni4ues: #ists as Input %ools and
Details #ists in Dialog (o6es
"" //<2
"" //-.
"" //.0
D# <.==
"" //<2
"" //-.
"" //.0
D# <.==
E
E
"" //<2
"" //-.
"" //.0
D# <.==
/=&<=&=3 ''/ '//
</&-<&=3 ''/ -2'
:n a##ition to bein( a $er% e''ecti$e out&ut tool* lists can also be use# as li0ite# in&ut tools 'or certain kin#s o'
user #ialo(. :n&ut is* ho)e$er* not auto0aticall% checke# as it is in a nor0al screen.
2etails lists can also be #is&la%e# in #ialo( bo,es. "his is o'ten the case )ith &ossible $alues hel&.
9ou can use the ABAP +#itor to chan(e lists that ha$e alrea#% been create#.

SAP AG BC400 4.0 ABAP Workbench Basics 921
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs , $election $creens
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens

SAP AG BC400 4.0 ABAP Workbench Basics 922
SAP Australia 12 October 1998 BC400

SAP AG
R
(7 )7
*et all records fro! database
table where airline na!e is
between #E and UE 8inclusive9
$election $creens
Selection screens allo) users to enter selection criteria re1uire# b% the &ro(ra0.
=or e,a0&le* i' %ou create a list containin( #ata 'ro0 a $er% lar(e #atabase table* %ou can use a selection screen
to restrict the a0ount o' that #ata that is selecte#. At runti0e* the user can enter inter$als 'or one o' the ke%
'iel#s* an# onl% #ata in this inter$al is rea# 'ro0 the #atabase an#
#is&la%e# in the list. "his consi#erabl% re#uces the loa# on the net)ork.

SAP AG BC400 4.0 ABAP Workbench Basics 92!
SAP Australia 12 October 1998 BC400

SAP AG
R
Selection ranges Selection ranges
%he $election $creen
Multilingual Multilingual
yes
ja
4ui
si
::: :::
8ariants 8ariants
Search helps Search helps
T9pe chec+s T9pe chec+s
Selection screens are #esi(ne# to &resent users )ith an in&ut te0&late allo)in( the0 to enter selections* )hich
re#uce the a0ount o' #ata that has to be rea# 'ro0 the #atabase.
As )ell as si0&le in&ut 'iel#s* selection screens also &ro$i#e $arious )a%s o' enterin( 0ore co0&le,
selections* )hich can then easil% be anal%Ge#.
9ou can also create $ariants 'or selection screens* )hich %ou can store an# recall later.
:' an in&ut 'iel# re'ers to an ABAP 2ictionar% 'iel#* the user can call the search hel& store# 'or it in the
2ictionar% b% &ressin( =4.
9ou can translate the selection te,ts into other lan(ua(es so that the% are then #is&la%e# in the lan(ua(e in
)hich the user is lo((e# on.
"he s%ste0 checks t%&es auto0aticall%. :' %ou enter a $alue )ith an incorrect t%&e* the s%ste0 #is&la%s an error
0essa(e an# 0akes the 'iel# rea#% to acce&t %our correcte# entr%.

SAP AG BC400 4.0 ABAP Workbench Basics 924
SAP Australia 12 October 1998 BC400

SAP AG
R
)ntering $elections
SE(E'T-OPTIO&S ...
P2R28ETERS ...
Departing fro!
"irline carrier #+ to
$I*;
I
OP%IO;
*)
#O>
#+
7luggesellschaft
$ingle value
*reater than or e4ual
*reater than
#ess than
;ot e4ual
Select
:6clude rom selection
Maintain $election Options Maintain $election Options
"irline carrier
Less than or e;ual Less than or e;ual
Multiple single values
Intervals
$ingle value e6clusion
Interval e6clusion
000
Selection screens allo) %ou to enter co0&le, selections as )ell as sin(le$alue selections. =unctions o' selection
o&tions &ro(ra00in( inclu#e/
Settin( selection o&tions
+nterin( 0ulti&le $alues or inter$als
2e'inin( a set o' e,clusionar% criteria 'or #ata selection
+$er% selection screen contains an in'or0ation icon. Choose this icon to #is&la% a##itional in'or0ation.

SAP AG BC400 4.0 ABAP Workbench Basics 92-
SAP Australia 12 October 1998 BC400

SAP AG
R
$earch +elp
"irline carrier
$uchhilfe $uchhilfe
A!AP (ictionar9
Search help
7light no: to
*2T2: -! (IKE s%.li.
P2R28ETERS %!_c!// (IKE s%.li-c!//i.
SE(E'T-OPTIO&S s0_c0$$ 3OR -!-c0$$i.
-o0
/0//
/0/-
(epart0
airport
7R"
7R"
Arri40
airport
F7@
F7@
(epart0
time
</:</://
<':'/://
#(
#+
#+
$hec+ table
(ata element
Table ield
Structure ield
:' %ou re'er an in&ut 'iel# to an ABAP 2ictionar% ob.ect to )hich a search hel& is assi(ne#* the s%ste0
auto0aticall% &ro$i#es the corres&on#in( &ossible $alues hel&.
9ou can a#a&t the &ossible $alues hel& to 0eet %our o)n re1uire0ents b% #e'inin( a search hel& in the ABAP
2ictionar%.

SAP AG BC400 4.0 ABAP Workbench Basics 923
SAP Australia 12 October 1998 BC400

SAP AG
R
Gariants
Departing fro!
000
Departing fro!
"irline carrier
DE #E
to
Gariant carrierHdHtoHl:
"irlines DE to #E
+ide input field
9ou can #e'ine an# store $ariants 'or an% selection screen. 9ou #o this b% startin( the &ro(ra0 an# choosin(
Variants B Save as variant.
Hariants allo) %ou to 0ake selection screens easier to use b% en# users b%/
Preassi(nin( $alues to in&ut 'iel#s
;i#in( in&ut 'iel#s
Sa$in( these settin(s 'or reuse
A sin(le $ariant can re'er to 0ore than one selection screen.
Hariants are client s&eci'ic.
:' %ou choose the in'or0ation icon >on an% selection screen?* the s%ste0 )ill #is&la% 0ore in'or0ation about
$ariants. 9ou can also 'in# out 0ore in course BC40- Techniques of List Processing.

SAP AG BC400 4.0 ABAP Workbench Basics 924
SAP Australia 12 October 1998 BC400

SAP AG
R
$ource code
%e6t ele!ents
%itle&+eaders
Progra!
%e6t sy!bols
$OHC"RR
P"HCI%?
$election te6ts
); "irline carrier
D) 7luggesellschaft
); Departing fro!
D) "bflugort
000
Departing fro!
"irline carrier
#+
to
Multilingual Multilingual
yes
ja
4ui
si
REPORT bc400t_selecti0$_sc/ee$.
:
SE(E'T-OPTIO&S s0_c!// 3OR ...
P2R28ETERS %!_city (IKE ...
$election %e6ts
On the selection screen* the na0es o' the $ariables a&&ear ne,t to the in&ut 'iel#s. ;o)e$er* %ou can re&lace
these )ith selection te,ts* )hich %ou can then translate into an% 'urther lan(ua(es %ou re1uire. Selection te,ts
are #is&la%e# in the userFs lo(on lan(ua(e.

SAP AG BC400 4.0 ABAP Workbench Basics 928
SAP Australia 12 October 1998 BC400

SAP AG
R


P"HC"RR
Defines a dialog
"("P Dictionary
reference
Declares an internal
data object in progra!
paHcarr
P2R28ETERS %!_c!// (IKE sy$_c0$$-c!//i.
%!_c!//
#+
#+
Recap: P"R"M)%)R$
:n an e,ecutable &ro(ra0* a sin(le "ARAETER# state0ent is su''icient to (enerate a stan#ar# selection
screen.
"he "ARAETER# <n3.4> T!"E At%&eB state0ent (enerates a si0&le in&ut 'iel# on the selection screen*
an# a #ata ob.ect Ana0eB )ith the t%&e %ou ha$e s&eci'ie#.
:' the user enters a $alue an# chooses F+,ecuteF* that $alue is &lace# in the internal #ata ob.ect Ana0eB in the
&ro(ra0. "he s%ste0 )ill onl% &er0it entries )ith the a&&ro&riate t%&e.

SAP AG BC400 4.0 ABAP Workbench Basics 929
SAP Australia 12 October 1998 BC400

SAP AG
R
Using Para!eters in the $)#)C% $tate!ent
REPORT ...
*2T2 -!_s%.li (IKE s%.li.
P2R28ETERS %!_c!// (IKE s%.li-c!//i.
...
SE(E'T c!//i c0$$i city./0# cityt0 ...
3RO8 s%.li
I&TO 'ORRESPO&*I&: 3IE(*S O3 -!_s%.li
W9ERE c!//i ; %!_c!//.
WRITE: / -!_s%.li-c!//i, -!_s%.li-c0$$i,
-!_s%.li-.l!te, ... .
E&*SE(E'T.
D"%" Adata objectB #I@) Atable fieldB:
P"R"M)%)R$ Apara!eter na!eB #I@) Atable fieldB:
:::
$)#)C% ::: 7ROM AtableB I;%O ::: >+)R) Atable fieldB I Apara!eter na!eB:
:' %ou ha$e use# the "ARAETER# state0ent to &ro(ra0 an in&ut 'iel# as a ke% 'iel# 'or a #atabase table* %ou
can use a %HERE clause at the #ELECT state0ent to li0it #ata selection to this $alue.
:n the e,a0&le abo$e onl% those #ata recor#s are rea# 'ro0 #atabase table #"'LI )hose ke% 'iel# CARRID
ha$e the sa0e $alue as is containe# in #ata ob.ect 53_,3rr at runti0e.

SAP AG BC400 4.0 ABAP Workbench Basics 9!0
SAP Australia 12 October 1998 BC400

SAP AG
R
$)#)C%,OP%IO;$
$OHC"RR
"("P Dictionary
reference
*2T2: -!_s%.li li1e s%.li.
SE(E'T-OPTIO&S s0_c!// 3OR -!_s%.li-c!//i.
to
s0_c!//
-!_s%.li
si5$0%ti0$ l0- 4i54
Declares an
internal
data object soHcarr
8internal table9
in progra!
for data object
waHspfli,carrid
"he state0ent #ELECT-O"TION# Ana0eB 'OR A#ata ob.ectB #e'ines a selection o&tion/ "his &laces t)o
in&ut 'iel#s on the selection screen* )ith the sa0e t%&e that %ou ha$e #e'ine# in the re'erence. "his enables
users to enter a $alue ran(e or co0&le, selections. "he state0ent also #eclares an internal table Ana0eB )ithin
the &ro(ra0* )ith the 'ollo)in( 'our colu0ns/
sign/ "his 'iel# #esi(nates )hether the $alue or inter$al shoul# be inclu#e# in or e,clu#e# 'ro0 the
selection.
option/ "his contains the o&erator/ =or a list o' &ossible o&erators* see the ke%)or# #ocu0entation 'or the
#ELECT-O"TION# state0ent.
low/ "his 'iel# contains the lo)er li0it o' a ran(e* or a sin(le $alue.
high/ "his 'iel# contains the u&&er li0it o' a ran(e.
:' the user enters se$eral $alues or inter$als 'or a selection o&tion an# chooses F+,ecuteF* the s%ste0 &laces the0
in the internal table.
Selection table Ana0eB al)a%s re'ers to a #ata ob.ect that has alrea#% been #eclare#. "his #ata ob.ect ser$es as
a tar(et 'iel# #urin( #atabase selection* the selection table as a &ool o' &ossible $alues. A s&ecial $ersion o' the
%HERE clause e,ists 'or #atabase selection. :t #eter0ines )hether or not the #atabase contains the
corres&on#in( 'iel# )ithin its &ool o' possible values.

SAP AG BC400 4.0 ABAP Workbench Basics 9!1
SAP Australia 12 October 1998 BC400

SAP AG
R
Using $elect,Options in the $)#)C% $tate!ent
REPORT ...
*2T2 W2_SP3(I (IKE SP3(I.
SE(E'T-OPTIO&S s0_c!// 3OR -!_s%.li-c!//i.
...
SE(E'T c!//i c0$$i city./0# cityt0 ...
3RO8 s%.li
I&TO 'ORRESPO&*I&: 3IE(*S O3 -!_s%.li
W9ERE c!//i I& s0_c!//.
WRITE: / -!_s%.li-c!//i, -!_s%.li-c0$$i,
-!_s%.li-city./0#, -!_s%.li-cityt0, ... .
E&*SE(E'T.
*2T2 Adata objectB (IKE AtableB:
SE(E'T-OPTIO&S Aselna!eB 3OR Adata objectB:
:::
SE(E'T table field 3RO8 AtableB I&TO ::: W9ERE Atable fieldB I& Aselna!eB:
"he abo$e e,a0&le sho)s ho) %ou can restrict #atabase selection to a certain ran(e usin( a selection table.
Con#itions in an internal table #eclare# usin( #ELECT-O"TION# are inter&rete# as 'ollo)s/
:' the internal table is e0&t%* the con#ition A'iel#B IN Aselna0eB is al)a%s true.
:' the internal table onl% contains si0&le inclusi$e con#itions i6* ...* in* the result is the co0&osite
con#ition
( i6 OR 777 OR in ?.
:' the internal table onl% contains si0&le e,clusi$e con#itions e1* ...* e0* the result is the co0&osite
con#ition > NOT 46 ) AND 777 AND ( NOT 4. )7
:' the internal table contains both the si0&le inclusi$e con#itions i6* ...* in an# the si0&le e,clusi$e
con#itions e1* ...* e0* the result is the co0&osite con#ition ( i6 OR 777 OR in ) AND ( NOT 46
) AND 777 AND ( NOT 4. )7

SAP AG BC400 4.0 ABAP Workbench Basics 9!2
SAP Australia 12 October 1998 BC400

SAP AG
R
$tandard $election $creens in
)6ecutable Progra!s
Progra!
"("P
runti!e
syste!
ST2RT-O3-SE(E'TIO&.
WRITE ...
SKIP.
)(I&E.


I&ITI2(I<2TIO&.
#ist buffer
2T SE(E'TIO&-S'REE&.
$tate!ents
SE(E'T-OPTIO&S: ...
P2R28ETERS: ...
:n an e,ecutable &ro(ra0* the ABAP runti0e s%ste0 (enerates a stan#ar# selection screen as lon( as %ou ha$e
)ritten at least one "ARAETER# or #ELECT-O"TION# state0ent.
"he selection screen is #is&la%e# a'ter the e$ent block INITIALI&ATION.
"he e$ent block AT #ELECTION-#CREEN >see 'ollo)in( sli#es? belon(s to the selection screen. As soon as
the user chooses F+,ecuteF to lea$e the selection screen* the runti0e s%ste0 calls the #TART-O'-#ELECTION
e$ent block.

SAP AG BC400 4.0 ABAP Workbench Basics 9!!
SAP Australia 12 October 1998 BC400

SAP AG
R


Declarations
SE(E'T-OPTIO&S: ...
P2R28ETERS: ...
ST2RT-O3-SE(E'TIO&
WRITE ...
2T SE(E'TIO&-
S'REE&.
...
<
-
J)6ecuteJ
<
-
"ll user actions
other than
J)6ecuteJ
$tandard $election $creen Processing
:n an e,ecutable &ro(ra0* the stan#ar# selection screen is calle# a'ter the INITIALI&ATION e$ent block.
+ach ti0e the user &resses +nter* a &ushbutton* a 'unction ke%* or chooses a 0enu 'unction* the s%ste0 carries
out a t%&e check. :' the entries #o not ha$e the correct t%&e* the s%ste0 #is&la%s an error 0essa(e* an# 0akes
the 'iel#s rea#% 'or in&ut a(ain. When the #ata t%&es ha$e been correcte#* the s%ste0 tri((ers the AT
#ELECTION-#CREEN e$ent.
:' the user chooses =8 or F+,ecuteI an# the #ata t%&es o' all entries are correct* the AT #ELECTION-#CREEN
is tri((ere#. :' no errors are encountere# #urin( AT #ELECTION-#CREEN &rocessin(* then the #TART-O'-
#ELECTION &rocessin( block is calle#. :' the user chooses an% other 'unction* the selection screen is
re#is&la%e#.

SAP AG BC400 4.0 ABAP Workbench Basics 9!4
SAP Australia 12 October 1998 BC400

SAP AG
R


ST2RT-O3-SE(E'TIO&
WRITE ...
Declarations
SE(E'T-OPTIO&S: ...
P2R28ETERS: ...
)rror
2T SE(E'TIO&-
S'REE&.
...
8ESS2:E e03=.
<
-
"ll user actions
other than
J)6ecuteJ
J)6ecuteJ
<
-
"dditional Input Chec5s
:n an e,ecutable &ro(ra0* the stan#ar# selection screen is calle# a'ter the INITIALI&ATION e$ent block.
+ach ti0e the user &resses +nter* a &ushbutton* a 'unction ke%* or chooses a 0enu 'unction* the s%ste0 carries
out a t%&e check. :' the entries #o not ha$e the correct t%&e* the s%ste0 #is&la%s an error 0essa(e* an# 0akes
the 'iel#s rea#% 'or in&ut a(ain. When the #ata t%&es ha$e been correcte#* the s%ste0 tri((ers the AT
#ELECTION-#CREEN e$ent.
:' the user chooses =8 or F+,ecuteI an# the #ata t%&es o' all entries are correct* the AT #ELECTION-#CREEN
is tri((ere#. :' no errors are encountere# #urin( AT #ELECTION-#CREEN &rocessin(* then the #TART-O'-
#ELECTION &rocessin( block is calle#. :' the user chooses an% other 'unction* the selection screen is
re#is&la%e#.

SAP AG BC400 4.0 ABAP Workbench Basics 9!-
SAP Australia 12 October 1998 BC400

SAP AG
R
"% $)#)C%IO;,$CR));
2T SE(E'TIO&-S'REE&.
I3 0%e/!t0/ ; 6/6 !$ %!_>!l2 ; 0.
8ESS2:E e050?bct/!i$@. A *i>isi0$ by Be/0
E&*I3.
7 e$ 0. e>e$t 2T SE(E'TIO&-S'REE&.
ST2RT-O3-SE(E'TIO&.
:
:
REPORT s!%bc400"_!t_selecti0$_sc/.
P2R28ETERS: %!_>!l1 ty%e I,
0%e/!t0/ ty%e ',
%!_>!l2 ty%e I.
6etFs use a calculator 'unction as an e,a0&le o' an a##itional in&ut check test.
A calculatorFs selection screen contains in&ut 'iel#s 'or t)o )hole nu0bers an# an o&erator. :' the user enters
I8I as an o&erator* an# his or her secon# o&eran# is 0* an error 0essa(e shoul# be #is&la%e# in the status bar
an# the selection screen shoul# be re#is&la%e# rea#% 'or in&ut.

SAP AG BC400 4.0 ABAP Workbench Basics 9!3
SAP Australia 12 October 1998 BC400

SAP AG
R
)6a!ple: User,defined $election $creens
Flight From To (eparting at Flight From To (eparting at
L) "*"" FRA Fran+urt ,F% -ew .or+ &"/&"/""
L) "*"' FRA Fran+urt ,F% -ew .or+ &3/3"/""
000
S1 """' S#- Singapore SF2 San Francisco "3/3"/""

%i!etable
.ou ha4e chosen L) "*"'
Flight date
&'/&3/&335
&'/'"/&335
&'/'*/&335
Ma60
35"
35"
35"
2cc0
'*"
'7"
35"
7light details
7light date
$election screen
=ro0 7elease 4.0* %ou can #e'ine %our o)n selection screens as in#e&en#ent ob.ects an# use the0 in &ro(ra0s
usin( the CALL #ELECTION-#CREEN state0ent.
:n the abo$e e,a0&le* the &ro(ra0 has been e,ten#e# to inclu#e a secon#ar% list. When %ou click on a line o'
the list o' 'li(hts* %ou can select a #ate or ran(e o' #ates on a ne) selection screen be'ore the s%ste0 #is&la%s the
secon#ar% list. "he secon#ar% list 0ust take into account the #ate selection.
:nsertin( a selection screen bet)een a basic list an# a secon#ar% list is onl% one &ossible use 'or user#e'ine#
selection screens.

SAP AG BC400 4.0 ABAP Workbench Basics 9!4
SAP Australia 12 October 1998 BC400

SAP AG
R


)rror
User,defined $election $creens
<
-
J)6ecuteJ
. . .
'2(( SE(E'TIO&-S'REE&
1200.
'9E'K sy-s"b/c ; 0.
2T SE(E'TIO&-
S'REE&.
...
8ESS2:E e03=.
Declarations
SE(E'TIO&-S'REE& CE:I& O3 S'REE& 1200.
P2R28ETERS ...
SE(E'T-OPTIO&S ...
SE(E'TIO&-S'REE& E&* O3 S'REE& 1200.
<
-
"ll user actions
other than
J)6ecuteJ
9ou #e'ine a user#e'ine# selection screen b% enclosin( the "ARAETER# an# #ELECT-O"TION# state0ents
bet)een the '#ELECTION-#CREEN BEGIN O' #CREEN nnnnF an# '#ELECTION-#CREEN END O'
#CREEN nnnnF state0ents* )here nnnn is the selection screen nu0ber. 9ou can use an% 'our#i(it nu0ber
e,ce&t 1000* )hich is reser$e# 'or the stan#ar# selection screen* an# the nu0bers o' an% other screens that %ou
ha$e alrea#% create# in %our &ro(ra0.
9ou can call the selection screen 'ro0 an% ABAP &rocessin( block usin( the state0ent CALL #ELECTION-
#CREEN nnnn.
As )ith the stan#ar# selection* the e$ent AT #ELECTION-#CREEN is tri((ere# on each user interaction. :'
%ou nee# to use #i''erent &ro(ra0 co#e 'or #i''erent selection screens* %ou can 1uer% the selection screen
nu0ber in the e$ent block 'ro0 the 'iel# #!-D!NNR.

SAP AG BC400 4.0 ABAP Workbench Basics 9!8
SAP Australia 12 October 1998 BC400

SAP AG
R
$ynta6: Defining and Calling $election $creens
SE(E'TIO&-S'REE& CE:I& O3 S'REE& +$$$$, .
...
SE(E'TIO&-S'REE& E&* O3 S'REE& +$$$$,.
SE(E'TIO&-S'REE& CE:I& O3 S'REE& 1200.
SE(E'T-OPTIO&S s0_!te 3OR -!_s.li54t-.l!te.
SE(E'TIO&-S'REE& E&* O3 S'REE& 1200.
:::
2T (I&E-SE(E'TIO&.
'2(( SE(E'TIO&-S'REE& 1200.
'9E'K sy-s"b/c eD 0.
SE(E'T se!ts0cc se!ts#!x 3RO8 s.li54t
I&TO 'ORRESPO&*I&: 3IE(*S O3 -!_s.li54t
W9ERE c!//i ; -!_s%.li-c!//i
2&* c0$$i ; -!_s%.li-c0$$i
2&* .l!te I& s0_!te.
'2(( SE(E'TIO&-S'REE& +$$$$, .
:n an e,ecutable &ro(ra0* the stan#ar# selection screen is calle# a'ter the INITIALI&ATION e$ent block.
+ach ti0e the user &resses +nter* a &ushbutton* a 'unction ke%* or chooses a 0enu 'unction* the s%ste0 carries
out a t%&e check. :' the entries #o not ha$e the correct t%&e* the s%ste0 #is&la%s an error 0essa(e* an# 0akes
the 'iel#s rea#% 'or in&ut a(ain. When the #ata t%&es ha$e been correcte#* the s%ste0 tri((ers the AT
#ELECTION-#CREEN e$ent.
:' the user chooses =8 or F+,ecuteI an# the #ata t%&es o' all entries are correct* the AT #ELECTION-#CREEN
is tri((ere#. :' no errors are encountere# #urin( AT #ELECTION-#CREEN &rocessin(* then the #TART-O'-
#ELECTION &rocessin( block is calle#. :' the user chooses an% other 'unction* the selection screen is
re#is&la%e#.

SAP AG BC400 4.0 ABAP Workbench Basics 9!9
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs , User Messages
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens

SAP AG BC400 4.0 ABAP Workbench Basics 940
SAP Australia 12 October 1998 BC400

SAP AG
R
User Messages: Overview
REPORT s!%bc400"_#ess!5e 8ESS2:E-I* bct/!i$.
.
.
.
8ESS2:E E050.
Message te6t
;o data e6ists for this selection 8Please insert another value9
:::
"ilrline carrier K does not e6ist
Division by Lero
:::
%able %<//
$
D)
:::
D)
D)
:::
ID
(C%R"I;
:::
(C%R"I;
(C%R"I;
:::
;o:
/'3
:::
/0=
/1/
:::
Division by Lero Division by Lero
:' user in&ut is inconsistent or i' $alues ha$e been selecte# 'or )hich the user has no authoriGation* it is best to
out&ut a #ialo( 0essa(e )ith the ABAP ke%)or# E##AGE.
9ou can 'in# #ialo( 0essa(es in table "100* or(aniGe# accor#in( to lan(ua(e* a 20#i(it :2* an# a three#i(it
nu0ber.
<essa(es can contain u& to 4 $ariables* i#enti'ie# as J1* J2* J!* an# J4. :' %ou )ant to out&ut the character
J an# #o not )ant to use it as a $ariable* #ouble it* 'or e,a0&le/ F"his is a 0essa(e )ith an JJF.
:n 0essa(e lon( te,ts use J$1J* J$2J* J$!J* an# J$4J 'or their corres&on#in( $ariable.
9ou can create %our o)n 0essa(es usin( :2 nu0bers that be(in )ith 9 >'or the hea# o''ice? or K >'or branch
o''ices?.

SAP AG BC400 4.0 ABAP Workbench Basics 941
SAP Australia 12 October 1998 BC400

SAP AG
R
$ynta6: M)$$"*) $tate!ents
REPORT Areport na!eB 8ESS2:E-I* A!essage idB:
"nnn
Mnnn
8ESS2:E )nnn WIT9 Afield<B Afield-B Afield'B Afield0B.
>nnn
Innn
$nnn
:
:
:
Sen# 0essa(es )ith the <+SSAG+ state0ent. "he lan(ua(e 'or 0essa(es in table "100 is auto0aticall% set to
the userFs lo(on lan(ua(e. +nter the 0essa(e :2 'ollo)in( the &ara0eter <+SSAG+:2 in the 7+PO7"
state0ent. "he 0essa(e :2 is no) set 'or the entire re&ort. +nter the 0essa(e nu0ber at the <+SSAG+
state0ent.
+nter the 0essa(e t%&e #irectl% in 'ront o' the three#i(it 0essa(e nu0ber5 this letter #eter0ines ho) the re&ort
user reacts to #ialo( 0essa(es >see ne,t sli#e?.
Set $alues 'or $ariables >u& to a 0a,i0u0 o' 'our? 'ollo)in( the &ara0eter W:";. =iel#s an# literals are also
allo)e#. "he 'iel# at le$el i thus re&laces 0essa(e $ariable Ji. :' the $ariables in the 0essa(e are i#enti'ie#
)ith J or L* these &lacehol#ers are su&&lie# )ith $alues in#e&en#ent o' the &osition o' the 'iel#s o' the 0essa(e
state0ent.
:n a##ition to usin( 0essa(e :2 )ith the 7+PO7" state0ent* %ou can also a## a #i''erent 0essa(e :2 to the
co00an# <+SSAG+ b% enterin( the :2 in &arenthesis #irectl% a'ter the 0essa(e nu0ber. "his #e$iant
0essa(e :2 is onl% $ali# 'or a sin(le 0essa(e* ho)e$er. =or e,a0&le/ <+SSAG+ +004>E2?.
Ese the 'ollo)in( s%nta,* )hene$er %ou )ant to sen# a #%na0ic 0essa(e/
<+SSAG+ :2 A0i#B "9P+ A0t%&eB DE<B+7 A0nrB W:"; A'iel#1B A'iel#2B A'iel#!B A'iel#4B.
S%ste0 'iel#s S9<SG:2* S9<SG"9 an# S9<SGDO are su&&lie# )ith the 0essa(e :2* 0essa(e t%&e* an#
0essa(e nu0ber res&ecti$el% an# s%ste0 'iel#s S9<SGH1 to S9<SGH4 )ith the 'iel#s 'or the &lacehol#ers.

SAP AG BC400 4.0 ABAP Workbench Basics 942
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialog Message %ypes
) !essage
;
e
w

e
n
t
r
y

!
u
s
t

b
e

!
a
d
e
#ist #ist
#ist
with
$ !essage
7unction
call
$election
screen
" !essage
M !essage
R
e
s
t
a
r
t
%er!ination )rror >arning Infor!ation $uccess
;
e
w

e
n
t
r
y

c
a
n

b
e

!
a
d
e
7unction
call
7unction
call
7unction
call
7unction
call
$election
screen
$election
screen
$election
screen
$election
screen
> !essage I !essage
"here are si, #i''erent t%&es o' 0essa(e/
A "er0ination Processin( is ter0inate#* the user 0ust restart the transaction
M +,it 6ike a ter0ination 0essa(e* but )ith short #u0&
<+SSAG+N"9P+NM
+ +rror Processin( is interru&te#* the user must correct the entr%
W Warnin( Processin( is interru&te#* the user can re&eat the entr%* or he
or she can
con'ir0 b% choosin( +D"+7
: :n'or0ation Processin( is interru&te#* but continues a'ter the user con'ir0s the
0essa(e )ith +D"+7
S Success :n'or0ation on subse1uent screen
:n or#er to ensure that %our selection screen is once a(ain rea#% 'or in&ut a'ter 0essa(es o' t%&e + an# t%&e W*
#is&la% these 0essa(es in the A" S+6+C":ODSC7++D e$ent. "hese kin#s o' 0essa(es then act like an A
0essa(e at one o' the subse1uent e$ents >'or e,a0&le at S"A7"O=S+6+C":OD* G+" or +D2O=
S+6+C":OD?.

SAP AG BC400 4.0 ABAP Workbench Basics 94!
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs , $creens
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens

SAP AG BC400 4.0 ABAP Workbench Basics 944
SAP Australia 12 October 1998 BC400

SAP AG
R
$creens: $trengths
Data entry with Data entry with
consistency chec5s consistency chec5s
7le6ible 7le6ible
progra! flow progra! flow
-//
<-/
<0/
<//
'//
$earch help $earch help
%ype chec5s %ype chec5s
Screens are 0a#e u& o' 0ore than .ust a 0onitor #is&la% )ith in&ut an# out&ut 'iel#s.
ScreensF inte(ration )ith the ABAP2ictionar% allo)s %ou to &er'or0 consistenc% checks 'or their in&ut 'iel#s
auto0aticall%. "hese checks inclu#e t%&e checks* 'orei(n ke% checks* an# 'i,e# $alue checks. All o' these
checks rel% u&on ABAP 2ictionar% in'or0ation.
Checks like the ones abo$e can be co0&le0ente# b% other &ro(ra0 s&eci'ic checks. "here are techni1ues
a$ailable 'or screens that allo) %ou to control in )hat or#er checks are the &er'or0e#. When an error is
#etecte#* the corres&on#in( 'iel# is calle# an# #is&la%e# rea#% 'or in&ut.
Screen la%out is also $er% 'le,ible. :n&ut 'iel#s* out&ut 'iel#s* ra#io buttons* check bo,es* an# e$en &ushbuttons
can be &lace# on screens. "he% allo) users to #eter0ine in )hich #irection the &ro(ra0 )ill &rocee#.
On the )hole* such user in'luence on &ro(ra0 &ro(ression allo)s 'or 0ore &ro(ra0 'le,ibilit% in those
&ro(ra0s that #o contain screens.

SAP AG BC400 4.0 ABAP Workbench Basics 94-
SAP Australia 12 October 1998 BC400

SAP AG
R
Using $creens
<//
-//
'//
<-/
<0/
%ransaction code
'2(( S'REE& 100.


9ou can call screens 'ro0 an% ABAP &rocessin( block that %ou )ant.
9ou can link se$eral screens to one another an# then call the0 'ro0 )ithin a &ro(ra0 b% si0&l% callin( the
'irst screen.
So0e ABAP &ro(ra0s are 0a#e u& e,clusi$el% o' screens an# their corres&on#in( ABAP &rocessin( blocks. :n
this case the 'irst screen is calle# #irectl% usin( a transaction co#e.

SAP AG BC400 4.0 ABAP Workbench Basics 943
SAP Australia 12 October 1998 BC400

SAP AG
R
$creens: an )6a!ple
Flight (eparting rom (estination Flight (eparting rom (estination
L) "*"" FRA Fran+urt ,F% -ew .or+
L) "*"' FRA Fran+urt ,F% -ew .or+
000
S1 """' S#- Singapore SF2 San Francisco
%i!etable
Change flight data Change flight data
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
Change in
database
$ave (ac5
$creen
:n this &art o' the cha&ter %ou )ill #e$elo& a &ro(ra0 that chan(es stan#ar# 'li(ht #ata.
2oubleclick on an entr% in the basic list Iti0etable@ to reach a screen. "his screen #is&la%s #ata 'ro0 the
line %ou selecte#* as )ell as a##itional in'or0ation about the airline carrier. 9ou can chan(e 'li(ht an#
#e&arture ti0es.
Choosin( FBackF takes the user back to the basic list )ithout chan(in( an% #ata
Choosin( FSa$eF chan(es the #ata in the #atabase.
2atabase chan(es are 0a#e usin( a 'unction 0o#ule an# are #iscusse# later in Database Changes.

SAP AG BC400 4.0 ABAP Workbench Basics 944
SAP Australia 12 October 1998 BC400

SAP AG
R
Parts of a $creen
$creen
"ttributes
$creen
#ayout
7ield
"ttributes
7low
Control
$creen nu!ber
$hort description
$creen type
;e6t screen
:::
PRO'ESS CE3ORE O)TP)T.
8O*)(E TR2&S_TO_100.
PRO'ESS 23TER I&P)T.
8O*)(E TR2&S_3RO8_100.
8O*)(E )SER_'O882&*_0100.
7ield na!e
%ype
#ength
Input
Output
:::
x
"irline carrier:
$creen
Painter
"he 0a.or ste&s in creatin( a screen/
s&eci'%in( its &ro&erties >Screen Attributes?
s&eci'%in( its la%out >in =ullscreen +#itor?
#e'inin( its 'iel# attributes >ie!d List"
&ro(ra00in( its 'lo) lo(ic

SAP AG BC400 4.0 ABAP Workbench Basics 948
SAP Australia 12 October 1998 BC400

SAP AG
R
$tep <: Creating a $creen
Flight (eparting rom (estination Flight (eparting rom (estination
L) "*"" FRA Fran+urt ,F% -ew .or+
L) "*"' FRA Fran+urt ,F% -ew .or+
000
S1 """' S#- Singapore SF2 San Francisco
%i!etable
Change flight data Change flight data
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
(ac5
$creen
9our 'irst ste& is to create a screen* s&eci'% its la%out* an# #e'ine its 'iel# attributes. "he 'iel#s Air!ine# !ight
$umber# De%arture Air%ort* an# Arriva! Air%ort shoul# a&&ear as out&ut 'iel#s* !ight Time an# De%arture
Time as in&ut 'iel#s. "he screen shoul# also contain a &ushbutton labele# IBack.@
9ou shoul# be able to call %our screen b% #oubleclickin( a line )ithin the basic list an# %ou shoul# be able to
return to the basic list b% choosin( the a&&ro&riate 'unction ke% on the screen.

SAP AG BC400 4.0 ABAP Workbench Basics 949
SAP Australia 12 October 1998 BC400

SAP AG
R
Creating a $creen: $creen "ttributes
:
2T (I&E-SE(E'TIO&.
:
'2(( S'REE& 100.
:
$reate ob<ect $reate ob<ect
$creen <// does not e6ist:
Do you want to create the objectD
?es Cancel
$hange screen attributes $hange screen attributes
$hort description
$creen type
;e6t screen
/
$upple!ental data display
;or!al
$ubscreen
Modal dialog bo6
$election screen
"("P
;o
$creen
Painter
"here are se$eral )a%s to create screens/
Forward navigation/ 9ou can create screens 'ro0 )ithin the ABAP +#itor b% #oubleclickin( on the
screen nu0ber. "his trans'ers %ou into Screen Painter auto0aticall%
Repository Browser/ 9ou can also create a screen 'ro0 the ob.ect list in the 7e&ositor% Bro)ser
When creatin( a screen 'or the 'irst ti0e the s%ste0 )ill ask %ou to enter screen attributes. +nter a short
description o' the screen* select screen t%&e $orma! an# enter the nu0ber o' the subse1uent screen in the $e&t
Screen in&ut 'iel#.
:' %ou enter 0 or lea$e the $e&t Screen 'iel# blank* the s%ste0 'irst &rocesses %our screen co0&letel% an# then
returns to &rocessin( the &ro(ra0 at the &oint i00e#iatel% 'ollo)in( the screen call. Be a)are that in the in&ut
'iel# o' the ne,t screen 0 is su&&resse# as an initial $alue #urin( #is&la%.
:n this e,a0&le the screen %ou create is su&&ose# to be calle# 'ro0 )ithin a basic list. "here'ore CALL
#CREEN 100 0ust belon( to the e$ent block AT LINE-#ELECTION .

SAP AG BC400 4.0 ABAP Workbench Basics 9-0
SAP Australia 12 October 1998 BC400

SAP AG
R
#ayout and 7ield "ttributes <
"ttributes Dict:&Progra! fields 7ield list
%
M
(ac5
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
sy$_c0$$
"here are t)o )a%s o' assi(nin( 'iel# attributes to screen 'iel#s/
Adopt them from the Dictionary/ 9ou can a#o&t t%&es an# 'iel# attributes 'ro0 e,istin( ABAP
2ictionar% structures. "his 0akes all in'or0ation about the ob.ect a$ailable to %ou* inclu#in( se0antic
in'or0ation about its #ata ele0ents an# 'orei(n ke% #e&en#encies. "he na0e o' the 2ictionar% 'iel# is
auto0aticall% a#o&te# as a 'iel# na0e.
Adopt them from a program/ 9ou can a#o&t 'iel# attributes 'ro0 #ata ob.ects alrea#% #e'ine# )ithin a
&ro(ra0. :n or#er to #o this* ho)e$er* an acti$ate# co&% o' the &ro(ra0 0ust alrea#% e,ist. "he na0e o'
the #ata ob.ect is auto0aticall% a#o&te# as a 'iel# na0e.
"he Gra&hical Screen Painter@s inter'ace allo)s %ou to #e'ine screen ele0ents >'or e,a0&le* in&ut an# out&ut
'iel#s* ke%)or# te,ts* bor#ers* an# so on? )ith relati$e ease. Choose the #esire# screen ele0ent 'ro0 the colu0n
on the le't an# then &lace it on the screen usin( %our 0ouse.
9ou can #elete screen ele0ents si0&l% b% selectin( the0 )ith %our 0ouse an# then choosin( #elete.
9ou can 0o$e screen ele0ents b% hol#in( #o)n %our le't 0ouse button an# #ra((in( the0 to a ne) &osition.
ote!
"he Gra&hical Screen Painter is a$ailable 'ro0 7elease !.0 )ith Win#o)s D"* Win#o)s 9- an# ED:M.
Other)ise %ou ha$e to )ork )ith the al&hanu0eric Screen Painter.

SAP AG BC400 4.0 ABAP Workbench Basics 9-1
SAP Australia 12 October 1998 BC400

SAP AG
R
"ttributes Dict:&Progra! fields 7ield list
%
M
"ttributes "ttributes
Dict
7Code 7%ype
#ine Colu!n
;a!e
%e6t
Prog Disp
:
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
(ac5
Input field
Output field
Re4uired field
: : :
$D?;HCO;;,C"RRID
#ayout and 7ield "ttributes -
9ou can 0aintain screen 'iel# attributes b% selectin( a 'iel# an# choosin( Attributes.
"he Screen Painter )orks )ith e,ternal #ata t%&es.
Consult the TABL"S ke% )or# #ocu0entation in or#er to 'in# out )hich internal #ata t%&es >ABAP #ata t%&es?
corres&on# to e,ternal #ata t%&es. =or e,a0&le/
ABAP 2ictionar% 2ata "%&e ABAP 2ata "%&e
CHAR C
NUC N
9ou can classi'% certain 'iel#s as F0an#ator%F> O7e1uire# 'iel#O?. A 1uestion 0ark is #is&la%e# at runti0e i' the
'iel# is initial.
:' not all re1uire# 'iel#s ha$e been 'ille# at runti0e an# a user action is &er'or0e#* an error #ialo( is tri((ere#
an# all in&ut 'iel#s are once a(ain #is&la%e# rea#% 'or in&ut.

SAP AG BC400 4.0 ABAP Workbench Basics 9-2
SAP Australia 12 October 1998 BC400

SAP AG
R
7ield "ttributes: %he 7ield #ist
$creen Painter: 7ield #ist $creen Painter: 7ield #ist
$(OO@,C"RRID %)M% 1 <0 <. <. < C+"R
v#g
$D?;HCO;;,C"RRID I&O : : :
:
:
:
$D?;HCO;;,C"RRID %e6t : : :
7ield type %e6ts&%e!pl: *en: attr: Display attr: Modif: siLe References
O I 7ield na!e 7ield type O only : : :
9ou can also e#it screen 'iel# attributes b% choosin( ie!d !ist.
"he 'iel# list is then #is&la%e# as a tab.
"his sa0e 'unction can also be accesse# in a #i''erent 'or0at 'ro0 )ithin the Gra&hical Screen Painter.

SAP AG BC400 4.0 ABAP Workbench Basics 9-!
SAP Australia 12 October 1998 BC400

SAP AG
R
"irline carrier
): )ntry does not e6ist
Chec5 %ables
%echnical infor!ation %echnical infor!ation
%ab: na!e
7ield na!e C"RRID
Do!Nne
Dictionary: %able Dictionary: %able
;a!e
C"RRID
$D?;H::
7ield na!e Chec5 table
Double,clic5
$C"RR
$D?;H::
:' a screen 'iel# re'ers to a 'iel# in the ABAP 2ictionar% that has a 'orei(n ke% check #e'ine# 'or it* a check
a(ainst $alues in the check table is auto0aticall% &er'or0e#.
:' the check table 'or the 'iel# #oes not contain the entr% 0a#e* an error 0essa(e is #is&la%e# an# the 'iel# is
a(ain rea#% 'or in&ut.
Choosin( the &ossible entries &ushbutton >=4? allo)s %ou to #is&la% all the &ossible $alues 'or a 'iel# that are
containe# )ithin its check table.
:' an% 'i,e# $alues ha$e been #e'ine# 'or a &articular screen )ithin a certain #o0ain* the $alues entere# on the
screen are auto0aticall% co0&are# )ith these 'i,e# $alues.
:' an entr% #oes not corres&on# to an% o' the 'i,e# $alues 'or the screen* an error 0essa(e is #is&la%e# an# the
'iel# is a(ain rea#% 'or in&ut.
All &ossible entries 'or a &articular 'iel# >'i,e# $alues? are can be #is&la%e# b% choosin( the &ossible entries
&ushbutton >=4?.

SAP AG BC400 4.0 ABAP Workbench Basics 9-4
SAP Australia 12 October 1998 BC400

SAP AG
R
$tep -: Displaying Data
Flight (eparting or (estination Flight (eparting or (estination
L) "*"" FRA Fran+urt ,F% -ew .or+
L) "*"' FRA Fran+urt ,F% -ew .or+
000
S1 """' S#- Singapore SF2 San Francisco
%i!etable
Change flight data Change flight data
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
(ac5
$creen
:n ste& t)o %ou )ill learn ho) to &ro(ra0 #ata trans&ort 'ro0 a basic list onto %our screen.
=or the user* the &ro(ra0 )orks in the 'ollo)in( 0anner/
B% #oubleclickin( on a line in the basic list the user branches to a screen. On this screen the 0ost
i0&ortant bits o' in'or0ation 'or the connection he or she has chosen are #is&la%e#. "he 'li(ht ti0e an#
#e&arture ti0e are #is&la%e# in a 'iel# that is rea#% 'or in&ut an# hence can be chan(e#.
"he user can return to the basic list in one o' se$eral )a%s.
With this in 0in#* this &art o' the unit )ill #eal )ith/
Prere1uisites 'or auto0atic #ata trans&ort bet)een &ro(ra0s an# screen 'iel#s
2e'inin( the screen inter'ace an# &ro(ra00in( #ata trans&ort to the inter'aceFs #ata ob.ects
=lo) lo(ic in PBO an# PA: e$ent blocks
Esin( PBO an# PA: 0o#ules as ABAP &rocessin( blocks 'or screen &ro(ra00in(

SAP AG BC400 4.0 ABAP Workbench Basics 9--
SAP Australia 12 October 1998 BC400

SAP AG
R


T2C(ES sy$_c0$$.
sy$_c0$$
"irline carrier
7light nu!ber
Continue
sy$_c0$$
Declares a data object for screen interface that has
the sa!e type and na!e as the Dictionary object
$creen Interfaces
"he state0ent TABLE# #eclares an internal #ata ob.ect that ser$es as an inter'ace 'or the screen. TABLE#
al)a%s re'er to a structure that is #e'ine# in the ABAP 2ictionar%.
:' a TABLE# state0ent an# a screen 'iel# both re'er to the sa0e 2ictionar% structure* this #ata ob.ect@s #ata is
trans&orte# to the screen 'iel#s e$er% ti0e the screen is calle#. An% ne) entries or chan(es that the user 0akes
on the screen are then trans'erre# back into this #ata ob.ect.
Dor0all% the ABAP 2ictionar% contains structures )ith 'iel#s that corres&on# to se$eral #i''erent tables. "hese
tables in turn corres&on# to the business $ie) o' &articular a&&lications. "he 'li(ht #ata &ro(ra0s bein(
create# in this course use one structure 'or 0aster #ata 0aintenance >s*(n_,-nn? an# another 'or bookin(s
#ata >s*(n_8--9?. Esin( %our o)n structures as inter'aces usuall% hel&s 0ake a &ro(ra0 easier to un#erstan#
an# hel&s to a$oi# errors as )ell.

SAP AG BC400 4.0 ABAP Workbench Basics 9-3
SAP Australia 12 October 1998 BC400

SAP AG
R
$creen Processing #ogic: P(O and P"I
$creen <//
2T (I&E-SE(E'TIO&.
'2(( S'REE& 100.



$creen
Painter
PRO'ESS CE3ORE O)TP)T.
Processes logic before
a screen is displayed
PRO'ESS 23TER I&P)T.
Processes logic after
a user has entered data
;e6t screen /
"he ABAP state0ent CALL #CREEN AnB interru&ts AT LINE-#ELECTION &rocessin( an# calls a screen.
+ach screen has t)o corres&on#in( e$ent blocks/
"ROCE## BE'ORE OUT"UT ("BO) is &rocesse# i00e#iatel% be'ore a screen is #is&la%e#
"ROCE## A'TER IN"UT ("AI) is &rocesse# i00e#iatel% a'ter the user &resses +D"+7 or chooses
another 'unction. All &ro(ra0 lo(ic that is in'luence# b% in&ut an# 0eant to return the user to the screen
b% )a% o' an error 0essa(e 0ust be &rocesse# at PA:. 9ou )ill learn 0ore about this in ste& three.
"he e$ents "BO an# "AI usuall% call modules* s&eciall% #esi(ne# ABAP &rocessin( blocks.
Pro(ra0 lo(ic that lo(icall% belon(s to a s&eci'ic screen shoul# nor0all% be &rocesse# at the screen@s "BO an#
"AI e$ents. :n or#er to #e0onstrate this %ou )ill no) be aske# to &ro(ra0 'iel# trans&ort #urin( "BO an# "AI
bet)een %our &ro(ra0@s #ata ob.ects an# the #ata ob.ect s*(n_,-nn. s*(n_,-nn is su&&ose# to act as an
inter'ace 'or the screen.

SAP AG BC400 4.0 ABAP Workbench Basics 9-4
SAP Australia 12 October 1998 BC400

SAP AG
R
$creen Processing (loc5s
"n event for e6a!ple:
ST2RT-O3-SE(E'TIO&
2C2P
"("P runti!e syste!
3OR8 2
2C2P
E&*3OR8
3OR8 C
2C2P
E&*3OR8
"("P
)ditor
$creen
Painter
PCO P2I
-//
P2I
Sc/ee$ 2C2P
PCO
Sc/ee$ 2C2P
<//
Progra!
8O*)(E E O)TP)T.
2C2P
E&*8O*)(E
8O*)(E F I&P)T.
2C2P
E&*8O*)(E
Screens an# their lo(ic inclu#in( PBO an# PA: e$ent blocks are create# an# e#ite# )ith the Screen Painter
tool.
"ach screen has its o)n "ROCE## BE'ORE OUT"UT ("BO) an# "ROCE## A'TER IN"UT ("AI)
e$ents.
ote!
"he co#e 'or the e$ents "BO an# "AI is )ritten usin( the Screen Painter an# not the ABAP +#itor. "hese t)o
e$ent blocks 0ake u& a screen@s flow logic. When &ro(ra00in( 'lo) lo(ic* use the set o' co00an#s calle#
Screen ABAP7 ODULE AABAP 0o#ule na0eB is the 0ost i0&ortant Screen ABAP co00an#. :t calls a
s&ecial ABAP &rocessin( block calle# a module.
#odules are &rocessin( blocks )ith no inter'ace )hose ABAP co#e is &rece#e# b% the state0ent ODULE an#
'ollo)e# b% the state0ent ENDODULE.
<o#ules* 'or0s* an# all e$ents )ith the e,ce&tion o' "BO an# "AI are e#ite# usin( the ABAP +#itor.

SAP AG BC400 4.0 ABAP Workbench Basics 9-8
SAP Australia 12 October 1998 BC400

SAP AG
R
P(O and P"I Processing #ogic
$creen <//
8O*)(E E O)TP)T.
E&*8O*)(E.
PCO
8O*)(E E.
2T (I&E-SE(E'TIO&.
'2(( S'REE& 100.
P2I
8O*)(E F
8O*)(E <
8O*)(E < I&P)T.
E&*8O*)(E.
$creen
Painter
;e6t screen /
8O*)(E F I&P)T.
E&*8O*)(E.
"he ABAP state0ent CALL #CREEN <nnnn> interru&ts AT LINE-#ELECTION &rocessin( an# calls a
screen.
"he e$ent "BO is &rocesse# be'ore a screen is #is&la%e#. At this ti0e 0o#ules are calle# that take care o' tasks
such as insertin( reco00en#e# $alues into in&ut 'iel#s.
All user in&ut tri((ers "AI e$ent &rocessin(. All 0o#ules that t%&icall% &rocess in&ut #ata are calle# at this
ti0e.
All e$ent 0o#ules are se1uentiall% &rocesse#.

SAP AG BC400 4.0 ABAP Workbench Basics 9-9
SAP Australia 12 October 1998 BC400

SAP AG
R
Data %ransport between $creens and Progra!s
$2RR:SP2-(#-G F#:L(S $2RR:SP2-(#-G F#:L(S $2RR:SP2-(#-G F#:L(S
%i!e
T2C(ES: sy$_c0$$.
'2RRI* 'O&&I*
8O*)(E t/!$s_t0_100 O)TP)T.
8OGE-'ORRESPO&*I&:
-!_s%.li TO sy$_c0$$.
E&*8O*)(E.
8O*)(E t/!$s_./0#_100 I&P)T.
8OGE-'ORRESPO&*I&:
sy$_c0$$ TO -!_s%.li.
E&*8O*)(E.
PCO
8O*)(E t/!$s_t0_100.
P2I
8O*)(E t/!$s_./0#_100.
$D?;HCO;;,C"RRID
#+
$D?;,CO;;,CO;;ID
/0/-
sy$_c0$$
#+ /0//
#+ /0/-
<
-
2ata trans&ort takes &lace auto0aticall% bet)een screens an# &ro(ra0 #ata ob.ects o' the sa0e na0e/
:00e#iatel% be'ore a screen #is&la%e#* after all PCO e$ent 0o#ules ha$e been &rocesse#* the contents o'
corres&on#in( 'iel#s are co&ie# out o' the ABAP )ork area into the screen )ork area.
:00e#iatel% a'ter a user in&uts #ata* before the 'irst P2I 0o#ule has been &rocesse#* the contents o'
corres&on#in( 'iel#s are co&ie# out o' the screen )ork area into the ABAP )ork area.
ABAP state0ents )ithin the 0o#ules the0sel$es 'acilitate #ata trans&ort bet)een &ro(ra0 #ata ob.ects an# the
)ork area #esi(nate# as the screen inter'ace.

SAP AG BC400 4.0 ABAP Workbench Basics 930
SAP Australia 12 October 1998 BC400

SAP AG
R
7low #ogic
PRO'ESS CE3ORE O)TP)T.
8O*)(E t/!$s_t0_100.
8O*)(E t/!$s_t0_100 O)TP)T.
8OGE-'ORRESPO&*I&:
-!_s%.li TO sy$_c0$$.
E&*8O*)(E.
"("P
)ditor
Create object Create object
P(O !odule %R";$H%OH<// does not e6ist:
Do you want to create the objectD
?es Cancel ;o
P(O !odule
I;C#UD) choice
%R";$H%OH<//
;ew include
Create P(O !odule Create P(O !odule
Main progra!
$creen
Painter
(C0//DHDI$P#"?
9ou can i0&le0ent calls such as ODULE )ithin a screen@s 'lo) controls >PBO an# PA: e$ents?. "he 0o#ules
the0sel$es are* ho)e$er* create# usin( ABAP.
"here are t)o )a%s to create a 0o#ule/
usin( forward navigation/ 2oubleclick on the 0o#ule na0e 'ro0 )ithin the Screen Painter +#itor
to create the 0o#ule.
usin( the Repository Browser/ :' %ou )ant to create a 0o#ule usin( the ob.ect list in the 7e&ositor%
Bro)ser* 'irst #is&la% %our &ro(ra0* then choose IPBO 0o#ule@ or IPA: 0o#ule@ in the Program'b(ects
#is&la% an# create a ne) #e$elo&0ent ob.ect b% selectin( the create icon.
A 0o#ule can be calle# 'ro0 0ore than one screen.
Be a)are that 0o#ules calle# at PBO e$ents 0ust be #e'ine# usin( the state0ent ODULE 777 OUT"UT*
)hereas 0o#ules #e'ine# )ith ODULE 777 IN"UT* can onl% be calle# at PA: e$ents.

SAP AG BC400 4.0 ABAP Workbench Basics 931
SAP Australia 12 October 1998 BC400

SAP AG
R
$tep ': Defining Pushbuttons
Flight (eparting rom (estination Flight (eparting rom (estination
L) "*"" FRA Fran+urt ,F% -ew .or+
L) "*"' FRA Fran+urt ,F% -ew .or+
000
S1 """' S#- Singapore SF2 San Francisco
%i!etable %i!etable
Change flight data Change flight data
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
#+
/0//
7R"
F7@
Change in
database
$ave (ac5
$creen $creen
:n ste& three %ou )ill learn ho) to #esi(nate &ushbutton 'unctions. "hese 'unctions allo) #i''erent kin#s o'
&ro(ra0 lo(ic to be &rocesse# accor#in( to user choice.
=or the user* the &ro(ra0 )orks in the 'ollo)in( 0anner/
B% #oubleclickin( on a line in the basic list the user branches to a screen. On this screen the 0ost
i0&ortant bits o' in'or0ation 'or the connection he or she has chosen are #is&la%e#. "he 'li(ht ti0e an#
#e&arture ti0e can be chan(e#.
B% choosin( the FBackF &ushbutton* the user returns to the basic list )ithout )ritin( an% chan(es to the
#atabase.
B% choosin( the FSa$eF &ushbutton* all $alues chan(e# on the screen are )ritten to the #atabase an# the
&ro(ra0 is e,ite#.
A'ter each user action* the screen is re#is&la%e#.
2atabase chan(es are 0a#e )ith the hel& o' e,istin( 'unction 0o#ules. See the cha&ter on the Transaction
Conce%t 'or 0ore about this &rocess.
"his to&ic #eals )ith ho) to control ho) the &ro(ra0 continues accor#in( to the &ushbutton chosen b% the user

SAP AG BC400 4.0 ABAP Workbench Basics 932
SAP Australia 12 October 1998 BC400

SAP AG
R
"ttributes Dict:&Progra! fields 7ield list
%
M
"ttributes "ttributes
Dict
7Code 7%ype
#ine
Colu!n
;a!e
%e6t
Prog Disp
"irline carrier
7light nu!ber
Departure airport
Destination
7light ti!e
Departure ti!e
(ac5
Input field
Output field
: : :
(U%%O;-
$ave
("C@
(ac5
Defining 7unction Codes
:n or#er to #e'ine 'unctions 'or s&eci'ic &ushbuttons* these &ushbuttons 0ust be assi(ne# 'unction co#es. 9ou
can #o this either on the attributes screen or in the 'iel# list in the Gra&hical Screen Painter.

SAP AG BC400 4.0 ABAP Workbench Basics 93!
SAP Australia 12 October 1998 BC400

SAP AG
R
"ssigning a 7ield ;a!e to the O@HCOD) 7ield
Screen Painter/ Field list Screen Painter/ Field list
(U%%O;<
(U%%O;-
O@HCOD) O@
$ave
(ac5
$"G)
("C@
7ield na!e
::: :::
T2C(ES: sy$_c0$$.
*2T2: 01_c0e li1e sy-"c0##,
s!>e_01 li1e sy-"c0##.
"("P
)ditor
$creen
Painter
7unction code
7ield te6t
*eneral attributes
"he OK_CODE 'iel# is a #ata ob.ect into )hich corres&on#in( 'unction co#es are 'e# a'ter e$er% user action.
"he 'iel# na0e OK_CODE 0ust be inserte# as the last line in each screen@s 'iel# list.
:' %ou #e'ine a corres&on#in( #ata ob.ect o' the sa0e na0e in a &ro(ra0@s #eclaration area* the s%ste0 &laces
the 'unction co#e o' the &ushbutton chosen b% the user in the #ata ob.ect at runti0e. 9ou can use 'iel# s(-
+,-.. as a re'erence 'iel#.

SAP AG BC400 4.0 ABAP Workbench Basics 934
SAP Australia 12 October 1998 BC400

SAP AG
R
Progra! #ogic
PRO'ESS CE3ORE O)TP)T.
8O*)(E t/!$s_t0_100.
PRO'ESS 23TER I&P)T.
8O*)(E t/!$s_./0#_100.
8O*)(E "se/_c0##!$_0100.
"("P
)ditor
8O*)(E t/!$s_t0_100 O)TP)T.
. . .
E&*8O*)(E.
8O*)(E t/!$s_./0#_100 I&P)T.
. . .
E&*8O*)(E.
8O*)(E "se/_c0##!$_0100 I&P)T.
7 PRO:R28 (O:I'
s!>e_01 ; 01_c0e.
'(E2R 01_c0e.
'2SE s!>e_01.
W9E& 6C2'K6. ...
W9E& 6S2GE6. ...
E&*'2SE.
E&*8O*)(E.
$creen
Painter
(ac5 $ave
With the hel& o' the OK_CODE 'iel#* #i''erent &ro(ra0 lo(ic can no) be &rocesse# b% the PA: 0o#ules
#e&en#in( on )hat the user in&uts.
:' an OK_CODE 'iel# is not #elete# >cleare#? at "AI* errors can occur since not e$er% &ushbutton is re1uire# to
ha$e a 'unction co#e. "here'ore it is reco00en#e# that %ou use au,iliar% 'iel#s >sa$eNok in the e,a0&le abo$e?
an# return the OK_CODE 'iel# to its initial $alue.

SAP AG BC400 4.0 ABAP Workbench Basics 93-
SAP Australia 12 October 1998 BC400

SAP AG
R
$tatic $creen $e4uencing
PCO

P2I

'2(( S'REE& 100



Screen attributes
$creen nu!ber <//
;e6t screen
/
/
:' %ou enter 0 or lea$e the $e&t Screen 'iel# blank* the s%ste0 'irst &rocesses %our screen co0&letel% an# then
carries on &rocessin( the &ro(ra0 'ro0 )here the screen )as calle#.

SAP AG BC400 4.0 ABAP Workbench Basics 933
SAP Australia 12 October 1998 BC400

SAP AG
R
Dyna!ic $creen $e4uencing
Screen attributes
$creen nu!ber <//
;e6t screen <//
PCO

P2I

'2(( S'REE& 100.



8O*)(E ... .
I3 ... .
SET S'REE& 0.
E&*I3.
E&*8O*)(E.
<//
/
/
9ou can use the ABAP state0ent #ET #CREEN <nnnn> )ithin a PA: 0o#ule to auto0aticall% set the $e&t
screen $alue.
O'ten the sa0e screen nu0ber is entere# in both the Screen number an# $e&t screen 'iel#s. :n this case* )hen
%ou choose )nter# a 'iel# check is &er'or0e# an# the s%ste0 returns %ou to the sa0e screen. :n or#er to lea$e
the screen* an a&&ro&riate &ushbutton 0ust be #e'ine# that then tri((ers a
$e&t screen chan(e )ithin the "AI 0o#ule.

SAP AG BC400 4.0 ABAP Workbench Basics 934
SAP Australia 12 October 1998 BC400

SAP AG
R
Database Updates
*2T2: 01_c0e (IKE sy-"c0##,
s!>e_01 (IKE 01_c0e.
.
.
8O*)(E )SER_'O882&*_100 I&P)T.
s!>e_01 ; 01_c0e .
'(E2R 01_c0e .
'2SE s!>e_01.
W9E& 6C2'K6.
SET S'REE& 0.
W9E& 6S2GE6.
'2(( 3)&'TIO& 6C'400_)P*2TE_3(TI8E6
...
I3 sy-s"b/c ; 0.
...
E&*I3.
E&*'2SE.
E&*8O*)(E.
:n this e,a0&le &ro(ra0 t)o &ushbuttons shoul# tri((er chan(es in the $e&t screen $alue/
'BACK' shoul# auto0aticall% set this $alue to 0. "his sen#s the user back to the last screen calle# be'ore
the &resent one. :n %our e,a0&le &ro(ra0 %ou return to a basic list i' the #etails list bu''er has not been
'ille#* or* i' it has been 'ille#* a #etails list is #is&la%e#.
'#A$E' shoul# auto0aticall% sa$e the current #ata recor# in the #atabase b% callin( a 'unction 0o#ule.

SAP AG BC400 4.0 ABAP Workbench Basics 938
SAP Australia 12 October 1998 BC400

SAP AG
R
"dvanced %echni4ues: $creens
%abstrip Control
%able Controls
$ubscreens
Depart: city "rriva
7ran5furt
7ran5furt
Denver
/0//
/0/-
-0/2
;ew
;ew
$an F
7light
Depart: "rrival
Country
U$
City
%i!e
Denver
</:</://
Screens allo) %ou to &ro(ra0 user'rien#l% #ialo( in an o&ticall% structure# )a% that can onl% &artiall% be
#u&licate# on a selection screen or in a list.
:n a##ition* screens allo) %ou to use subscreen technolo(%* a kin# o' inclu#e technolo(% s&eciall% a#a&te# to
screens.

SAP AG BC400 4.0 ABAP Workbench Basics 939
SAP Australia 12 October 1998 BC400

SAP AG
R
Dialogs , Interfaces
Overview Overview
#ists #ists
$election $creens $election $creens
User Messages User Messages
Interfaces Interfaces
User Dialogs User Dialogs
$creens $creens
"his &art o' the unit teaches %ou ho) to create inter'aces usin( the <enu Painter.
At the conclusion o' this &art o' the unit* %ou )ill be able to/
Create a GE: title
Create a GE: status 'or lists an# screens that contains the 'ollo)in( subob.ects/ A 0enu bar* a stan#ar#
toolbar* an a&&lication toolbar* an# 'unction ke% settin(s.

SAP AG BC400 4.0 ABAP Workbench Basics 940
SAP Australia 12 October 1998 BC400

SAP AG
R
Overview: Interface Objects
7light !aster data )dit *oto $yste! +elp

7light data
6666
);%)R
7< +elp
7- Choose
7'
:
:
:
);%)R
7< +elp
7- Choose
7'
:
:
:
Menu bar
$tandard toobar
"pplication toolbar
@ey settings
GUI title
SET TIT(EC2R +$,.
GUI status
SET P3-ST2T)S +$,.
$"P R&' $"P R&'
All user inter'aces inclu#e the 'ollo)in( tools8ob.ects/
A title bar containin( the title o' the screen* selection screen* or list currentl% bein( #is&la%e#*
A menu bar )ith e,&an#able 0enus*
#enus containin( the e,ecutable 'unctions 'or the current &ro(ra0. <enus can also contain sub0enus.
"he FS%ste0F an# F;el&F 0enus contain the sa0e 'unctions on e$er% 78! screen an# cannot be altere# or
hi##en.
A standard toolbar containin( icons 'or those 'unctions 0ost o'ten use#. "he 78! stan#ar# toolbar al)a%s
contains the sa0e icons )ith stan#ar# 'unctions assi(ne# to the0. "hose stan#ar# 'unctions that cannot be
accesse# 'ro0 a &articular inter'ace are (ra%e# out.
Function $ey settings* )hich can be #is&la%e# b% clickin( on %our ri(ht 0ouse button. :#eall%* %ou shoul#
be able to e,ecute all 0enu 'unctions b% )a% o' 'unction ke%s as )ell.
An application toolbar containin( icons an# &ushbuttons 'or those 'unctions 0ost o'ten use# on the
current screen.
+ach &ro(ra0 is create# )ith an inter'ace containin( all o' the tools8ob.ects liste# abo$e. 2i''erent $ie)s o' this
inter'ace are then create# 'or a &ro(ra0Fs in#i$i#ual screens* selection screens* an# lists >GE: statuses?.

SAP AG BC400 4.0 ABAP Workbench Basics 941
SAP Australia 12 October 1998 BC400

SAP AG
R
)6a!ple Progra! Interface:
$"P R&' $"P R&'


Change 7light %i!e Change 7light %i!e
#ist #ist
7light !aster data
Print CtrlOP
$ave in PC file $hiftO73
$ave
)6it $hiftO7'


7light !aster data
Print
$ave in PC file
$ave CtrlO$
)6it
)dit *oto $yste! +elp
)dit *oto $yste! +elp
$creen $creen
/<// /<//
As a last ste&* an inter'ace )ill no) be #e'ine# 'or the e,a0&le &ro(ra0. "he $arious statuses )ill ha$e the
'ollo)in( characteristics/
"he sa0e 0enu bar )ill be a$ailable 'ro0 both the list an# the screen. Onl% those 0enu 'unctions that can
be e,ecute# )ill a&&ear in black.
:n the stan#ar# toolbar* onl% those 'unctions that can be e,ecute# )ill a&&ear in color. Screen 'unctionalit%
)ill not be altere# in an% )a%.
"he a&&lication toolbar on the basic list )ill contain an icon 'or FChooseF .ust as the stan#ar# list status
#oes.
"he screen )ill ha$e its o)n title.

SAP AG BC400 4.0 ABAP Workbench Basics 942
SAP Australia 12 October 1998 BC400

SAP AG
R
(asic Interface )le!ents
Menu bars
7light !aster data
!enu bar
@ey settings
@ey settings
7light !aster data
5ey settings
"pplication toolbar
7light !aster data
application toolbar
Menu bar
7light !aster data
)dit
*oto
%itle <//
7unction list
HP'
S2GE
RW
PI'K
$tandard
list
functions
C2'K
PRI HEE
PII P-- PI P-
All &ro(ra0 inter'aces inclu#e the 'ollo)in( subob.ects/
A title bar containin( the title o' the screen* selection screen* or list currentl% bein( #is&la%e#*
A menu bar )ith e,&an#able 0enus*
#enus re'errin( to inter'ace 'unctions* that can be calle# usin( transactions an# that all &ossess sel'
e,&lanator% ke%)or#s. Casca#in( 0enus can be #e'ine# b% re'errin( to another 0enu in the 0enu list
instea# o' to a 'unction co#e.
%ey settings are 0a#e u& o' the 'unction assi(n0ents to icons in the standard toolbar an# to the function
$eys >= ke%s?.
:0&ortant 'unction ke%s can also be assi(ne# to icons an# &ushbuttons in the a&&lication toolbar. :' nee#e#
0ore than one a&&lication toolbar can be use#.
Functions >'or e,a0&le *e%!ace* ind* or Cut? are assi(ne# 'unction co#es that are use# in the &ro(ra0 to
e$aluate user actions. A 'unction list contains all o' the 'unctions o' a s&eci'ic inter'ace. Stan#ar#iGe#
'unction co#es e,ist 'or lists.
Pro(ra0s can ha$e 0ulti&le 0enu bars* ke% settin(s* an# a&&lication toolbars. =or the e,a0&le &ro(ra0* onl%
one of each 0ust be create#. "he 0enu bar shoul# consist o' three 0enus.

SAP AG BC400 4.0 ABAP Workbench Basics 94!
SAP Australia 12 October 1998 BC400

SAP AG
R
$tatuses: Interface Giews
7light !aster data
!enu bar
7light !aster data
5ey settings
7unction list
HP'
S2GE
RW
PI'K
$tandard
list
functions
C2'K
PRI HEE
PII P-- PI P-
$tatus J#I$%J
$tatus J#I$%J
#ist
inactive
7light !aster data
application toolbar
A status is the actual 'or0 that a 0enu bar* a stan#ar# toolbar* an# an a&&lication toolbar take on 'or a
&articular screen )ithin %our &ro(ra0. A status #eter0ines )hich 'unctions are active or e,ecutable or inactive
an# not able to be e,ecute# 'or a &articular screen. 9ou can chan(e a screens status at PBO/ 'or e,a0&le* the
'unction F2is&la%8Chan(eF in the ABAP +#itor allo)s %ou to s)itch bet)een #i''erent statuses.
=ro0 a technical &oint o' $ie)* a status is al)a%s a reference to a &articular 0enu bar* stan#ar# toolbar* an#
a&&lication toolbar.
Do) letFs #e'ine a status 'or a list.

SAP AG BC400 4.0 ABAP Workbench Basics 944
SAP Australia 12 October 1998 BC400

SAP AG
R
ST2RT-O3-SE(E'TIO&.
SET P3-ST2T)S 6(IST6.
Creating *UI $tatuses for #ists
Create Object Create Object
%he P7 status #I$% does not e6ist:
Do you want to create the objectD
?es "bbr: ;o
Progra!
$tatus
$"P(C0//UDDH)M"MP#)H)
Create $tatus Create $tatus
$hort te6t
#I$%
D
$tatus type
Dialog status
Dialog bo6
#ist status
#ist in a dialog bo6
Double,clic5
9ou can create an# 0aintain statuses in one o' three #i''erent )a%s/
B% usin( the ob&ect list o' the 7e&ositor% Bro)ser*
B% usin( forward navigation in the ABAP +#itor*
or b% #irectl% usin( the #enu 'ainter.
When creatin( a status %ou can either create a ne) 0enu bar* a&&lication toolbar* an# ne) ke% settin(s %oursel'
>to& #o)n?* or use e,istin( ob.ects 'or %our inter'ace >botto0 u&?* or a use co0bination o' both 0etho#s.
Status na0es can ha$e a 0a,i0u0 o' 20 characters.
B% choosin( a status t%&e* %ou #eter0ine )hether a status re'ers to a nor0al screen or a list. Accor#in( to )hat
%ou ha$e chosen* #i''erent t%&es o' 'unctions are &ut at %our #is&osal.
Ese the state0ent #ET "'-#TATU# '<NAE>' to set the status o' a basic list b% &ro(ra00in( it into the
&rocessin( block that is &rocesse# a'ter the stan#ar# selection screen an# be'ore the list is sent. "he na0e o' the
status can contain u& to ei(ht characters >nu0bers or ca&ital letters?.

SAP AG BC400 4.0 ABAP Workbench Basics 94-
SAP Australia 12 October 1998 BC400

SAP AG
R
Creating $tatuses: @ey $ettings
"pplication toolbar
Positions <,2
@ey settings
Menu bar
7light !aster data 5ey settings
7light !aster data application toolbar
7light !aster data !enu bar
PIC@
Reco!!end function 5eys settings
7-
70
$hift,73
7reely assigned function 5eys
71
7.
72
73
7=
$hift,7<
$tandard toolbar
=:> !A$% R? SA8:
P#$% $hoose
PR# =S$ P@@ P@
9ou assi(n 'unction co#es to 'unction ke%s b% enterin( the0 into one o' the 'unction ke% settin(s sections. =or
F6istF statuses %ou can inclu#e stan#ar#iGe# 'unction co#es as )ell.
Ce% settin(s can be #i$i#e# into three areas/
Standard toolbar/ Certain &re#e'ine# 'unction co#es are 0an#ator% 'or the 'unctions Sa$e* Back* +,it
&ro(ra0* Cancel* Print* an# 'or the Scroll icons as )ell as 'or the +nter &ushbutton. Si0&l% assi(n these
co#es to the stan#ar# toolbar icon an# the% )ill be auto0aticall% assi(ne# to their corres&on#in(
&ushbutton.
Recommended function $ey settings
Freely assigned function $eys
"hose 'unction ke%s that are use# 0ost o'ten can be #e'ine# 'or a a&&lication toolbar &ushbutton. "hese
&ushbuttons can either be icons or &ushbuttons )ith te,t.

SAP AG BC400 4.0 ABAP Workbench Basics 943
SAP Australia 12 October 1998 BC400

SAP AG
R
Creating $tatuses: Menu (ars
Menu bar
"ppl: toolbar
7lt: !aster data )dit *oto
@ey settings
7light !aster data application toolbar
7light !aster data 5ey settings
7light !aster data !enu bar
Code %e6t
Print
$ave in PC file
$ave
)6it
PRI
PPC
$"G)
P)M
Code %e6t
Choose
7ind
7ind again
Cancel
PIC@
P$C
P$CO
R>
Code %e6t
(ac5 ("C@
:' so #esire#* nor0s )ill be su((este# 'or %our 0enu bar. "he% can* ho)e$er* be 0o#i'ie#.
<enu bars can contain u& to ei(ht 0enus. 9ou can #e'ine u& to si, o' these %oursel'* but the System an# +e!%
0enus are a##e# auto0aticall% b% the s%ste0.

SAP AG BC400 4.0 ABAP Workbench Basics 944
SAP Australia 12 October 1998 BC400

SAP AG
R
)6a!ple Progra! Interface
$tatus J$CR));J $tatus J$CR));J
$creen $creen
/<// /<//
$creen $creen
/<// /<//
7light !aster data
!enu bar
7light !aster data
5ey settings
7light !aster data
application toolbar
7unction list
HP'
S2GE
RW
PI'K
$tandard
list
functions
C2'K
PRI HEE
PII P-- PI P-
$tatus J#I$%J $tatus J#I$%J
#ist #ist
inactive
7light !aster data
)dit
*oto
%itle <//
:n or#er to co0&lete our e,a0&le &ro(ra0 inter'ace* )e 0ust create title an# status 'or the screen in a##ition to
the basic list status. "he screen status shoul# re'er to the sa0e 0enu bar* a&&lication toolbar* an# ke% settin(s
as the list status. "he onl% #i''erence shoul# be that all stan#ar# 'unctions shoul# be set to Finacti$eF e,ce&t
FBACK' an# F#A$EF .
"he 'ollo)in( ob.ects all can be &art o' an inter'ace/
=unctions
<enus
<enu bars
Ce% settin(s
A&&lication toolbars
Statuses
"itles

SAP AG BC400 4.0 ABAP Workbench Basics 948
SAP Australia 12 October 1998 BC400

SAP AG
R
8O*)(E st!t"s_0100 O)TP)T.
7 SET P3-ST2T)S 6xxxxxxxx6.
SET TIT(EC2R 61006.
E&*8O*)(E.
Creating *UI %itles for a $creen
$reate 2b<ect $reate 2b<ect
%itle <// does not e6ist:
Do you want to create the objectD
?es Cancel ;o
Progra!
%itle code
$"P(C0//UDDH)M"MP#)H)
Create %itle Create %itle
%itle
<//
Change 7light %i!es
$ave Cancel
Double,clic5
9ou can create an# 0aintain titles in one o' three #i''erent )a%s/
B% usin( the ob&ect list o' the 7e&ositor% Bro)ser*
B% usin( forward navigation in the ABAP +#itor*
or b% #irectl% usin( the #enu 'ainter.
Status na0es can ha$e a 0a,i0u0 o' 20 characters.
Ese the ABAP state0ent #ET TITLEBAR <nnn> in a PBO 0o#ule to set screen titles. nnn is three
character nu0ber se1uence. :' %ou create the su((este# PBO 0o#ule st3t+s_nnnn usin( 'or)ar# na$i(ation*
this state0ent is auto0aticall% (enerate# in the 0o#ule an# starre# out. Acti$ate the state0ent b% erasin( the
star an# enterin( the nu0ber o' the title. "he title can subse1uentl% be create# usin( 'or)ar# na$i(ation.

SAP AG BC400 4.0 ABAP Workbench Basics 949
SAP Australia 12 October 1998 BC400

SAP AG
R
8O*)(E st!t"s_0100 O)TP)T.
SET P3-ST2T)S 6S'REE&6.
SET TIT(EC2R 61006.
E&*8O*)(E.
Creating *UI $tatuses for a $creen
$reate 2b<ect $reate 2b<ect
P7,$tatus $CR)); does not e6ist:
Do you want to create the objectD
?es "bbr: ;o
Progra!
$tatus
$"P(C0//UDDH)M"MP#)H)
$reate Status $reate Status
$hort te6t
$CR));
D
$tatus type
Dialog status
Dialog bo6
#ist status
#ist in a dialog bo6
Double,clic5
:n or#er to create a status 'or a screen/
Create a PBO 0o#ule containin( the state0ent #ET "'-#TATU# '<NAE>'7 NAE can contain u& to
ei(ht nu0bers or ca&ital letters. "his state0ent is &re(enerate# )hene$er %ou create the 0o#ule
st3t+s_nnnn usin( 'or)ar# na$i(ation.
Create the status usin( 'or)ar# na$i(ation
Choose F2ialo(F as %our status t%&e
Ese the =4 hel& to #is&la% the ke% settin(s an# 0enu bar* an# then
Set those 'unctions %ou )ant to acti$ate. :n our e,a0&le these are the 'unctions 'BACK' an# '#A$E'7
"hese 'unction co#es are also e$aluate# in the PA: 0o#ule .ust as a screenFs &ushbutton 'unction co#es. :' %ou
)ant to inclu#e a##itional 'unction co#es* %ou can e,&an# the PA: 0o#ule* in )hich the 'unction co#es are
1uerie#. >:n the e,a0&le U#ER_COAND_1611?.

SAP AG BC400 4.0 ABAP Workbench Basics 980
SAP Australia 12 October 1998 BC400

SAP AG
R
%itle and $tatus
#ist
SET TIT(EC2R
+$,
SET P3-ST2T)S
+$,
$tandard sel: screen&
$el: screen
SET TIT(EC2R +$,
/
'2(( SE(E'TIO&-
S'REE& TIT(E +$,
& -
$creen
SET TIT(EC2R
+$,
SET P3-ST2T)S
+$,
$tandard
title
Dyna!ic
title
$tandard
status
Dyna!ic
status
6ists an# selection screens ha$e standard titles an# standard statuses.
9ou can set titles usin( the ABAP state0ent SET TIT(EC2R +$$$,( "his o$er)rites the stan#ar# title* i'
one has been set. $$$ stan#s 'or a three character nu0ber se1uence. "he sin(le e,ce&tion to this rule are
in#e&en#ent selection screens )hich store their title as an attribute )hen calle#.
9ou can set status in lists an# screens usin( the ABAP state0ent SET P3-ST2T)S 6+&28E,6. NAE can
contain u& to ei(ht characters >nu0bers or ca&ital letters?.
A GE: title or GE: status that has been set usin( #ET TITLEBAR <nnn> -r #ET "'-#TATU#
'<NAE>' is al)a%s $ali# )ithin a &ro(ra0 until a ne) GE: title or GE: status is set.
"he current title is al)a%s containe# in s%ste0 'iel# sy-title.
S%ste0 'iel# sy-%.1ey al)a%s contains the current status.

SAP AG BC400 4.0 ABAP Workbench Basics 981
SAP Australia 12 October 1998 BC400

SAP AG
R
$u!!ary: Interfaces
#ist $election screen $creen
Interface
Color
Data input
%ype chec5
7oreign 5ey chec5
Co!ple6 generic
entry
Data output
$tring search
Print
Gariants
"here are three #i''erent kin#s o' user #ialo(s/ 6ists* selection screens an# screens.
6ists out&ut #ata
Selection screens allo) %ou to or(aniGe #ata in a co0&le, 0anner so as to 'acilitate subse1uent #ata selection.
A 0a.or a#$anta(e o' both lists an# selection screens is that stan#ar# e,a0&le inter'aces 'or both o' these t%&es
o' #ialo( alrea#% e,ist in the s%ste0.
Screens are use# 'or both #ata entr% an# #is&la%.
One o' the 0ain stren(ths o' a screen is that ABAP 2ictionar% technolo(% allo)s %ou to check the consistenc%
o' #ata entere# b% the user.

SAP AG BC400 4.0 ABAP Workbench Basics 982
SAP Australia 12 October 1998 BC400

SAP AG
R
$u!!ary
"n interface is an independent progra! object that is
!ade up of a title and a status: $tatuses are created using
the Menu Painter:
#ists selection screens error dialogs and screens are
the different 5inds of user dialog:
#ists output data:
$election screens allow you to organiLe data in a co!ple6
!anner:
Online !essages include error !essages notification
!essages warning !essages and success !essages:
$creens allow you to chec5 the consistency of data
entered by the user and are created using the $creen
Painter:

SAP AG BC400 4.0 ABAP Workbench Basics 98!

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