|
When the system detects a PF## function code, the “AT PF##” event is triggered (where ## corresponds to the same 2-digit number in the function code). When a report program contains an AT PF## event, the system supplies default assignments of certain function keys to corresponding PF## function codes. For example, the following function codes are matched with their corresponding function keys : PF05 through PF09 and PF13, PF14, PF16, PF17, PF18, PF19 are matched with function keys F5 through F9 with shift key pressed. This means that these function codes are preset, ready for you to use with their corresponding AT PF## events.
Here’s a simple example: START-OF-SELECTION WRITE :/ 'Hi'. AT PF06. Write :/ 'User Pressed F6 Key'. AT PF07. Write :/ 'User Pressed F7 Key'.
If you want to write AT PF## events for function keys 13 through 24, the user will have to hold down the shift key on the keyboard. For example, to initiate the AT PF14 event the user must hold down the shift + F2 keys. AT PF## events for function keys 1 through 12 do not require the user to hold down any additional keys. The ABAP processor reserves some function keys. The slide above contains a chart that shows the SAP reserved function keys.. As a programmer, you are capable of writing code that reacts to virtually all of the function keys. However some function keys are reserved for ABAP functions. This is done to maintain a certain level of consistency. Example: F1 will always be used by the end-user to initiate the online help system. 
Remember: Event processing blocks end when: - Another event key word is encountered
- A subroutine (i.e., a FORM statement) is encountered
Creating a new Window: Example: WINDOW STARTING AT 10 4 ENDING AT 77 12. The above statement will create a new window starting at 10 4 and will end at 77 12. This statement is used to create new windows to open detail lists. Your program can have up to 20 detail lists open at one time. To maintain the number of additional lists that are created by the user we use the system field SY-LSIND. SY-LSIND contains an index that increments whenever a user event (event which occurs during the list display) is triggered. SY-LSIND is incremented before the event processing block is executed. A detail list is created whenever a WRITE, SKIP, or ULINE statement is encountered in a user event. If no WRITE, SKIP, or ULINE statement is encountered in a user event (and therefore no detail list created), SY-LSIND automatically decrements back to the previous level.
|