09-15-2008 8:10 AM
HI,experts
in the program there is one parameter p_recount.
in my table control ,there are 5 columns, f1 f2 f3 f4 f5
f1 f2 f3 is display only, and if p_recount = 00.,f4 f5 may input but if p_recount != 00.
f4 f5 also display only.
and when i push the "new" button,all the 5 fileds are input fields.
when i use LAY OUT to set attributes for the fields,the input/output attributes may not change
i think.
if there is some way to do this in the program use code?
how to do this?
thank you very much!
Edited by: hongtan zhang on Sep 15, 2008 9:11 AM
09-15-2008 8:15 AM
Hi,
In PBO write code to call a method inside Loop at itab with control statement.
And in that method write Loop at screen and check p_recount and field name and modify the filed attributes accordingly.
Regards
Karthik D
09-15-2008 8:18 AM
Hi
You can do like this.
In the PBO -
loop at tabcntl1-cols into cols.
if cols-screen-group1 = 'MOD'.
cols-screen-input = '0'.
modify tc-cols from cols.
endif.
endloop.
tabcntl1 is Table Contreol name
assign fields which you want to display into one group(MOD). Do this while creating table control fields. so that you can get N number of fields in display mode.
09-15-2008 8:28 AM
Hi you group the fields F1,F2,F3 in a single group1 named 'GP1'. and f4,f5 in group 'GP2'..
you also create a another group 'GP3' having all fields.
now in PBO.
loop at <i_tab> with control <tc-con>.
module modify.
if ok_code = 'NEW'.
loop at screen .
if screen-group2 = 'GP3'.
screen-input = '1'.
modify screen.
endif.
endloop.
endif.
loop at screen .
if screen-group1 = 'GP1'.
screen-input = '1'.
modify screen.
endif.
endloop.
loop at screen .
if screen-group1 = 'GP2'.
screen-input = '1'.
modify screen.
endif.
endloop.
09-16-2008 4:29 AM
09-16-2008 6:34 AM
Hi,
i do it as you say.
but i can't pass error check
where should i put this code in?
in the status or ??
09-17-2008 2:43 PM
Hi for error check.
you write code in PAI.
chain.
field:f1,f2,f3.
module validation.
endchain.
now for module validation.
write your condition like
if f1 > f2.
message e001( zsgclass).
endif.