SET


Basic form 1

SET PF-STATUS pfstat.

Additions



1. ... EXCLUDING f or ... EXCLUDING itab
2. ... IMMEDIATELY

Effect

Sets a GUI (Graphical User Interface) status pfstat which can be up to 8 characters long. There are many of these statuses in the GUI of a program. Each one describes which functions are available and how you can select these via menus and menu bars or by pressing function keys or pushbuttons. For further information about this, refer to the Menu Painter documentation.

Setting a status makes the functions contained therein selectable.

This method allows you to vary the available functions according to the current screen, list level and/or previous program flow.

The current status is stored in the system field SY-PFKEY .

A status remains valid until reset.

Example

Event in program:
START-OF-SELECTION. SET PF-STATUS 'MAIN'. WRITE SY-PFKEY. AT USER-COMMAND. CASE SY-UCOMM. WHEN 'F001'. SET PF-STATUS '0001'. WRITE SY-PFKEY. ... ENDCASE.
Produces a list (contents MAIN ) with a GUI framework which allows you to select functions assigned to the the status MAIN . If you choose the function code F001 (e.g. from the menu or by pressing a pushbutton), you trigger the event AT USER-COMMAND . This generates a details list (contents 0000) with a GUI framework which allows you to select functions assigned to the status 0001 . On returning from the details list to the basic list the status MAIN is reactivated.

Example

PBO module:

MODULE PBO_100 OUTPUT.
SET PF-STATUS 'S001'.
ENDMODULE.
Displays the screen 100 with a GUI framework which allows you to select functions assigned to the status S001 .

Notes

Addition 1

... EXCLUDING f
... EXCLUDING itab

Effect

Deactivates one or more of the status functions, so that they cannot be selected. Specify the appropriate function codes using one of the following:
This method allows you simply to modify the selectable functions of a status at runtime.

Example

DATA: BEGIN OF TAB OCCURS 10, FCODE(4), END OF TAB. REFRESH TAB. MOVE 'DELE' TO TAB-FCODE. APPEND TAB. MOVE 'AUSW' TO TAB-FCODE. APPEND TAB. SET PF-STATUS 'STA3' EXCLUDING TAB.
Sets the status STA3 which renders the functions with the function codes DELE and AUSW inactive.

Addition 2

... IMMEDIATELY

Effect

List processing: The status becomes effective for the last list displayed and is not flagged for the next details list. In screen processing, this addition has no effect because every status becomes immediately effective anyway.

Example

Event in program:
START-OF-SELECTION. SET PF-STATUS 'MAIN'. WRITE SY-PFKEY. AT USER-COMMAND. CASE SY-UCOMM. WHEN 'F002'. SET PF-STATUS '0002' IMMEDIATELY. EXIT. ... ENDCASE.
Selecting the function F002 in the basic list (contents MAIN , status MAIN ) redisplays the basic list, but this time with the status 0002 .

Note

Without the addition ... IMMEDIATELY , the old status MAIN becomes active again.

Index
© SAP AG 1996