Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Where will i use SET-PF-STATUS?

Former Member
0 Kudos

HOW TO CREATE MENUBAR,TITILE BAR,APPLICATION? IN MY PROGRAM BELOW.......

REPORT YINTERACTIVEPROGRAM02 NO STANDARD PAGE HEADING.

TABLES:YEMPLOYEE,YEMPLOYEEDB.

TYPES: BEGIN OF TY_EMPLOYEE,

EMP_ID TYPE YEMPLOYEE-EMP_ID,

EMP_NAME TYPE YEMPLOYEE-EMP_NAME,

EMP_ADDR TYPE YEMPLOYEE-EMP_ADDR,

EMP_PROFILE TYPE YEMPLOYEE-EMP_PROFILE,

END OF TY_EMPLOYEE.

DATA:I_EMPLOYEE TYPE STANDARD TABLE OF TY_EMPLOYEE WITH HEADER LINE.

START-OF-SELECTION.

SELECT * FROM YEMPLOYEE INTO CORRESPONDING FIELDS OF TABLE I_EMPLOYEE.

LOOP AT i_EMPLOYEE.

WRITE: I_EMPLOYEE-EMP_ID,' ',

I_EMPLOYEE-EMP_NAME,' ',

I_EMPLOYEE-EMP_ADDR,' ',

I_EMPLOYEE-EMP_PROFILE.

HIDE:I_EMPLOYEE-EMP_ID.

SKIP.

ENDLOOP.

TOP-OF-PAGE.

WRITE: 'PRODUCT INFORMATION'.

SKIP.

WRITE: 'EMPLOYEE ID ',

'EMPLOYEE NAME ',

'EMPLOYEE ADDR ',

'EMPLOYEE PROFILE'.

ULINE.

END-OF-PAGE.

WRITE: 'ENJOY'.

END-OF-SELECTION.

AT LINE-SELECTION.

CHECK SY-LSIND = 1.

WINDOW STARTING AT 10 5

ENDING AT 99 12.

WRITE: 'YOU HAVE SELECTED ITEM:'.

ULINE.

WRITE: 'EMPLOYEE ID ',

'EMPLOYEE NAME ',

'EMPLOYEE ADDR ',

'EMPLOYEE PROFILE'.

ULINE.

SKIP.

WRITE:SY-LISEL.

ULINE.

SELECT * FROM YEMPLOYEEDB WHERE EMP_ID = I_EMPLOYEE-EMP_ID.

WRITE:'EMP_AGE '.

WRITE:'EMP_GENDER'.

SKIP.

WRITE:YEMPLOYEEDB-EMP_AGE.

WRITE:' '.

WRITE:YEMPLOYEEDB-EMP_GENDER.

ENDSELECT.

IF SY-SUBRC <> 0.

WRITE: 'NO DATA FOR SELECTED ITEM'.

ENDIF.

5 REPLIES 5

Former Member
0 Kudos

Hi,

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.

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 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.

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.

Note

If you want to set a status for a screen, you must do so during the PBO event. 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 IN PROGRAM PROGRAM2.

...

PROGRAM PROGRAM2.

...

FORM UP1.

SET PF-STATUS 'ABCD'

ENDFORM:

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

Notes

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.

This statement converts the contents of the field pfstat to type C. The converted value is used to search for the desired status. Since the conversion employs the standard conversion rules as for MOVE, you should use a field of type C for pfstat to avoid unwanted conversions. In this case, a field of type I with a value of 12 would give the key ' 12 '.

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:

a field f or a literal which contains a function code

an internal table itab which contains several function codes

This method allows you to modify the selectable functions of a status easily at runtime.

Example

DATA: itab TYPE TABLE OF sy-ucomm.

APPEND 'DELE' TO itab.

APPEND 'PICK' TO itab.

SET PF-STATUS 'STA3' EXCLUDING itab.

Sets the status STA3 which renders the functions with the function codes DELE and PICK inactive.

Addition 2

... IMMEDIATELY

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.

Addition 3

... OF PROGRAM progname

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.

Note

Only use this addition if the status contains no dynamic texts.

Since the system searches for the texts in the program to which the status belongs (that is, in program progname) the calling program will not be able to fill the dynamic texts. External statuses containing dynamic texts should be assigned to a function group, and activated by a function module that both fills the dynamic text fields and sets the status.

Example

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.

Regards,

PRitha.

Reward if helpful

Former Member
0 Kudos

SET PF-STATUS

is nothing but "set processing function status" using this u can able to create menu bar title bar and application tool bar in ur program.

try with this program, i hope u can understand with this saple program

TABLES : MARA, MARC.

SET PF-STATUS 'MENU'.

WRITE : 'THIS IS MY MENU PROGRAM'.

AT USER-COMMAND.

IF SY-UCOMM = 'MARA'.

SELECT * FROM MARA.

WRITE : / MARA-MATNR, MARA-ERSDA, MARA-MATNR.

ENDSELECT.

elseif SY-UCOMM = 'MARC'.

SELECT * FROM MARC.

WRITE : / MARC-MATNR, MARC-WERKS, MARC-PSTAT.

ENDSELECT.

ELSE.

LEAVE PROGRAM.

ENDIF.

only you have to do is ''DOUBLE CLICK ON SET PF-STATUS'

IT WILL TAKE U TO SE 41 SCREEN

SELECT MENU BAR AND ENTER YOUR MENU NAME

APPLICATION BAR ENTER YOUR APPLICATION MENU BARS

FUNCTION KEY AND ENTER FUNCTION KEY YOU PREFER

REWARD IF ITS USEFUL

varma_narayana
Active Contributor
0 Kudos

Hi..

To create Menubar, Toolbars and Title bar : Goto Tcode SE41.

Enter the program name , GUI status name and create it.

You can call them IN program using :

SET PF-STATUS 'ABC' . "For GUI status i.e Menu bar, App toolbar

SET TITLEBAR 'T1'. "For Titlebar.

<b>Reward if Helpful.</b>

Former Member
0 Kudos

hI

SET PF-STATUS WILL BE USED WHERE YOU WANT TO APPLY THAT CHANGES

SUPPOSE IF YOU WANT TO CHANGE THE SCREEN OF THE OUTPUT THEN USE THATSTATEMENT AT

During list processing, this statement sets the GUI status specified in status for the display window of the current list, and all subsequent list levels until the next SET PF-STATUS statement. The statement mainly has the same function as for screens.

In contrast to the screen layouts of screens, however, every list level is automatically linked to the GUI status that is set for it. If the user returns from displaying a higher list level to a lower list level, the latter is redisplayed with the GUI status that was set for it.

If the status of the data object is initial, the standard list status is set and the additions OF PROGRAM and EXCLUDING have no effect. The standard list status contains predefined list-specific functions whose functions are handled by the runtime environment during the display of a screen list, and do not lead to the call of event blocks in the ABAP program. If event blocks are also defined with AT LINE-SELECTION or AT PF##, further function keys are automatically assigned function codes in the standard list status:

If AT LINE-SELECTION is used, the F2 key and the double click function of the mouse is assigned the function code PICK and the function text Select. This function is then also automatically displayed in the application toolbar.

If AT PF## is used, all the F## functions of the keyboard that are not handled by the runtime environment are assigned the function codes PF##, where ## is a number between 01 and 24.

<b>REWARD IF USEFULL</b>

Former Member
0 Kudos

hI

USE THAT AFTER START-OF-SELECTION

TO APPLY THAT SCREEN CHANGES IN THE OUTPUT SCREEN

REWARD IF USEFULL