03-04-2021 8:01 AM
I have 3 rad.buttons like below and some input field exactly. I want to hide/ show the input field base on checked radio button. the porblem is, it's not hide/show automatically after i checked the other radio button. I hve to click enter, it's like not refresh without press enter.
MODULE modify_screen OUTPUT.
IF b_pl = 'X'.
LOOP AT SCREEN.
IF screen-group1 CS 'P1'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P2' OR screen-group1 CS 'P3' .
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF b_pb = 'X'.
LOOP AT SCREEN.
IF screen-group1 CS 'P2'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P1' OR screen-group1 CS 'P3'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF b_bn = 'X'.
LOOP AT SCREEN.
IF screen-group1 CS 'P3'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P1' OR screen-group1 CS 'P2' .
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
03-04-2021 8:18 AM
Hello saddam.id
You probably need to add a function command to the radio buttons so that they raise the PAI event.
Kind regards,03-04-2021 8:18 AM
Hello saddam.id
You probably need to add a function command to the radio buttons so that they raise the PAI event.
Kind regards,03-04-2021 10:04 AM
i hv added fncCode , it's work only when i checked other rad button.but it's not work for the first time i run my program.
03-04-2021 10:16 AM
Please show when is your MODIFY_SCREEN module executed.
Also, you could change all the IFs into one CASE statement, since there will be only one radio button selected at a time.
MODULE modify_screen OUTPUT.
CASE 'X'.
WHEN b_pl.
LOOP AT SCREEN.
IF screen-group1 CS 'P1'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P2' OR screen-group1 CS 'P3' .
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
WHEN b_pb.
LOOP AT SCREEN.
IF screen-group1 CS 'P2'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P1' OR screen-group1 CS 'P3'.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
WHEN b_bn.
LOOP AT SCREEN.
IF screen-group1 CS 'P3'.
screen-active = 1.
ENDIF.
IF screen-group1 CS 'P1' OR screen-group1 CS 'P2' .
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
ENDMODULE.
03-04-2021 10:51 AM
So, before you display the dynpro with "CALL SCREEN", do:
b_pl = 'X'.
Simple as that.
03-04-2021 1:23 PM
Thanks, it's work. And I add condition, to make sure that only 1 button checked.
IF b_pl = '' and b_pb = '' and b_bn = ''.
b_pl = 'X'.
ENDIF.
03-04-2021 1:25 PM
Thnks a lot. This case was solved. After i add fncCode, I need add some condition like sandra said.
03-04-2021 10:10 AM