2025 Mar 10 1:10 PM
Hi!
I have a program that is used for two t-codes, and for a few of the parameters, the user wants to put the value to TRUE, but only for one of the t-codes.
So far, I have something along the lines of this in the selection screen:
SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE TEXT-t06.
PARAMETERS p_param TYPE param.
SELECTION-SCREEN END OF BLOCK b5.
AT SELECTION-SCREEN OUTPUT.
IF sy-tcode = 'T_CODE'
LOOP AT SCREEN INTO ls_screen.
CASE ls_screen-name.
WHEN 'P_PARAM'.
p_param = 'X'.
MODIFY SCREEN FROM ls_screen.
ENDLOOP.
ENDCASE.
But when I debug it, I see that even if I set the parameter to FALSE, in the debugger it sets it to TRUE again. Does anyone know how to deal with this? Or would the only option be making a whole new screen?
2025 Mar 10 2:59 PM - edited 2025 Mar 10 2:59 PM
In this case you are not trying to modify the selection screen. You are only filling default values.
Use "INITIALIZATION" instead
INITIALIZATION.
IF sy-tcode = 'T_CODE'
p_param = abap_true.
ENDIF.
2025 Mar 10 3:27 PM - edited 2025 Mar 10 3:34 PM
You put our code in the PBO, AT SELECTION-SCREEN OUTPUT, so if user press Enter, your code will be executed again, if they uncheck the field and press Execute (F8, F9) their value will be correct, but reset by your code as soon the initial selection-screen is displayed.