‎2008 Oct 07 5:25 AM
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
‎2008 Oct 07 6:09 AM
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
‎2008 Oct 07 5:29 AM
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.
‎2008 Oct 07 5:49 AM
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"
‎2008 Oct 07 5:56 AM
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
‎2008 Oct 07 6:00 AM
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.
‎2008 Oct 07 6:36 AM
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)
‎2008 Oct 07 11:01 AM
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.
‎2008 Oct 07 6:09 AM
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
‎2008 Oct 07 6:11 AM
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.