‎2008 Nov 13 12:49 PM
Hi,
I have two fields order & contract on my screen. I want to ensure that only one field is input-enabled at any given point. I would like some sort of radio-button functionality wheerin if a user selects which field he wants to edit and subsequently the other field will be disabled.
How do i go for it .
Kindly suggest some method.
Bye
‎2008 Nov 13 1:02 PM
Assign some Function code for radio button and on PAI set one flag. then in PBO using that FLAG do as;
LOOP AT SCREEN.
If FLAG = '1'.
" Disable Contract field
ELSE
" Disable Order Field
ENDIF.
MODIFY SCREEN.
ENDLOOP.Regards
Karthik D
‎2008 Nov 14 5:19 AM
HI,
try like this..
at selection-screen output.
if r1 EQ 'X'.
loop at screen.
if screen-name = 'FIELD2'.
screen-input = 0.
modify screen.
endif.
endloop.
elseif r2 EQ 'X'.
loop at screen.
if screen-name = 'FIELD1'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
‎2008 Nov 15 4:56 AM
Hi,
I tried out both methods however they are not working. I've to press 'enter key' to invoke my code for checking & modiffying screen. I want the fields to be disabled immediately whenever the user select either of one radio button(i.e. user doesnt have to press enter key). also if i modify screen all values entered in other fields are getting erased. Kindly advice.
Bye
‎2008 Nov 15 12:29 PM
Hi Mac,
What we require is a very common requirement in the custom selection screen
The usual technique is to create the 2 fields as radio button assigned to a group..one will be X by default...when user clicks on another radio button we show the user input field
eg: PARAMETERS: r1 RADIOBUTTON GROUP rad1 DEFAULT 'X',
r2 RADIOBUTTON GROUP rad1.
At selection screen-output.
if r1 = 'X'.
loop at screen .
if screen-name = 'ORDER'.
screen-input = 1.
screen-active = 1.
modify screen.
endif.
if screen-name = 'OTHER'..
screen-input = 0.
screen-active = 0.
modify screen.
endif.
modify screen.
endloop.
else..
*****do opposite
endif.
So when user presses other radio button.......the other radio button = 'X'.....and code will act accordingly.
Hope it helps
Regards
Byju
‎2008 Nov 17 7:02 AM
Hi Mac,
Use USER-COMMAND addition to raise PAI and avoid press enter when any of the option picked in the radio button group.
Ex:
PARAMETER p_opt1 RADIOBUTTON GROUP rad1 USER-COMMAND enter.
PARAMETER p_opt2 RADIOBUTTON GROUP rad1 DEFAULT 'X'.
Regards,
Suresh