Читайте также: |
|
285 Exercise 16: Screens: Specifying the Next
Screen Dynamically
Exercise Duration: 40 Minutes
Exercise Objectives
After completing this exercise, you will be able to:
• Create pushbuttons on screens
• Evaluate the function codes triggered by the user by means of pushbuttons in order to control the program flow accordingly
• Set subsequent screens dynamically
Business Example
On the screen of your program ZBC400_##_DYNPRO_1 two pushbuttons with appropriate functions are to be implemented.
System Data
System: Will be assigned Client: Will be assigned User ID: Will be assigned Password: Will be assigned
Set up instructions: No special instructions when using a standard training system
Task 1:
Define the pushbuttons
1. Extend your program ZBC400_##_DYNPRO_1 or copy the template SAPBC400UDS_DYNPRO_2 to the new name ZBC400_##_DYNPRO_3 for further processing.
2. On the screen, define a pushbutton for returning to the basic list (Back) and one for saving the changed data in the database (Save).
Name of pushbutton | Text | Function code |
PUSH_BACK | Back | BACK |
PUSH_SAVE | Save (or icon ICON_SYSTEM_SAVE) | SAVE |
Continued on next page
Task 2:
Implement dynamic control of subsequent screens
1. Name the 'OK' type field on the screen and define a data object of the same name (and corresponding type) in the program. We suggest the name OK_CODE.
2. Navigate in the flow logic. Create a PAI module by means of forward navigation. In it, implement the following function code handling:
Function code | Action |
BACK | Back to basic list |
SAVE | Output information message 060 of message class BC400 and return to basic list |
Any other action | Process screen 100 again |
3. Ensure that choosing Enter always displays screen 100, regardless of the navigation history. To do this, initialize the ok code field in a PBO module.
Solution 16: Screens: Specifying the Next
Screen Dynamically
Task 1:
Define the pushbuttons
1. Extend your program ZBC400_##_DYNPRO_1 or copy the template SAPBC400UDS_DYNPRO_2 to the new name ZBC400_##_DYNPRO_3 for further processing.
a) Carry out this step as usual.
2. On the screen, define a pushbutton for returning to the basic list (Back) and one for saving the changed data in the database (Save).
Name of pushbutton | Text | Function code |
PUSH_BACK | Back | BACK |
PUSH_SAVE | Save (or icon ICON_SYSTEM_SAVE) | SAVE |
a) Carry out this step as described in the training material.
Task 2:
Implement dynamic control of subsequent screens
1. Name the 'OK' type field on the screen and define a data object of the same name (and corresponding type) in the program. We suggest the name OK_CODE.
a) Carry out this step as described in the training material. b) See source code excerpt in the model solution.
2. Navigate in the flow logic. Create a PAI module by means of forward navigation. In it, implement the following function code handling:
Continued on next page
Function code | Action |
BACK | Back to basic list |
SAVE | Output information message 060 of message class BC400 and return to basic list |
Any other action | Process screen 100 again |
a) See source code excerpt in the model solution.
3. Ensure that choosing Enter always displays screen 100, regardless of the navigation history. To do this, initialize the ok code field in a PBO module.
a) See the source code excerpt in the model solution.
Result
Source code excerpt: SAPBC400UDS_DYNPRO_3
REPORT sapbc400uds_dynpro_3.
CONSTANTS: actvt_display TYPE activ_auth VALUE ’03’, actvt_change TYPE activ_auth VALUE ’02’.
PARAMETERS pa_anum TYPE sbook-agencynum.
* workarea for SELECT
DATA wa_sbook TYPE sbook.
* workarea for data communication with screen
TABLES sdyn_book.
* variable for function code of user action
Дата добавления: 2015-11-16; просмотров: 83 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
CALL SCREEN 100. | | | MODULE user_command_100. |