2024 Feb 28 11:44 AM
hi im trying to write a code with radio buttons.
Problem is that: there are 3 Radio buttons and if i pick one it has to add someone new to my table, other one has to show some one and the last one has to delete it. I wrote a Programm but all of parameters are on the screen and they dont disappear when i chose the other Radiobuttons. Could you help me?
2024 Feb 28 2:35 PM
So, your question is how to change the layout of the screen if one radio button is pressed?
In the forum, search PARAMETERS ... USER-COMMAND ...
2024 Feb 28 2:39 PM
no im trying to make my this code dynamic. But all the blocks are on the screen
PARAMETERS:
p_anzeig RADIOBUTTON GROUP ub5 USER-COMMAND com1,
p_anleg RADIOBUTTON GROUP ub5,
p_delete RADIOBUTTON GROUP ub5.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001 NO INTERVALS.
PARAMETERS:
p_persno TYPE persno,
p_name TYPE name_first MODIF ID md1,
p_namela TYPE name_last MODIF ID md1,
p_gender TYPE zde_sgender MODIF ID md1,
md2irth TYPE zde_s_birth MODIF ID md1,
p_plz TYPE zde_s_postcode MODIF ID md1,
md3ity TYPE zde_s_ort MODIF ID md1.
SELECTION-SCREEN END OF BLOCK b1 .
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002 NO INTERVALS.
PARAMETERS:
p_persn TYPE persno,
p_nam TYPE name_first MODIF ID md2,
p_namel TYPE name_last MODIF ID md2,
p_gende TYPE zde_sgender MODIF ID md2,
md2irt TYPE zde_s_birth MODIF ID md2,
p_pl TYPE zde_s_postcode MODIF ID md2,
md3it TYPE zde_s_ort MODIF ID md2.
SELECTION-SCREEN END OF BLOCK b2 .
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-003 NO INTERVALS.
PARAMETERS:
p_per TYPE persno MODIF ID md3.
SELECTION-SCREEN END OF BLOCK b3 .
AT SELECTION-SCREEN OUTPUT.
IF p_anleg = 'X' .
LOOP AT SCREEN.
IF screen-group1 = 'MD1' .
screen-active = 0.
screen-invisible = 1.
ELSE.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p_delete = 'X' .
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-active = 0.
screen-invisible = 1.
ELSE.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'MD2' .
screen-active = 0.
ELSE.
screen-invisible = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
2024 Feb 28 2:46 PM
Thanks. I think it's best to add the code in your question. (and also use the formatting option "..." then "</>").
2024 Feb 28 2:48 PM
Simple problem that you don't do MODIFY SCREEN all the time. Just debug.
2024 Feb 28 3:40 PM - edited 2024 Feb 29 1:14 PM
Use the prety print function on your code to easily find errors (screen values changed without MODIFY SCREEN and vice versa). You can also use CASE/WHEN instead of IF/ELSEIF to improve readability. Also debug for initialization (default radio button)
Hint: Keep only one, and only one, MODIFY SCREEN statement, just before the ENDLOOP. 😎
2024 Feb 28 2:51 PM
hi Sandra thanks for tipp. But what do you mean i dont do modify screen? in every if i have modify screen
2024 Feb 28 6:34 PM