‎2007 Dec 14 10:46 AM
Hello expets,
I have stuck in the middle of one program, where i selected 9 radio button in matrix form which is displayed on the selection screen. so
when i click on R1 then R4 &R7 should be disabled, when R4 is clicked then R1 & R7 should be disabled, when i click R7 then R1 & R4 should be disabled
...
the below is my coding... can anyone help me in this
PROGRAM zmatrad_01002 .
DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
box TYPE c.
*
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm,
CHECK1 type flag,
CHECK2 type flag,
CHECK3 type flag,
CHECK4 type flag,
CHECK5 type flag,
CHECK6 type flag,
CHECK7 type flag,
CHECK8 type flag,
CHECK9 type flag.
CALL SCREEN 100.
**
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'check1'.
loop at screen.
if screen-name = 'CHECK4'.
screen-input = '0'.
screen-active = '0'.
screen-output = '0'.
modify screen.
endif.
if screen-name = 'CHECK7'.
screen-input = 'X'.
screen-active = 'X'.
screen-output = 'X'.
CHECK7 = ''.
modify screen.
endif.
endloop.
*
WHEN 'CANCEL'.
LEAVE PROGRAM.
*
ENDCASE.
ENDMODULE.
MODULE user OUTPUT.
ENDMODULE. " user_command_0100 OUTPUT
‎2007 Dec 14 11:03 AM
Hello,
When you define radiobuttons, you assign them to a radibutton group. Then only one radiobutton in the group can be selected. This is done by the system.
Have you grouped RB1, RB4 and RB7 in one group? The way to do it is from the screen layout select the three radiobuttons and (Sorry, I only see the text in german) Bearbeiten->Gruppierung->Ausf...groupe->Definieren
Hope this helps (and obtain some points)
‎2007 Dec 14 10:53 AM
Hi Raghu,
I am just giving the logic here,
when i click on R1 then R4 &R7 should be disabled, loop at screen.
if R1 = 'X'.
IF SCREEN-NAME = 'CHECK4' OR SCREEN-NAME = 'CHECK7'
screen-input = '0'.
screen-active = '0'.
screen-output = '0'.
modify screen.
ENDIF.
ENDLOOP.
endif.
Apply the above logic and you may get the result for sure.
Regards,
Sujatha
‎2007 Dec 14 11:04 AM
i forgot 2 tell that here I grouped radio buttons
R1,R2,R3 ---> GRP1
R4,R5,R6 ---> GRP2
R7,R8,R9 ---> GRP3
ok.. I applied same code but not working .....
‎2007 Dec 14 11:12 AM
The LOOP AT SCREEN will work only in the PBO, not in the PAI.
Also, I think you don't need to do LOOP AT SCREEN. Only change the CHECKn variables.
Remember that if you clear R4, you should check R5 or R6. You want a RB checked in every RB group.
‎2007 Dec 14 12:51 PM
Now tell me more clear to all ....
R1 R4 R7
R2 R5 R8
R3 R6 R9 ....... this is martrix in 3 x 3 ok
in the screen 100 , i already grouped them as
R1 R2 R3 --> GRP1
R4 R5 R6 --> GRP2
R7 R8 R9 --> GRP3.
now what i want is ... when the user have to selct 3 fileds which should display according to the selction of matrix.
so here when R1 is clicked R4 and R7 should disabled.
smiliarly when R4 is clicked R1 and R3 should disabled.
‎2007 Dec 14 11:03 AM
Hello,
When you define radiobuttons, you assign them to a radibutton group. Then only one radiobutton in the group can be selected. This is done by the system.
Have you grouped RB1, RB4 and RB7 in one group? The way to do it is from the screen layout select the three radiobuttons and (Sorry, I only see the text in german) Bearbeiten->Gruppierung->Ausf...groupe->Definieren
Hope this helps (and obtain some points)
‎2007 Dec 14 11:36 AM
hi,
declare r1 r4 r7 like this this solve ur problem..
parameters : r1 radiobutton group rad1,
r4 radiobutton group rad1,
r7 radiobutton group rad1.
‎2007 Dec 14 12:35 PM
Hello kamini...
i have already grouped
R1,R2,R3 .... how can I again group R1,R4,R7...
‎2007 Dec 14 1:20 PM
Hi RaghuRa,
you may use the PARAMETERS addition .. USER-COMMAND ucom. In the command routine you can use the LOOP AT SCREEN method to enable/disable buttons.
I never saw a radio with such a logick
Regards,
Clemens
‎2007 Dec 14 1:25 PM
Have you tried this?
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'check1'.
CLEAR: check4, check7.
ENDCASE.
Tell me if it works.
‎2007 Dec 14 1:30 PM
hi,
Please reward points if helpful.
Here i have given sample code for report program not for module pool prog.
you just replace code given here event at selection-screen output with PBO of the screen and write some module under PBO of that screen.
Use modif id.
Program for radio button selections at selection-screen output.
REPORT zstemp_qty2_ .
TABLES:lfm1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfm1-lifnr .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:
r_asn RADIOBUTTON GROUP rad1 USER-COMMAND uc1 DEFAULT 'X',
r_ers RADIOBUTTON GROUP rad1 ,
r_830 RADIOBUTTON GROUP rad1,
r_850 RADIOBUTTON GROUP rad1,
r_862 RADIOBUTTON GROUP rad1,
r_810 RADIOBUTTON GROUP rad1,
r_820 RADIOBUTTON GROUP rad1,
r_824 RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECT-OPTIONS: s_bstae FOR lfm1-bstae MODIF ID sd1.
PARAMETERS:
p_ekorg TYPE lfm1-ekorg MODIF ID md1,
p_evcode TYPE edp21-evcode MODIF ID md2,
p_kappl TYPE nach-kappl MODIF ID md3,
p_parvw TYPE nach-parvw MODIF ID md4,
p_kschl TYPE nach-kschl MODIF ID md5,
p_vakey TYPE nach-vakey MODIF ID md6,
p_werks TYPE werks_d MODIF ID md7,
p_bukrs TYPE lfb1-bukrs MODIF ID md8.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF r_asn EQ 'X'
AND ( screen-group1 = 'MD3' OR screen-group1 = 'MD4'
OR screen-group1 = 'MD5' OR screen-group1 = 'MD6'
OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_ers EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'
OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'
OR screen-group1 = 'MD6' OR screen-group1 = 'MD7'
OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_830 EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD6'
OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_850 EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD6'
OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_862 EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_810 EQ 'X'
AND ( screen-group1 = 'MD3' OR screen-group1 = 'MD4'
OR screen-group1 = 'MD5' OR screen-group1 = 'MD6'
OR screen-group1 = 'MD7' OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_820 EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'
OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'
OR screen-group1 = 'MD6' OR screen-group1 = 'MD7' ).
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ELSEIF r_824 EQ 'X'
AND ( screen-group1 = 'SD1' OR screen-group1 = 'MD1'
OR screen-group1 = 'MD2' OR screen-group1 = 'MD3'
OR screen-group1 = 'MD4' OR screen-group1 = 'MD5'
OR screen-group1 = 'MD6' OR screen-group1 = 'MD7'
OR screen-group1 = 'MD8' ) .
screen-active = '0'.
screen-invisible = '1'.
screen-input = '0'.
screen-output = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Thanks
Sivaparvathi