2005 IBM Corporation Graphical User Interface | 6.09 March-2005
Graphical User Interface IBM Global Services 2005 IBM Corporation 2 March-2005 Graphical User Interface | 6.09 Objectives The participants will be able to: Create a GUI status for online programs. Set the GUI status in the PBO event. Check the function codes using the user-defined field OKCODE. IBM Global Services 2005 IBM Corporation 3 March-2005 Graphical User Interface | 6.09 Overview Academy Awards Year Category 1994 PIC Exit Edit Loop Academy Awards Year Winner Forrest Gump Notes The Shawshank Redemption should have won. Exit Update Menu Painter Using the Menu Painter, we can add pushbuttons to the application toolbar on both screens. ***Important Questions*** Where do you set the GUI status/title? What type of GUI status is used? How do you check the function code triggered? What are the different function types? 1994 PIC Category IBM Global Services 2005 IBM Corporation 4 March-2005 Graphical User Interface | 6.09 Menu Painter Menu Painter Create function codes with a 20-character (maximum) identifier. Function Key Assignments Standard Toolbar Application Toolbar Menu bar IBM Global Services 2005 IBM Corporation 5 March-2005 Graphical User Interface | 6.09 Set GUI Status/Title in PBO Module ** MZA05O01 - PBO Modules ** MODULE INITIALIZE OUTPUT. IF SY-DYNNR = 9000. SET PF-STATUS FIRST. SET TITLEBAR ONE. ELSE. SET PF-STATUS SECOND. SET TITLEBAR TWO. ENDIF. ENDMODULE.
PROCESS BEFORE OUTPUT. MODULE INITIALIZE. Screen 9000
PROCESS BEFORE OUTPUT. MODULE INITIALIZE. Screen 9001 SY-DYNNR = Current screen number Notice that the call to module INITIALIZE in the PBO of each screen refers to the same ABAP module. IBM Global Services 2005 IBM Corporation 6 March-2005 Graphical User Interface | 6.09 GUI Status Type Screen type defined in the Screen Attributes of the Screen Painter. GUI status type defined in the Menu Painter. Screen Type Normal GUI Status Type Online Status Screen Type Modal Dialog Box GUI Status Type Dialog Box IBM Global Services 2005 IBM Corporation 7 March-2005 Graphical User Interface | 6.09 GUI Status Type (Contd.) Screen type defined in the Screen Attributes of the Screen Painter. GUI status type defined in the Menu Painter. Screen Type Normal GUI Status Type Online Status Screen Type Modal Dialog Box GUI Status Type Dialog Box IBM Global Services 2005 IBM Corporation 8 March-2005 Graphical User Interface | 6.09 Checking Function Code Triggered ** MZA05TOP - Top Include ** PROGRAM SAPMZA05 MESSAGE-ID ZA. TABLES YMOVIE. DATA OKCODE(4). To check the OK Code of an online program, you must define this field in both the screen (Field List) and the program work area (Top Include). Remember that these fields must be given the same name. IBM Global Services 2005 IBM Corporation 9 March-2005 Graphical User Interface | 6.09 Checking Function Code Triggered (Contd.) ** MZA05TOP - Top Include ** PROGRAM SAPMZA05 MESSAGE-ID ZA. TABLES YMOVIE. DATA OKCODE(4). To check the OK Code of an online program, you must define this field in both the screen (Field List) and the program work area (Top Include). Remember that these fields must be given the same name. IBM Global Services 2005 IBM Corporation 10 March-2005 Graphical User Interface | 6.09 Using the OKCODE ** MZA05I01 - PAI Modules ** MODULE SELECT_LISTING INPUT. IF OKCODE = EDIT. * code to select record from YMOVIE ENDIF. ENDMODULE. ** MZA05O01 - PBO Modules ** MODULE INITIALIZE OUTPUT. * code to set GUI status/title CLEAR OKCODE. ENDMODULE. Academy Awards Year Category 1994 PIC Exit Edit Loop We only want to select a record from YMOVIE if the user has invoked the EDIT function code (e.g., clicked on the Edit pushbutton). You should clear out the OKCODE before a screen is so an old value does not remain if the user presses Enter. IBM Global Services 2005 IBM Corporation 11 March-2005 Graphical User Interface | 6.09 Function Types Function Code: Function codes of different types can be created Type :Program Function Type E : Exit Command Type S : System Function Type T :Start Transaction Type P : Local GUI Function IBM Global Services 2005 IBM Corporation 12 March-2005 Graphical User Interface | 6.09 Function Types (Contd.) Function Code: Function codes of different types can be created Type :Program Function Type E : Exit Command Type S : System Function Type T :Start Transaction Type P : Local GUI Function IBM Global Services 2005 IBM Corporation 13 March-2005 Graphical User Interface | 6.09 Demonstration Creation of an online program to display a academy awards screen. Setting up the GUI status and title of the above screen. Using OKCODE in the program to process the screen.
IBM Global Services 2005 IBM Corporation 14 March-2005 Graphical User Interface | 6.09 Practice Creation of an online program to display a academy awards screen. Setting up the GUI status and title of the above screen. Using OKCODE in the program to process the screen.
IBM Global Services 2005 IBM Corporation 15 March-2005 Graphical User Interface | 6.09 Summary A programs GUI is created in the Menu Painter. Each program has a single GUI that contains the defined function codes. A GUI is made up of one or many statuses. A GUI status can be one of four types: List Status, List in the Dialog Box, Online Status, Dialog Box. Another aspect of a GUI is the title bar. You can define any number of title bars for a particular GUI.
IBM Global Services 2005 IBM Corporation 16 March-2005 Graphical User Interface | 6.09 Summary (Contd.) To determine what function code the user invoked during the execution of an online program, you can check two fields: OK Code and SY-UCOMM. Both of these fields are updated with the function code invoked by the user. However, under certain circumstances, SY-UCOMM is not updated. For this reason, in online programming you should always check the OK Code. Function codes of different types can be created: - Program function, E - Exit command, S - System function, P - Local GUI function, T - Start transaction.
IBM Global Services 2005 IBM Corporation 17 March-2005 Graphical User Interface | 6.09 Questions What is the use of the Menu Painter ? What is a Function Code ? What are the different types of function codes that can be created ?