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

Disabling single Screen field

Former Member
0 Likes
12,597

Hi Friends,

Plz help me how to disable single Screen field in Module pool.

I have a scenario where One of the field is drop down box,in that options if i select 1 option the next Input/outputfield and Group of radio buttons(2buttons) should be disable.

PlZ help me with the solution

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,796

hi

it may help u.

in drop down box each option should have function code.

now in pai

use

case ok_code.

when 'option 1'

loop at screen.

if screen name = 'group1' or screen name = ' input field name'.

screen input = 0.

modify screen.

endif.

endloop.

endcase.

or

if ok_code = 'option1'.

loop at screen.

if screen name = 'group1' or screen name = ' input field name'.

screen input = 0.

modify screen.

endif.

endloop.

regards

anil

8 REPLIES 8
Read only

Former Member
0 Likes
4,795

set the function code to list box. once you select the list box field, the function code will be triggered, after that PBO will trigger ,based on the value you can disable the screen field in PBO using loop at screen.

loop at screen.
if list_field = '1233'.
 if screen-name = 'SCREENFIELD'.
 screen-input  = 0.
 modify screen.
endif.
endif.

endloop.

Read only

0 Likes
4,795

HI VIJAY ,

as per the code u have given me it will disable all other fields in the screen .my requirement is if i select 1value from listbox only one field and radiobuttons should be disable.i have 2 other fields in the screen those should not bedisable.

for ex:

Accomidation -


guest house}------List box

hotel }

hotel type -


ordinary}

3star}

7 star} rb1

rb2

mode of travel------ car

flight

if i select 'guest house' in the accomidation field hotel type field and radiobuttons rb1.rb2 should be disable.but mode of travel will be always Enable.my code should not effect 'Mode of travel field"

Read only

0 Likes
4,795

Hi Pranu,

As Vijay has specified the sample code for you to disable the field in the module pool


loop at screen.
if list_field = '1233'.
 if screen-name = 'SCREENFIELD'.
 screen-input  = 0.
 modify screen.
endif.
endif.
 
endloop.

Inside the Loop just k set a Flag = 1 and then after if again check the Flag to disable the other field.


data: flag type i.  " decalare it in the Top include

loop at screen.
if list_field = '1233'.
 if screen-name = 'SCREENFIELD'.
 flag = 1
 screen-input  = 0.
 modify screen.
endif.
if flag = 1.
  if screen-name = 'XXXX' OR
   screen-name = 'YYY'.

     screen-input  = 0.   "----" This will disable your radio button where XXX and YYY is your radio buttons
      modify screen.


  endif.
endif.
endif.
 
endloop.


Thanks,

Chidanand

Read only

0 Likes
4,795

using the screen group you can disable/enable the elements with minimal coding.

i hope you know about screen groups, click on any field in the attributes popup you can see group1,2,3,4

loop at screen.
if list_field = '1233'.
 if screen-group1 = 'GRP1'.  "<--assign the screen group to all the elements which you want 
 screen-input  = 0.
 modify screen.
endif.
endif.
 
endloop.

Read only

0 Likes
4,795

Sorry to say this vijay the code is not working.in PBO i have written following code

loop at screen.

IF ZATC_TOUR1-ACCOMODATION = 'GUEST HOUSE'.

if screen-group1 = 'G1' and screen-group2 = 'G2'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

G2(group i have assigned it for radio button group)

Read only

0 Likes
4,795

Hi,

This is Ur Code.

loop at screen.

IF ZATC_TOUR1-ACCOMODATION = 'GUEST HOUSE'.

if screen-group1 = 'G1' and screen-group2 = 'G2'.

screen-input = 0.

modify screen.

endif.

endif.

endloop.

Change it as :

IF ZATC_TOUR1-ACCOMODATION = 'GUEST HOUSE'.

loop at screen.

if screen-group1 = 'G1' OR screen-group2 = 'G2'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

In the If Condition change AND as OR.

Read only

Former Member
0 Likes
4,797

hi

it may help u.

in drop down box each option should have function code.

now in pai

use

case ok_code.

when 'option 1'

loop at screen.

if screen name = 'group1' or screen name = ' input field name'.

screen input = 0.

modify screen.

endif.

endloop.

endcase.

or

if ok_code = 'option1'.

loop at screen.

if screen name = 'group1' or screen name = ' input field name'.

screen input = 0.

modify screen.

endif.

endloop.

regards

anil

Read only

Former Member
0 Likes
4,795

hai,

use group option in screen attributes...

loop at screen.

if screen-group1 = 'ERD'.

screen-active = '0'.

screen-input = '0'.

screen-output = '0'.

screen-invisible = '1'.

*screen-name = ' '.

endif.

modify screen.

endloop.

use this then only u can disable every thing in the screen.

shan.