2009 Aug 26 11:42 AM
Hi Experts,
I am not getting dynamic screen change on selection screen. can you give solution for the following scenario.
I have 3 radio buttons on selection screen. Example: R1, R2, R3.
I have 5 fields on selection screen. Example : F1, F2, F3, F4, F5.
When i select radio button 1 i will get F1 field screen only.
When i select radio button 2 or 3 i will get F2 and F3 fields screen only.
When i select radio button 3 i will get F4 and F5 fields screen only.
Any one give me solution for the above scenario very much thankful.
Thanks in advance,
Sai
2009 Aug 26 12:14 PM
Hi Sai,
Following code works according to ur requirement......
parameters:
P_r1 radiobutton group RAD user-command COM1,
p_r2 radiobutton group RAD,
p_r3 radiobutton group RAD,
p_fld1 type i modif id MD2,
p_fld2 type i modif id MOD,
p_fld3 type i modif id MOD,
p_fld4 type i modif id MD1,
p_fld5 type i modif id MD1.
at selection-screen output.
if p_r2 = 'X'.
loop at screen.
if screen-group1 = 'MD2' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
ELSEif p_r3 = 'X'.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD2' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
ELSE.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
endif.
Regards,
Hi Experts,
I am not getting dynamic screen change on selection screen. can you give solution for the following scenario.
I have 3 radio buttons on selection screen. Example: R1, R2, R3.
I have 5 fields on selection screen. Example : F1, F2, F3, F4, F5.
When i select radio button 1 i will get F1 field screen only.
When i select radio button 2 or 3 i will get F2 and F3 fields screen only.
When i select radio button 3 i will get F4 and F5 fields screen only.
Any one give me solution for the above scenario very much thankful.
Thanks in advance,
Sai
2009 Aug 26 11:50 AM
Use AT-SELECTION SCREEN OUTPUT event and in that loop the screen internal table which contains the details about all your screen fields and in the screen internal table we have attribute called as INVISIBLE, just pass 'X' to that.
Vishwa
2009 Aug 26 11:53 AM
Hi Sai,
Check below similar code snippet. You just need to modify acording to your requirement.
PARAMETERS : p_rb1 RADIOBUTTON GROUP grp1 USER-COMMAND ucom DEFAULT 'X',
p_rb2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS s_matnr FOR mara-matnr MODIF ID nit.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'NIT'.
IF p_rb1 EQ 'X'.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.Thanks
Nitesh
2009 Aug 26 11:53 AM
2009 Aug 26 11:57 AM
PARAMETERS: P_R1 RADIOBUTTON GROUP g1 DEFAULT 'X'
USER-COMMAND WHAT.
PARAMETERS: P_R2 RADIOBUTTON GROUP g1.
SELECT-OPTIONS: S_1 FOR Z-1,
S_2 FOR Z-2 MODIF ID R1,
S_3 FOR Z-3 MODIF ID R2,
* ---------------------------------------------------------------------*
* At selection Screen (Radiobuttons) *
* ---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
IF P_R1 = ' '.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 NE SPACE.
IF SCREEN-GROUP1 EQ 'R2' OR
SCREEN-GROUP1 EQ 'R3'.
SCREEN-INVISIBLE = '1'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
2009 Aug 26 11:59 AM
Hi,
In AT SELECTION SCREEN OUTPUT
LOOP AT SCREEN.
IF R1 = 'X'.
IF screen-name = 'F1'.
screen invisible = 1.
MODIFY SCREEN.
ENDIF.
ELSEIF R2 = 'X'.
IF screen-group = 'G1'.
screen invisible = 1.
MODIFY SCREEN.
ENDIF.
ELSEIF R2 = 'X'.
IF screen-group = 'G2'.
screen invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.Thanks,
Sri.
Edited by: Sri on Aug 26, 2009 4:30 PM
2009 Aug 26 12:00 PM
Hi,
you can try the logic below, i have entered.
Below code has 2 radiobuttons and two parameters.
For radio button1 field 1 will be input enabled.
For radio button2 field 2 will be input enabled.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN skip.
PARAMETERS: R! RADIOBUTTON GROUP B1 DEFAULT 'X' USER-COMMAND COM1,
R2 RADIOBUTTON GROUP B1.
SELECTION-SCREEN skip.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECTION-SCREEN skip.
PARAMETERS:F1 TYPE field1,
F2 TYPE field2.
SELECTION-SCREEN skip.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R1 = 'X' AND
SCREEN-NAME = 'parameter2 name'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ELSEIF R2 = 'X' AND
SCREEN-NAME = 'parameter1 name''.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Rajesh
2009 Aug 26 12:14 PM
Hi Sai,
Following code works according to ur requirement......
parameters:
P_r1 radiobutton group RAD user-command COM1,
p_r2 radiobutton group RAD,
p_r3 radiobutton group RAD,
p_fld1 type i modif id MD2,
p_fld2 type i modif id MOD,
p_fld3 type i modif id MOD,
p_fld4 type i modif id MD1,
p_fld5 type i modif id MD1.
at selection-screen output.
if p_r2 = 'X'.
loop at screen.
if screen-group1 = 'MD2' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
ELSEif p_r3 = 'X'.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD2' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
ELSE.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
endif.
Regards,
2009 Aug 26 1:50 PM
Hi Deeba,
Your code is working exactly for 1st radio button and 2nd radio button. when i select 3rd radio button i am not getting Field 2 and Filed3 screen. When i select Radio button 3 i am getting only field 4 and field 5 screen.
But i want when i select 3rd radio button need to display field2 and field3 screen separately.
Please give me advise.
Thanks in advance,
Sai.
2009 Aug 27 6:59 AM
Hi Sai,
According to my understanding of ur requirement u want the same fields 'fld2 fld3' to be displayed on selection of
Radio Button 2 or Radio Button 3..
and r u not going to display field4 & field5..
Kindly chk the following modified code..
parameters:
P_r1 radiobutton group RAD user-command COM1,
p_r2 radiobutton group RAD,p_r3 radiobutton group RAD,
p_r4 radiobutton group RAD,
p_fld1 type i modif id MD2,
p_fld2 type i modif id MOD,
p_fld3 type i modif id MOD,
p_fld4 type i modif id MD1,
p_fld5 type i modif id MD1.
at selection-screen output.
if p_r2 = 'X' or p_r3 = 'X'.
loop at screen.
if screen-group1 = 'MD2' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
" in case radio button 4 not required remove this elseif part of coding..
ELSEif p_r4 = 'X'.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD2' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
ELSE.
loop at screen.
if screen-group1 = 'MOD' OR screen-group1 = 'MD1' .
screen-active = 0.
modify screen.
ENDIF.
endloop.
endif.
Regards,
Mdi.Deeba
2009 Aug 27 7:01 AM
Hi
try this code,
REPORT ZTEST_3RB.
TABLES : KNA1,EKKO,VBRK.
PARAMETERS : SALES RADIOBUTTON GROUP VIJJ USER-COMMAND VJY ,
PUR RADIOBUTTON GROUP VIJJ ,
BILL RADIOBUTTON GROUP VIJJ ,
TOTAL AS CHECKBOX.
SELECT-OPTIONS : S_CUSTNO FOR KNA1-KUNNR MODIF ID AKP DEFAULT 1000 TO 1033,
S_PONO FOR EKKO-EBELN MODIF ID VKP,
S_BNO FOR VBRK-VBELN MODIF ID PKP.
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SALES = 'X'.
IF SCREEN-GROUP1 = 'VKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'PKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF PUR = 'X'.
IF SCREEN-GROUP1 = 'PKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'AKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF BILL = 'X'.
IF SCREEN-GROUP1 = 'AKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'VKP'.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
i think this will help your problem,
Regards,
Vijay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |