04-18-2007 10:29 AM
Hi all,
I have 6 parameters and 2 radiobuttons in my report.
It will first display 3 parameters by default.
and when the user click on first radio button it will display only p1,p2 and p3.
and when the user click on second radio button it will display only p4,p5 and p6.
Any one Plz help me how to handle this.
Thanks and Regards,
Anil .
04-18-2007 10:43 AM
Hi,
What my exact requirement is when iam clicking on a radiobutton the action has to be taken place.
When iam clicking on first radio button only p1,p2 and p3 will be enable for input.
the other 3 parameters will be invisible.
in the same way when iam clicking on the second radio button p4, p5 and p6 will be enable for input and the other 3 will be invisible.
I dont want any pushbutton or checkboxes in the screen.
Thanks and Regards,
Anil
04-18-2007 10:31 AM
Hi
Use
At selection-screen output
loop at screen.
check whether it is checked.
Eg:
PARAMETERS : chk1 TYPE c AS CHECKBOX USER-COMMAND ch1 MODIF ID m1,
chk2 TYPE c AS CHECKBOX USER-COMMAND ch2 MODIF ID m2.
INITIALIZATION.
flg = 1.
flg1 = 1.
AT SELECTION-SCREEN .
IF sy-ucomm = 'CH1'.
IF chk1 = 'X'.
flg = 1.
flg1 = 0.
ELSE.
flg = 1.
flg1 = 1.
ENDIF.
ELSEIF sy-ucomm = 'CH2'.
IF chk2 = 'X'.
flg = 0.
flg1 = 1.
ELSE.
flg = 1.
flg1 = 1.
ENDIF.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'M1'.
screen-input = flg.
MODIFY SCREEN.
ELSEIF screen-group1 = 'M2'.
screen-input = flg1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
04-18-2007 10:32 AM
Try this....
PARAMETERS:
p_num TYPE i MODIF ID abc,
p_num1 type i modif ID abc,
p_str(10) TYPE c MODIF ID xyz LOWER CASE.
PARAMETERS:
rone type c RADIOBUTTON GROUP r1 DEFAULT 'X' USER-COMMAND ucom,
rtwo type c RADIOBUTTON GROUP r1 .
SELECTION-SCREEN PUSHBUTTON /10(20) charly USER-COMMAND abcd.
TABLES sscrfields.
DATA:
w_str(10) TYPE c,
w_len TYPE i. .
AT SELECTION-SCREEN OUTPUT.
IF rone EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'XYZ'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
INITIALIZATION.
MOVE 'My text' TO charly.
04-18-2007 10:36 AM
hi
<b>Parameters: rb_1 radiobutton group grp user-command ucomm default 'X',
rb_2 radiobutton group grp.
at selection-screen output.
loop at screen.
case screen-group1.
if rb_1 = 'X'.
write:p1 p2 p3
elseif rb_2 = 'X'.
screen-active = 1.
write:p4 p5 p6.
endcase.
endloop.</b>
hope it will clear ur doubt
regards
ravish
<b>plz dont forget to reward points if helpful</b>
Message was edited by:
ravish goyal
04-18-2007 10:41 AM
THis is the best Exaple...Copy and paste in program(create a local object program..)and Execte it and c d code and implement in ur program...
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: p1 RADIOBUTTON GROUP r1 USER-COMMAND u DEFAULT 'X'.
SELECTION-SCREEN COMMENT 12(20) text-001 FOR FIELD p1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: p2 RADIOBUTTON GROUP r1.
SELECTION-SCREEN COMMENT 12(10) text-002 FOR FIELD p2.
SELECTION-SCREEN END OF LINE.
PARAMETERS: p11(10) MODIF ID one,
p12(10) MODIF ID one,
p13(10) MODIF ID one.
PARAMETERS:
p21 RADIOBUTTON GROUP r3 MODIF ID two,
p22 RADIOBUTTON GROUP r3 MODIF ID two,
p23 RADIOBUTTON GROUP r3 MODIF ID two.
SELECTION-SCREEN END OF BLOCK b.
AT SELECTION-SCREEN OUTPUT.
IF p1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'TWO'.
SCREEN-INPUT = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ONE'.
screen-input = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
Ramesh.
04-18-2007 10:41 AM
hI..,
Check this code..
parameters :
R1 RADIOBUTTON GROUP RAD USER-COMMAND ULE,
p1 type i modif id RAM, p2 type i modif id RAM,
p3 type i modif id RAM,
R2 RADIOBUTTON GROUP RAD,
p4 type i modif id RAC,
p5 type i modif id RAC, p6 type i modif id RAC.
DATA W_FLAG TYPE I.
AT SELECTION-SCREEN OUTPUT.
IF W_FLAG EQ 1.
IF R1 EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAC'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAM'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAC' OR SCREEN-GROUP1 = 'RAM'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
clear w_flag.
AT SELECTION-SCREEN.
IF SY-UCOMM EQ 'ULE'.
W_FLAG = 1.
ENDIF.
START-OF-SELECTION .
WRITE : 'SUCCESS'.
regards,
sai ramesh
04-18-2007 10:43 AM
Hi,
What my exact requirement is when iam clicking on a radiobutton the action has to be taken place.
When iam clicking on first radio button only p1,p2 and p3 will be enable for input.
the other 3 parameters will be invisible.
in the same way when iam clicking on the second radio button p4, p5 and p6 will be enable for input and the other 3 will be invisible.
I dont want any pushbutton or checkboxes in the screen.
Thanks and Regards,
Anil
04-18-2007 10:44 AM
Hi..,
just copy, paste.. and execute this program !!
parameters :
R1 RADIOBUTTON GROUP RAD USER-COMMAND ULE,
p1 type i modif id RAM, p2 type i modif id RAM,
p3 type i modif id RAM,
R2 RADIOBUTTON GROUP RAD,
p4 type i modif id RAC,
p5 type i modif id RAC, p6 type i modif id RAC.
DATA W_FLAG TYPE I.
AT SELECTION-SCREEN OUTPUT.
IF W_FLAG EQ 1.
IF R1 EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAC'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAM'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ELSE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAC' OR SCREEN-GROUP1 = 'RAM'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
clear w_flag.
AT SELECTION-SCREEN.
IF SY-UCOMM EQ 'ULE'.
W_FLAG = 1.
ENDIF.
START-OF-SELECTION .
WRITE : 'SUCCESS'.
<b>Hope this solves your query !!
plz do remember to close the thread, when ur problem is solved !! reward all helpful answers !!
regards,
sai ramesh</b>
04-18-2007 10:48 AM
Hi Anil,
Simply Use this code.
This will work for you.
<b>Reward points if useful,</b>
*********************************************************************************
REPORT ZTEST.
PARAMETERS : R1 RADIOBUTTON GROUP G1 USER-COMMAND U1.
PARAMETERS : R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN SKIP.
PARAMETERS : P1.
PARAMETERS : P2.
PARAMETERS : P3.
PARAMETERS : P4.
PARAMETERS : P5.
PARAMETERS : P6.
INITIALIZATION.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P4' OR SCREEN-NAME = 'P5' OR SCREEN-NAME ='P6'.
SCREEN-INPUT = 0.
ENDIF.
IF SCREEN-NAME = 'P1' OR SCREEN-NAME = 'P2' OR SCREEN-NAME ='P3'.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R1 = 'X'.
IF SCREEN-NAME = 'P4' OR SCREEN-NAME = 'P5' OR SCREEN-NAME ='P6'.
SCREEN-INPUT = 0.
ENDIF.
IF SCREEN-NAME = 'P1' OR SCREEN-NAME = 'P2' OR SCREEN-NAME ='P3'.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF R2 = 'X'.
IF SCREEN-NAME = 'P4' OR SCREEN-NAME = 'P5' OR SCREEN-NAME ='P6'.
SCREEN-INPUT = 1.
ENDIF.
IF SCREEN-NAME = 'P1' OR SCREEN-NAME = 'P2' OR SCREEN-NAME ='P3'.
SCREEN-INPUT = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*********************************************************************************
Regards,
Tejas
04-18-2007 11:19 AM