Skip to Content
author's profile photo Former Member
Former Member

pf status

hi experts,

can anybody explain abt pf status and usercommand

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 06:03 AM

    Hi,

    Pushbuttons on the Selection Screen

    To create a pushbutton on the selection screen (similar to pushbuttons on screens), you use:

    SELECTION SCREEN PUSHBUTTON ].

    The . When the user clicks one of the pushbuttons, the AT SELECTION-SCREEN event is triggered, and the FLAG field is set. The FLAG field can be further processed during subsequent program flow after the user has chosen Execute.

    Changing the Standard GUI Status

    The GUI status of a selection screen is generated by the system. The SET PF-STATUS statement in the PBO event of the selection screen has no effect on the standard GUI status. If you want to use your own GUI status for a selection screen or deactivate functions in the standard GUI status in exceptional cases, you can use one of the following function modules in the PBO event of the selection screen:

    RS_SET_SELSCREEN_STATUS

    Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status.

    RS_EXTERNAL_SELSCREEN_STATUS

    Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must pass the name of the function module that sets the status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.

    For further information, refer to the function module documentation.

    REPORT demo_sel_screen_status.

    DATA itab TYPE TABLE OF sy-ucomm.

    PARAMETERS test(10) TYPE c.

    AT SELECTION-SCREEN OUTPUT.

    APPEND: 'PRIN' TO itab,

    'SPOS' TO itab.

    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

    EXPORTING

    p_status = sy-pfkey

    TABLES

    p_exclude = itab.

    In this example, the Print and Save as variant functions are deactivated. To find out the function codes of the standard GUI status, choose System ® Status and double-click the GUI status field.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 06:04 AM

    Hi Karna,

    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.

    Go thru this Link for More Info,

    pf-status

    kindly reward if helpful.

    cheers,

    Hema.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 06:10 AM

    hi Sai,

    PF-Status is used in interactive report for enhancing the functionality. If we go to SE41, we can get menus, items and different function keys, which we are using for secondary list in interactive report.

    Syntax

    AT USER-COMMAND.

    Effect

    This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.

    A simple code with pf-status and user-command

    This program works with a self-defined GUI status MYLIST. The function that is linked there with the function code MY_SELECTION causes the event AT USER-COMMAND during list display and also creates details lists.

    REPORT demo_at_user_command.

    START-OF-SELECTION.

    SET PF-STATUS 'MYLIST'.

    WRITE 'List line'.

    AT USER-COMMAND.

    IF sy-lsind = 20.

    SET PF-STATUS 'MYLIST' EXCLUDING 'MY_SELECTION'.

    ENDIF.

    CASE sy-ucomm.

    WHEN 'MY_SELECTION'.

    WRITE: / 'You worked on list', sy-listi,

    / 'You are on list', sy-lsind.

    ...

    ENDCASE.

    Reward if helpful.

    Thankyou,

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 06:13 AM

    Hi,

    Please refer to the document:

    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm

    Regards,

    Renjith Michael.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.