‎2007 Feb 27 9:53 AM
Hi,
I have one query regarding selection screen.
Based on radiobutton my selection screen will become enable & disable mode.
i.e. suppose the selection screen having two button B1 & B2.
the input fields are F1 & F2.
if i select B1 radiobutton the field F1 should become enable mode while if I select B2 radiobutton the then only F2 should
become in enable mode.
Anybody will tell me the optimized logic.
‎2007 Feb 27 9:55 AM
do this way..
AT selection-screen on radiobutton.
loop at screen.
case 'X'.
when 'R1'.
if screen-name = 'P_YEAR'.
screen-input = '0'.
screen-output = '1'.
modify screen
ENDif.
When 'R2'.
if screen-name = 'P_PERIOD'.
screen-input = '0'.
screen-output = '1'.
modify screen
ENDif.
endcase.
endloop.
‎2007 Feb 27 9:58 AM
Hi,,
write like this...
loop at screen.
If r1 eq 'X'.
screen-fieldname = field2.
screen-input = 0.
endif.
endloop.
may be it is helpfull to you....
Regards,
kishore.
‎2007 Feb 27 9:59 AM
Hi Neha...
Santosh has given the appropriate answer...
Regards,
Kishore.
‎2007 Feb 27 9:58 AM
‎2007 Feb 27 9:59 AM
In addition to teh above reply
Initiate the 'AT selection-screen' EVENT from radiobuttons.
In-order for the Radiobutton selection process to initiate the 'AT selection-screen' event you need to
add the 'USER_COMMAND' option to the parameter declaration. See code below.
*Code used to Initiate the 'AT selection-screen' EVENT from radiobuttons.
selection-screen begin of block group with frame title text-s04.
parameters: p_sel1 type c radiobutton group sel<b>user-command upd.</b>
parameters: p_sel2 type c radiobutton group sel.
selection-screen end of block group.
‎2007 Feb 27 9:59 AM
Try this:
Use the event AT SELECTION-SCREEN ON B1.
Check if B1 is checked .
use Loop at screen and dynamically set the status of F1/ F2 active / inactive.
‎2007 Feb 27 9:59 AM
PARAMETERS: p_b1 RADIOBUTTON GROUP mod USER-COMMAND com.
PARAMETERS: p_b2 RADIOBUTTON GROUP mod .
parameters: p_field type bukrs.
At selection-screen output.
loop at screen.
if screen-name eq 'P_FIELD'.
if p_b1 eq 'X'.
screen-input = '0'.
screen-output = '1'.
MODIFY SCREEN.
elseif p_b2 eq 'X'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
endif.
endif.
endloop.
‎2007 Feb 27 12:05 PM
hi
this can be done with one of the <b>selection-screen output</b> event and the <b>LOOP AT SCREEN.....MODIFY SCREEN.</b>
Like the following code:
At selection-screen output.
loop at screen.
if screen-name = 'fieldname1'.
if readiobutton1 = 'X'.
screen-input = '0'.
screen-output = '1'.
MODIFY SCREEN.
endif.
endif.
if screen-name = 'fieldname2'.
if radiobutton2 = 'X'.
screen-input = '1'.
screen-output = '1'.
MODIFY SCREEN.
endif.
endif.
endloop.
regards,
shamim.
‎2007 Feb 27 12:08 PM
Execute the code .
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .
selection-screen begin of block b1 with frame.
parameters : a(10) type c modif id abc.
parameters : b(10) type c modif id def.
selection-screen end of block b1.
at selection-screen output. "here do the coding.
IF R1 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF R2 = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'.
screen-INPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.Please close the thread if ur query is resolved .
Regards,
vijay.
‎2007 Apr 27 9:26 AM
Thanks very much.
I have the same problem.
I made several test,and failed.
I am failed at parameter input enable or disable when I change the radio button.
Anyone can provide a complete,clear solution?
‎2007 Apr 27 9:33 AM
Hi,
Please try this code. Reward points if helpful
----
PARAMETERS , SELECTION SCREEN
----
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_app RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND uc1,
p_file TYPE rlgrap-filename,
p_pre RADIOBUTTON GROUP g1,
p_file1 TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
IF p_app = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_FILE1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.