2005 Mar 10 4:47 PM
Hi all,
I facing one problem in dialog programming.
I have 3 radio buttons on screen . When user selects one radio button, some input fields need to be disabled and similarly for other 2 radio buttons also. Please let me know how to do that. I have defined 3 radio buttons under one group RADIO.
TIA,
Ramesh
Hi all,
I facing one problem in dialog programming.
I have 3 radio buttons on screen . When user selects one radio button, some input fields need to be disabled and similarly for other 2 radio buttons also. Please let me know how to do that. I have defined 3 radio buttons under one group RADIO.
TIA,
Ramesh
2005 Mar 10 5:13 PM
Hi Ramesh,
in screen painter it's quite easy (I have no experience in dialog programming, but I think it's quite similar).
- First of all, you should define your radiobuttons so that they trigger a user-command (no matter what its name is, just trigger an ok_code). This can be achieved when displaying attributes of the radiobutton
- Then, at PBO, include this sketch of code:
loop at screen.
if not rb1 is initial.
if screen-name = 'FIELD1' or screen-name = 'FIELD2'.
screen-input = '0'.
modify screen.
endif.
elseif not rb2 is initial.
if screen-name = 'FIELD1' or screen-name = 'FIELD2'.
screen-input = '1'.
modify screen.
endif.
elseif not rb3 is initial.
if screen-name = 'FIELD1' or screen-name = 'FIELD2'.
screen-input = '1'.
modify screen.
endif.
endif.
endloop.
...well, you should "play" for a little while with which fields you want to disable and when you want to do it.
Pls let us know if it helped. BR,
Alvaro
2005 Mar 11 9:14 AM
Hi all,
Thanks for for youe valuable suggestions.
I need some more help.
in my screen all the input boxes are mandatory.when user do not wish to enter any values and want leave the screen,i made the default buttons 'END' and 'CANCEL' active with function type 'EXIT'. But it is not working.
Could any of U tell me what might have went wrong??
TIA,
Ramesh
2005 Mar 11 9:31 AM
Hi,
Do you have a module with AT EXIT-COMMAND where you are processing Cancel and Exit.
Regards
2005 Mar 11 3:55 PM
Hi,
Thanks for your response.
I was able to do this with at EXIT-COMMAND.
Earlier I was not passing function code to my local variable in the program.
Ramesh
2005 Mar 10 5:19 PM
Hi Ramesh,
you could loop the screen internal table, witch handles all screen fields defined in a dynpro.
It would be something like this:
loop at screen.
if screen-name = (your field name here).
screen-input = 0.
Here see if it's 1 or 0 for disabling/enabling a field
*on your dynpro.... I don't remember it
endif.
endloop.
Hope this helps.
Regards,
Laura
2005 Mar 10 11:01 PM
Ramesh, those two postings will definitely help you.
On the other hand, I'm curious why you would want to disable the other two radio buttons.
What if they made a mistake and really want to choose another radio button ?
Just a thought....good luck on your program.
2005 Mar 10 11:06 PM
Hi Jonathan
What Ramesh wants is not to disable other two buttons but disable some input fields with respect to the selected radio button.
*--Serdar
2005 Mar 10 11:45 PM
Well that makes a lot of sense, thank you Serdar for pointing it out.
Also Ramesh, you can assign an OK-CODE on your radio buttons so once the user selected one of the options, it will go right away to PAI then to PBO, where you can do your LOOP AT SCREEN...ENDLOOP. Saves the time of pressing ENTER after selecting one of the radio.
Cheers !
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |