SET PF-STATUS

SET PF-STATUS...

Additions:

1. ... EXCLUDING f or ... EXCLUDING itab
2. ... IMMEDIATELY
3. ... OF PROGRAM progname

Effect

Sets a GUI (Graphical User Interface) status pfstat which can be up to 20 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.
Each status has a name which may be up to 8 characters long.

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 for the duration of a transaction or until you set a new status.

Note

You can use a namespace prefix with status names.

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 secondary list (contents 0001) with a GUI framework which allows you to select functions assigned to the status 0001. On returning from the secondary list to the basic list the status MAIN is reactivated.

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.

Note

The system always searches for the status pfstat in the GUI of the main program of the current program group. (However, see also the addition OF PROGRAM progname.)

Example


PROGRAM PROGRAM1.
...
PERFORM UP1 (PROGRAM2):
...

PROGRAM PROGRAM2.
...
FORM UP1.
SET PF-STATUS 'ABCD'
ENDFORM:

The status ABCD of program PORGRAM1 is activated if PROGRAM1 is the program specified in the transaction definition.

If no GUI is defined in the list processing (or it is deactivated with SET PF-STATUS SPACE ), the system supplies a standard user interface.

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 to modify the selectable functions of a status easily at runtime.

Example

DATA: BEGIN OF TAB OCCURS 10, 
		FCODE LIKE RSMPE-FUNC, 
	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.

Effect

List processing: The status becomes effective for the last list displayed and is not flagged for the next secondary 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.

Effect

The system does not look for the status pfstat in the GUI of the main program of the current program group, but in the program whose name is specified in the field progname.

DATA PROGR LIKE SY-REPID.

...

MOVE 'TESTPROG' TO PROG.

...

SET PF-STATUS 'ABCD' OF PROGRAM PROG.

The system activates the status ABCD of program TESTPROG.

Note

You can use the OF PROGRAM addition in conjunction with the EXCLUDING itab and IMMEDIATLEY additions.