2010 Jan 13 11:54 AM
HI
I Need help on radio button group ..My requirement is like below example and please give answers to particular one .dont be general
Eg :
Below is the my selection screen block ..
parameters: : R1 radiobutton
R2 radiobutton
R3 radiobutton
parameter : p1
select option :S1
When I click radibutton R2 parameter p1 should be defaulted , and when again i go to R1 or R3 i should clear P1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R3 = 'x'.
IF screen-group1 = 'M1' OR
screen-group1 = 'M2'.
screen-active = '0'.
ENDIF.
ENDIF.
IF r2 = 'x'.
IF screen-group1 = 'M1'.
p1 = text-000. "defaiult text
screen-input = '0'.
ENDIF.
ENDIF.
IF r3 = gc_x .
IF screen-group1 EQ 'M1'.
CLEAR: p1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
I am using above code . but when give some values in S1 and P1 and press enter P1 is getting cleared which i dont
Please give other ideas specific to above logic only .......
<LOCKED BY MODERATOR - URGEN, PLEAS* HEP OR SIMILAR ARE FORBIDDEN>
Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM
Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM
Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM
2010 Jan 13 12:37 PM
Hi,
Below code works perfectly as per ur requirement...
DATA: W_CHAR TYPE I.
parameters: R1 radiobutton group RAD USER-COMMAND FCODE,
R2 radiobutton GROUP RAD,
R3 radiobutton GROUP RAD.
parameterS : p1 TYPE I MODIF ID MOD.
select-optionS: S1 FOR W_CHAR.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R2 = 'X'." OR R1 = 'X'.
ELSE.
IF SCREEN-GROUP1 = 'MOD'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Regards,
Deeba
2010 Jan 13 12:15 PM
Hi,
try this short example:
PARAMETERS: P1 DEFAULT 'X' RADIOBUTTON GROUP PR1 USER-COMMAND DUMMY.
PARAMETERS: P2 RADIOBUTTON GROUP PR1.
PARAMETERS: P3 RADIOBUTTON GROUP PR1.
PARAMETERS: VAL1(10) MODIF ID DI1.
PARAMETERS: VAL2(10) MODIF ID DI2.
*
AT SELECTION-SCREEN OUTPUT.
*
IF P1 = 'X'.
VAL1 = 'Muster'.
ELSE.
CLEAR VAL1.
ENDIF.
Regards, Dieter
2010 Jan 13 12:28 PM
can you check this, its not tested.
parameters:pa type matnr.
parameters: : R1 radiobutton group1 default 'X' user-command ABC.
R2 radiobutton group1,
R3 radiobutton group1.
at selection-screen output.
if R1 = 'X' or R3 = 'X'.
clear pa.
elseif R2 = 'X'.
pa = 123.
endif.
2010 Jan 13 12:37 PM
Hi
If you can see code i pasted .i have used the same logic only ..
Just try the same what you mentioned .When you press enter on selection screen The values in paramter is getting cleared which i dont want .
I mentioned it .Please look at it and one more its not probelm of nesting .
So clear statement wont work here
thanks for ur reply
2010 Jan 13 12:42 PM
When you press enter on selection screen The values in paramter is getting cleared
Check if the radio button 1 or 3 are marked while you hit enter. This was your requirement( if 1 or 3 choosed clear and if 2 choosed default ).
What do you mean by "should be defaulted".
2010 Jan 13 12:47 PM
Hi keshav
When we press enter also same At selection screen output will trigger.
I can say you understood my requirement.
Do you have any idea on this . But we cant check radio buttons flag when we press ENTER>
2010 Jan 13 12:50 PM
Hi even if we hit enter, the code will work only based on the 'if' condition written, so the enter doesnt have any precedence here.
Please me more clear, exactly what do you want.
2010 Jan 13 12:59 PM
HI
The parameters should clear only when toggle between other 2 radio buttons but not when we press enter on sel.screen
But for my code its clearing parameter when i press enter.
Requirement is clear becauase i pasted code also.
thanks
2010 Jan 13 12:37 PM
Hi,
Below code works perfectly as per ur requirement...
DATA: W_CHAR TYPE I.
parameters: R1 radiobutton group RAD USER-COMMAND FCODE,
R2 radiobutton GROUP RAD,
R3 radiobutton GROUP RAD.
parameterS : p1 TYPE I MODIF ID MOD.
select-optionS: S1 FOR W_CHAR.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R2 = 'X'." OR R1 = 'X'.
ELSE.
IF SCREEN-GROUP1 = 'MOD'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Regards,
Deeba
2010 Jan 13 12:41 PM
Hi Deeba
if we use Screen-active = 0. The parameter itself wont appear on screen which dont .Just I need blank parameter.
Thanks for ur reply
2010 Jan 13 12:44 PM
Hi,
i give you a little short example and it solved what you need, isn't it??
Do you test it?
Regards, Dieter
2010 Jan 13 12:57 PM
Hi
Yes I have tested it .still its clearing .See the below code same i pasted before.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-a02.
PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND u1,
p_rb2 TYPE c RADIOBUTTON GROUP gr1,
p_rb3 TYPE c RADIOBUTTON GROUP gr1,
p_res TYPE hrs1000-stext MODIF ID m1 .
SELECT-OPTIONS :
s_res_ob FOR hrp1240-objid MODIF ID m2 .
SELECTION-SCREEN END OF BLOCK b2.
above is my selection screen apart with some fileds ...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rb3 = gc_x.
IF screen-group1 = 'M1' OR
screen-group1 = 'M2'.
screen-active = '0'.
CLEAR: p_res.
ENDIF.
ENDIF.
IF p_rb2 = gc_x.
IF screen-group1 = 'M1'.
p_res = text-000.
screen-input = '0'.
ENDIF.
ENDIF.
IF p_rb1 = gc_x .
IF screen-group1 EQ 'M1'.
clear : p_res.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
2010 Jan 13 1:11 PM
Hi kamesh,
I worked with your code and SLIGHTLY modified and enhanced.
The lines changed/added are with comment @@@@@@
and it works fine now.
*
1. R2 to R1 = parameter is cleared
2. R1 and we press enter = Entered Value REMAINS (does not get cleared)
*
Just copy paste.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-a02.
PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND u1,
p_rb2 TYPE c RADIOBUTTON GROUP gr1,
p_rb3 TYPE c RADIOBUTTON GROUP gr1,
p_res TYPE hrs1000-stext MODIF ID m1 .
SELECT-OPTIONS :
s_res_ob FOR hrp1240-objid MODIF ID m2 .
SELECTION-SCREEN END OF BLOCK b2.
*"@@@@@@@@@@@@@@@@@@@@@@ add this declaration
DATA : rb2flag type c.
*above is my selection screen apart with some fileds ...
AT SELECTION-SCREEN OUTPUT.
*BREAK-POINT.
LOOP AT SCREEN.
IF p_rb3 = 'X'.
IF screen-group1 = 'M1' OR
screen-group1 = 'M2'.
screen-active = '0'.
* CLEAR: p_res. "@@@@@@ comment this line
ENDIF.
ENDIF.
IF p_rb2 = 'X'.
IF screen-group1 = 'M1'.
* p_res = text-000. "@@@@@@ comment this line
screen-input = '0'.
rb2flag = 'X'. "@@@@@ add this line.
ENDIF.
ENDIF.
IF p_rb1 = 'X' .
IF screen-group1 EQ 'M1'.
* clear : p_res. "@@@@@@ comment this line
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
*"@@@@@@@@@@@@ add this code
if rb2flag = 'X'.
p_res = text-000.
clear rb2flag.
else.
if p_res = text-000.
clear p_res.
endif.
endif.
regards,
amit m.
Edited by: Amit Mittal on Jan 13, 2010 6:42 PM
Edited by: Amit Mittal on Jan 13, 2010 6:43 PM
2010 Jan 13 1:39 PM
Solved by Amit Mittal
Thank you and Awarded points ..Close this forum..
Thank you Amit
2010 Jan 13 1:41 PM
2010 Jan 13 1:10 PM
Hi this is just a guess.
can you try like this.
parameters:p1 type matnr memory ID TST.
2010 Jan 13 1:30 PM
Hi,
if you need Need help on radio button group, why use a subject of 'Help with selection screen'
?
Regards,
Clemens
2010 Jan 13 1:34 PM
or try the menu System u2192 User specifications u2192 Hold data, mark it and check.