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

APPLICATION DELIVERY FUNDAMENTALS: SAP ABAP UNIT: DIALOG PROGRAMS

MODULE: DIALOG PROGRAMS

Exercise 56 & 57– Create PAI Modules and Use Screen


Sequencing Sentences

Estimated Completion Time: 45 minutes

Overview
This exercise requires participants to create PAI modules CHECK_0100, USER_COMMAND_0100 and
USER_COMMAND_0200. These modules will do the necessary checks on the entered data and will
manage the different functionalities of the screens. In this exercise the user will also user the abap
sentences to control dynamically the screen sequence.

Instructions

1. Using the transactions SE38, SE80 or directly in the Screen painter (SE51), go to the Flow Logic tab
of the screen 0100. Once there, in the Process After Input event, write a call to the module
CHECK_0100.
2. Double click on the module name. The system will detect that the module does not exists and
will ask for its creation. Press Yes and select the include MZ…..I01 already created in a previous
exercise. Remember that the include MZ…..I01 is the include which will contain the PAI module
definitions.

3. In the module definition (include MZ…..I01) we can code the necessary statements to check the
values entered by the user in the fields spfli-carrid and spfli-connid. In this module we perform
two different checks:
a. Will check if the value entered in spfli-carrid is a valid Airline (check with values in table
scarr). If the airline does not exist in scarr then show a corresponding error message.
b. Will check if the combination of spfli-carrid and spfli-connid is a valid flight combination
(check with values in table spfli). If the combination does not exist in spfli then show a
corresponding error message.
4. Save and activate the include MZ…..I01 and the screen 0100.
5. Proceed in a similar way to create also the module USER_COMMAND_0100 in screen 0100.
Inside this module we will manage the different options that the user can choice in the screen:
Display Flight Details, Back, Exit and Cancel.

Z16830 1 Exercises 56 and 57.doc

Copyright © 2015 Accenture. All Rights Reserved. ***Confidential – For Company Internal Use Only***
APPLICATION DELIVERY FUNDAMENTALS: SAP ABAP UNIT: DIALOG PROGRAMS

MODULE: DIALOG PROGRAMS

a. If the user select Display Flight Details (OK_CODE_0100 will be equal to DDETA), the
program will do the appropriate selection to obtain the flight data and will call to screen
0200. To do that we will use the sentence LEAVE TO SCREEN 0200.
b. If the user select Cancel (OK_CODE_0100 will be equal to CANC), then the program will
do nothing since we are in the initial screen.
c. If the user select Back (OK_CODE_0100 will be equal to BACK) or Exit (OK_CODE_0100
will be equal to EXIT) we will exit the program. To do that we will use the sentence
LEAVE PROGRAM.
6. Repeat the previous steps now for screen 0200 and PAI module USER_COMMAND_0200. In this
case the code is simpler than that in screen 0100 since we will only manage the options Back, Exit
and Cancel. Note that the module USER_COMMAND_0200 will be invoked from the PAI event
of screen 0200 but will be also defined in the include MZ…..I01.
a. If the user select Cancel (OK_CODE_0200 will be equal to CANC) or Back
(OK_CODE_0200 will be equal to BACK) then the program will return to screen 0100.
b. If the user select Exit (OK_CODE_0200 will be equal to BACK) we will exit the program.
7. Save and activate the include MZ…..I01 and the screen 0200.

Expected Result
Both screens 0100 and 0200 has the PAI event filled with the required modules. All the PAI module
definitions must be in the include MZ…..I01.

Z16830 2 Exercises 56 and 57.doc

Copyright © 2015 Accenture. All Rights Reserved. ***Confidential – For Company Internal Use Only***
APPLICATION DELIVERY FUNDAMENTALS: SAP ABAP UNIT: DIALOG PROGRAMS

MODULE: DIALOG PROGRAMS

Z16830 3 Exercises 56 and 57.doc

Copyright © 2015 Accenture. All Rights Reserved. ***Confidential – For Company Internal Use Only***

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