Application Development and Automation 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: 
Read only

pf status

Former Member
0 Likes
1,949

Hi,

what is pf status? and how to assign a pf status to the screen which i have designed.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,507

Hi Viki,

PF-STATUS is used to set the GUI Status of a screen, ie you can control the options on your menu bar, application toolbar, the function keys assigned to various options etc.

Implementing the status for a screen can be done in 2 ways:

1) Create the GUI status using the object list of the program or by using the transaction SE41. Then, assign it to the screen using SET PF-STATUS statement.

2) Create the GUI status by means of forward navigation, ie, use the SET PF-STATUS 'XXX' statement where 'XXX' is the name of the GUI status and double click on it to create it.

Status names can have a maximum of 20 characters.

After assigning a GUI status to a screen, this is inherited to all subsequent screens. In order to have a different status for each of the subsequent screens, you have to set a separate status for each screen.

In transaction SE41,

1) Give the program name and the status name and click on the Create button.

2) Go to 'Function keys' and expand.

3) On top of the save icon type SAVE, on top of the back icon type BACK, on top the the exit icon type EXIT etc ie on top of all the icons that you want to use, type the respective names that you want to give.

Whatever you have typed now becomes the function codes of these icons and can be used in your program.

For example you have a screen 100.

In the 'Element list' tab of the screen, give "ok_code" as the name where "OK" is the type of screen element. Activate screen.

The flow logic for the screen looks like this:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

Create the modules STATUS_0100 and USER_COMMAND_0100 in the main program by simply double clicking on them.

The code for these modules can be something like this:

MODULE status_0100 OUTPUT.

SET PF-STATUS 'Example'. "Example is the name of the GUI status

ENDMODULE.

MODULE user_command_0100 INPUT.

CASE ok_code.

WHEN 'SAVE'.

"call a subroutine to save the data or give statements to save data.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE.

Reward points if helpful.

Regards,

Renuka

7 REPLIES 7
Read only

gopi_narendra
Active Contributor
0 Likes
1,507

use SE41 to create a pf-status for a program.

If not you can do it in SE80 by right clicking on the object name and create new pf-status.

Regards

Gopi

Read only

Former Member
0 Likes
1,507

Hi Viki ,

PF Status is the menu that is attached to your screen.

You screen will have PBO , create the module for that and set the PF-STATUS for it.

Regards

Arun

Read only

Former Member
0 Likes
1,507

hi,

SET PF-STATUS pfstat.

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.

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.

rgds,

pritha

reward if helpful.

Read only

0 Likes
1,507

hi,

u can create ur own graphical interface to ur program in se41,

where u can create ur own menubar and application tool bar in that.

in application tool bar u can use some pushbutton such like which u see in the alv grid.

and menu bar is nothing but those file,edit,view etc which u see in normal windows.

and along with those fuction keys will be there those are save,refresh,back,exit,cancel,print etc.

these also u can define of ur choice.

u can activate and u can use this pf_status for any of ur screen in the program.

and follow the procedure what pritha agrawal has written.

Read only

Former Member
0 Likes
1,507

IN YOUR PBO OF THE SCREEN.

SET PF-STATUS 'ZSPD'.

JUST DBL CLICK ON ZSPD IT WILL GO TO SE41 HERE YOU ARE CREATING THE MENU BAR,APPLICATION TOOL BAR AND CAN ASSIGN ANY FNCODE TO SYSTEM TOOLBAR.

NOW IN YOUR PAI YOU HAVE TO ACCESS THAT.

CASE OKCODE.

WHEN '<FNCODE WHICH U HAVE ASSIGNED THERE>'.

<DO SOMETHING>

ENDCASE.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
1,508

Hi Viki,

PF-STATUS is used to set the GUI Status of a screen, ie you can control the options on your menu bar, application toolbar, the function keys assigned to various options etc.

Implementing the status for a screen can be done in 2 ways:

1) Create the GUI status using the object list of the program or by using the transaction SE41. Then, assign it to the screen using SET PF-STATUS statement.

2) Create the GUI status by means of forward navigation, ie, use the SET PF-STATUS 'XXX' statement where 'XXX' is the name of the GUI status and double click on it to create it.

Status names can have a maximum of 20 characters.

After assigning a GUI status to a screen, this is inherited to all subsequent screens. In order to have a different status for each of the subsequent screens, you have to set a separate status for each screen.

In transaction SE41,

1) Give the program name and the status name and click on the Create button.

2) Go to 'Function keys' and expand.

3) On top of the save icon type SAVE, on top of the back icon type BACK, on top the the exit icon type EXIT etc ie on top of all the icons that you want to use, type the respective names that you want to give.

Whatever you have typed now becomes the function codes of these icons and can be used in your program.

For example you have a screen 100.

