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: 

SET_PF_STATUS

Former Member
0 Kudos

Hi can any body tell me

what is SET_PF_STATUS, and how to use this reports.

thanks in advance

kp

6 REPLIES 6

Former Member
0 Kudos

Hi,

SET PF-STATUS is used for defining your own menu..

Check this example for using SET PF-STATUS in reports..

DATA: BEGIN OF itab OCCURS 0,

check,

value(20),

END OF itab.

<b>SET PF-STATUS 'TEST1'.</b>

itab-value = 'ETSAT'.

APPEND itab.

itab-value = 'ETSATADSF'.

APPEND itab.

itab-value = 'ETSAT'.

APPEND itab.

LOOP AT itab.

WRITE: / itab-check AS CHECKBOX,

itab-value.

ENDLOOP.

<b>AT USER-COMMAND.</b>

DATA: wa LIKE itab.

DATA: itab_download LIKE itab OCCURS 0 WITH HEADER LINE.

IF sy-ucomm = 'DOWNLOAD'.

DESCRIBE TABLE itab.

DO sy-tfill TIMES.

READ LINE sy-index FIELD VALUE itab-check.

IF sy-subrc <> 0.

EXIT.

ENDIF.

CHECK itab-check = 'X'.

itab_download-value = itab-value.

APPEND itab_download.

ENDDO.

  • download

call function 'WS_DOWNLOAD'

exporting

filename = 'C:\TEST.XLS '

tables

data_tab = itab_download.

ENDIF.

Thanks,

Naren

former_member387317
Active Contributor
0 Kudos

Hi KP,

SET PF-STATUS is used for defining menu in the program and screens...

For that first you need to create the GUI Status for the program in which you are going to use the GUI Status....

GUI Status contains the Menubar , Standard Toolbar & Application Toolbar.

You can create it by this way...

SE80

Create Program

Right Click on Program

Create --> GUS Status...

Give Name of that GUI Status.. ( Further it will be useful in the program )

Now it opens the window where you can design your own menu & toolbar...

Design it...

Now save and activate it..

Now come back to your program (ABAP Editor )

Write the first statement like below..

SET PF-STATUS 'MENU1'.

Here MENU1 is the name of the GUI status which you created from SE80..

You can handle the user command here using

case sy-ucomm.

when 'SE11'.

call transaction 'SE11'.

when 'NEXT'.

  • Some logic...

endcase.

Please Reward the Points if it is helpful to you...

Regards,

ilesh Nandaniya

Former Member
0 Kudos

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.

reward if useful

Former Member
0 Kudos

Hi,

To allow the user to communicate with the system when a list is displayed, the lists must be able to direct user actions to the ABAP program. As described in User Actions on Screens, function codes are used to do this. Function codes are maintained in the GUI status of the list screen. You define a GUI status using the Menu Painter tool in the ABAP Workbench. The system assigns function codes to list-specific user actions.

The most important of these functions is for selecting list lines by double-clicking. As described in Using a GUI Status, the double-click function is always linked to the F2 key. If a function code is assigned to the F2 key in the GUI status, it will be triggered when you double-click.

chk this link for details:

http://help.sap.com/saphelp_di471/helpdata/EN/9f/dba34635c111d1829f0000e829fbfe/content.htm

regards,

keerthi

Former Member
0 Kudos

Hi,

PF status is used for defining your own menus.For example you can add your own push button DELETE' in the menu bar as shown below:

In the PBO of the screen,uncomment module status100 and double click on it.

It will ask you if you want to write the code for the module in the main program or a separate include.

Now,in PF status,

MODULE status_0200 OUTPUT.

SET PF-STATUS 'GUI2'.

Uncomment the SET PF_STATUS line and give a name say GUI2 and double click on the name.

You will find three tabs in the GUI status:

In the application toolbar,write the function code for the push button you want,say DELETE.Press enter and give the function text,icon name and info text and save and activate the GUI status.

Now,in the PAI of the screen,uncomment the module user command and write the code:

Case ok_code.

When 'DELETE'.

...logic

Endcase.

(ok_code is defined in the top include as

DATA:ok_code type sy-ucomm.)

<b>http://help.sap.com/saphelp_46c/helpdata/en/d1/801d5d454211d189710000e8322d00/frameset.htm</b>

Regards,

Beejal

**Reward if this helps

Former Member
0 Kudos

U can add this in the APPLICATION TOOL BAR.

For this u have to create as follow:

In order modify PF_STATUS of ALV grid report you need to perform the following steps:

1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:

i_callback_pf_status_set = 'SET_PF_STATUS' statement.

2. Create 'SET_PF_STATUS' FORM

3. Create pf_status (i.e. 'ZNEWSTATUS').

- It is recommend that you copy standard status'STANDARD' from function group SALV

and modify it accordingly. ALV standard function codes always start with '&'.


 call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  
            i_callback_pf_status_set = 'SET_PF_STATUS'   "see FORM 
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       exceptions
            program_error           = 1
            others                  = 2.

 
*------------------------------------------------------------------*
*       FORM SET_PF_STATUS                                         *
*------------------------------------------------------------------*
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZNEWSTATUS'. 
                  "Copy of 'STANDARD' pf_status from fgroup SALV
ENDFORM.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm

In normal reports also u can use the same after END-OF-SELECTION.

Write

SET PF-STATUS 'ZSTATUS'.

Double click on the zstatus and create ur own status.

Reward if this helps.