Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

toggle between fields

Former Member
0 Likes
805

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

5 REPLIES 5
Read only

Former Member
0 Likes
611

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

Read only

Former Member
0 Likes
611

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.

Read only

0 Likes
611

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

Read only

0 Likes
611

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

Read only

0 Likes
611

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