Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

lock fields with radio buttons in screen painter

aboooood
Participant
0 Kudos

Hello experts, Im trying to lock a field when user klick on a radio button. the field is editable but when user klick on a radio button it should be locked. for example: there are 2 radio buttons one YES other is NO when its on yes nothing chang but when its NO the field should be uneditable. i tried somthing like this didnt work.

MODULE user_command_0103 INPUT.
LOOP AT SCREEN.
IF screen-name = 'ZWF_BOTTLE_DS-TECH_SPE'.
IF radio2 = 'X'.
screen-input = '0'.
"screen-active = '0'.
MODIFY SCREEN.
CLEAR screen.
ENDIF.
ENDIF.
ENDLOOP.
ENDMODULE.
8 REPLIES 8

FredericGirod
Active Contributor

And what is the result ?

Does the variable RADIO2 having the good value ?

Did you try to put the LOOP AT SCREEN in the PBO instead of PAI ?

aboooood
Participant
0 Kudos

oh i thought it should be in the PAI. now i understand bothe PBO and PAI thank u sir !

VXLozano
Active Contributor
0 Kudos

Not both. Just in the output.

jens_michaelsen
Participant

Did you define the radiobutton group? Did you set functionscode 'DUMMY' for the group?

VXLozano
Active Contributor
0 Kudos

jens_michaelsen does that way work out of the selection screen? We're talking dynpro here (I guess it from the MODULE usage).

You're right about the function code in radiobuttons when you are changing the selection screen, but I don't know if it works the same way in a dynpro.
Anyways, sounds easier to just put a LOOP AT SCREEN in the OUTPUT and hide elements for each available option.

VXLozano
Active Contributor

frdric.girod I think you should create an answer like "put in your OUTPUT module a LOOP AT SCREEN doing...

jens_michaelsen
Participant

@Vicenc Xavier Lozano It works also in dynpro. If you change the radiobuttons on dynpro nothing will happen unless you press enter to process PAI and PBO. If you set a functionscode for the group, PAI and PBO will be processed automatically after changing the radiobutton

VXLozano
Active Contributor
0 Kudos

Nice to know it. THANKS!!