10-26-2015 2:01 PM
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?
10-26-2015 2: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.
10-26-2015 2: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
10-26-2015 2: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.
10-26-2015 2:30 PM
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.