03-29-2007 5:04 PM
hi. Can someone tell me how can i get the value of a radio button when loopin at screen?? i have a radio group with 3 radio button bu i cant get teh one that was selected..
Thk, Regards
03-29-2007 5:07 PM
Hi ,
For the RB that is selected, the value will bbe 'X'.
if rb1, rb2 and rb3 are the radio buttons, then one of them at a time will be 'X'.
rb1 = 'X' if the first radio is selected.
Regards,
ravi
03-29-2007 5:15 PM
my problem is that was a screen made by the layout... when i loop at screen the screen name brings teh name of the radio buttons but not the table screen doesn bring the value, if its selected or no...
Thk for the reply,
Regards
03-29-2007 5:18 PM
The SCREEN internal table doesn't hold the values of the radio-button or screen fields.
You can directly use the name of the radio-button to get its value.
03-29-2007 5:20 PM
You do not need to LOOP at screen to get the value of the radiobutton at runtime. Just do a simply IF statement or CASE statement like I've suggested above.
Radiobuttons are just like any other input field in your layout, single character field which has a value of space or 'X'. That's it.
Regards,
Rich Heilman
03-29-2007 5:27 PM
THK GUYS!! i made, but now my question is if can i return a value from the screen..
The choice of the user and then return it. in the pai module i can see the radio checked but how to say to the program that calls the screen wich choice was made??
Thk to all Regards
03-29-2007 5:30 PM
03-29-2007 5:31 PM
WHen you create screen elements like input fields of radiobuttons, you always define the variable in the program with the same name. This variable will always have the most current value from the screen. There is no need to pass anything between the screen and the program, it just magically is mapped based on the screen field name and the matching variable(defined by a DATA statement) in your program. Is it clear?
Regards,
Rich HEilman
03-29-2007 5:12 PM
Hi joao,
Please verify the radio groups that you have entered for each radio button.
Thanks and regards
Vipin Das
03-29-2007 5:12 PM
03-29-2007 5:14 PM
03-29-2007 5:15 PM
Joao,
In dialog program, these 3 radio buttons MUST have data declarations in the TOP INCLUDE that is GLOBAL.
In addition, the names of the radio buttons in the Screen Painter MUST match EXACTLY the names created in the TOP INCLUDE.
Ex: In screen painter, create a Radio Buttons called RB1 and RB2.
In the TOP Include, there MUST be a data statements like this:
data: RB1(1).
data: RB2(1).
Now the ABAP run-time will assign the current value to each of the RB values. You can now determine in code whcih one was selected by the user.
03-29-2007 5:17 PM
Hi,
Include the 3 radio buttons in the same group, and one has to contain the value 'X' all the time. Check for this value.
if rb1, rb2, rb3 are the radiobuttons,
IF rb1 = 'X'
*logic for 1st radio button select.
ELSEIF rb2 = 'X'
*logic for 2nd radio button select.
ELSE.
*logic for 3rd radio button select.
ENDIF.
Thanks
Pranati