In the 'Element list' tab of the screen, give "ok_code" as the name where "OK" is the type of screen element. Activate screen.

The flow logic for the screen looks like this:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0100.

Create the modules STATUS_0100 and USER_COMMAND_0100 in the main program by simply double clicking on them.

The code for these modules can be something like this:

MODULE status_0100 OUTPUT.

SET PF-STATUS 'Example'. "Example is the name of the GUI status

ENDMODULE.

MODULE user_command_0100 INPUT.

CASE ok_code.

WHEN 'SAVE'.

"call a subroutine to save the data or give statements to save data.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE.

Reward points if helpful.

Regards,

Renuka

Read only

Former Member
0 Likes
1,507

hi,

Pf status is used to set the icons on the output screen according to the requirement

double click on NEWPFSTATUS.it will take u to neww pop up window where in u can select the required icons u want to display on ur output screen.

tables : mara,

marc,

makt.

type-pools : slis,icon.

data : d_fieldcat type slis_t_fieldcat_alv,

d_fieldcat_wa type slis fieldcatalv.

data : t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

line(10) type c,

linecount type c.

data : gd_layout type slis_layout_alv.

*type declaration.

types : begin of ty_mara,

matnr type matnr,

erdat type erdat,

end of ty_mara.

types : begin of ty_marc,

matnr type matnr,

werks type werks,

posnr type posnr,

end of ty_marc.

types : begin of ty_makt,

matnr type matnr,

maktx type maktx,

end of ty_makt.

types : begin of ty_final,

matnr type matnr,

erdat type erdat,

werks type werks,

posnr type posnr,

maktx type maktx,

end of ty_final.

*table type specification.

types : tt_mara type standard table of ty_mara,

tt_marc type standard table of ty_marc,

tt_makt type standard table of ty_makt,

tt_final type standard table of ty_final.

*work area declaration.

data : wa_mara type ty_mara,

wa_marc type ty_marc,

wa_makt type ty_makt,

wa_final type ty_final.

  • internal table declaration.

data : itab_mara type tt_mara,

itab_marc type tt_marc,

itab_makt type tt_makt,

itab_final type tt_final.

selection-screen : begin of block blk1 with frame title text-001.

select-options : s_matnr for mara-matnr,

s_werks for marc-werks.

selection-screen : begin of line.

selection-screen comment 3(10) text-002.

parameters : rad1 radiobutton group r1.

selection-screen : comment 16(10) text-003.

parameters : rad2 radiobutton group r1.

selection-screen : end of line.

parameters : chk1 as checkbox.

selection-screen : end of block blk1.

start-of-selection.

select matnr erdat from mara

into corresponding fields of table itab_mara

where matnr in s_matnr.

if not itab_mara is initial.

select matnr werks posnr from marc

into corresponding fields of table itab_marc

where matnr = mara-matnr

and werks in s_werks.

if not itab_marc is intial.

select matnr maktx from makt

into corresponding fields of table itab_makt

where matnr = marc-matnr.

endif.

endif.

end-of-selection.

loop at itab_mara into wa_mara.

wa_final-matnr = wa_mara-matnr.

wa_final-erdat = wa_mara-erdat.

append wa_mara to itab_mara.

clear wa_mara.

endloop.

loop at itab_final into wa_final.

read table itab_marc into wa_marc with key matnr = wa_final-matnr.

if sy-subrc = 0.

wa_final-werks = wa_marc-werks,

wa_final-posnr = wa_marc-posnr.

modify itab_final from wa_final transporting werks posnr.

endif.

read table itab_makt into wa_makt with key matnr = wa_final-matnr.

if sy-subrc = 0.

wa_final-maktx = wa_makt-maktx.

modify itab_final from wa_final transporting maktx.

endif.

endloop.

d_fieldcat_wa-matnr = 'MATNR'.

d_fieldcat_wa-seltext_l = 'material number'.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-col_pos = 1.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-matnr = 'ERDAT'.

d_fieldcat_wa-seltext_l = 'created date'.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-col_pos = 2.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-matnr = 'WERKS'.

d_fieldcat_wa-seltext_l = 'plant'.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-col_pos = 3.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-matnr = 'POSNR'.

d_fieldcat_wa-seltext_l = 'item number'.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-col_pos = 4.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-matnr = 'MAKTX'.

d_fieldcat_wa-seltext_l = 'material description'.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-col_pos = 5.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

data : gd_repid like sy-repid.

gd_repid = sy-repid.

perform layout_set.

call function reuse_grid_display_alv.

exporting

programname = gd_repid

fieldcat = d_fieldcat

pf_status = 'SET_PF_STATUS'

layout = gd_layout.

importing.

t_outtab = itab_final.

excepions.

form set_pf_status using rt_extab type slis_t_extab.

SET PF-STATUS 'NEWSTATUS'.

endform.

Reward with points if helpful.