Skip to Content
avatar image
Former Member

GUI Status Function Key doesn't t react

Hello,

i defined in the initialization event a own gui status.

PARAMETERS: p_name TYPE string.

INITIALIZATION.

SET PF-STATUS 'ZMC'.


I defined a function key(F5). If the user clicks on it the it should write 'hello'.  Although one can click on this buttion it doesn't anything. I tried to acces the function with AT PF05 and with

AT USER-COMMAND.

    CASE sy-ucomm.

      WHEN 'TEST' .WRITE 'OK'.

      WHEN OTHERS.

    ENDCASE.


Nothing appears. What did I wrong?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 26, 2015 at 02:15 PM

    So it isnt possible to set pf status to to the selection screen? I tried with

    'RS_SET_SELSCREEN_STATUS' but the function key doesnt react.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      It is possible but not sure what you want to achieve as the Event handling should be done in AT-SELECTION SCREEN event and you have limited option there.

      Please see below the code.

      SELECTION-SCREEN FUNCTION KEY 5.

      PARAMETERS: p_name TYPE string.

      data : lt_exclude type TABLE OF mara.

      INITIALIZATION.

      CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

         EXPORTING

           p_status        = 'ZMC'

      *   P_PROGRAM       = ' '

         tables

           p_exclude       = lt_exclude

                 .

      AT SELECTION-SCREEN.

         BREAK-POINT.

         if sy-ucomm NE 'TEST'.

           LEAVE PROGRAM.

         else.

           Message s398(00) with 'F5 pressed'.

         endif.

  • avatar image
    Former Member
    Oct 26, 2015 at 02:11 PM

    First of all setting PF-STATUS position is wrong. as it will try to set the PF-STATUS on the selection screen, which you don't want. Set it in START-OF-SELECTION or END-OF-SELECTION. Also make sure you GUI Status is active and you are at least printing something in the screen i order to GUI status to be active,

    I tried the following code and it works fine for me.

    PARAMETERS: p_name TYPE string.

    START-OF-SELECTION.

    SET PF-STATUS 'ZMC'.

    write 'Hello'.

    AT USER-COMMAND.

         CASE sy-ucomm.

           WHEN 'TEST' .WRITE 'OK'.

           WHEN OTHERS.

         ENDCASE.



    Output




    Capture.PNG (19.7 kB)
    Capture.PNG (1.6 kB)
    Add comment
    10|10000 characters needed characters exceeded