2007 Jun 12 5:31 PM
Hi experts,
I would like to change a table control so that an specific line be read-only.
The other lines can be edit by the user.
How can I do that?
Thanks a lot!!!
Cristiana
2007 Jun 12 5:42 PM
You need to change the field attributes of the one line, see this code.
This is the screen flow logic within the screen. Notice the MODULE inside the loop. Here I_TAB is the name of the internal table used in the table control named I_TABCON
PROCESS BEFORE OUTPUT.
LOOP AT I_TAB
WITH CONTROL I_TABCON
CURSOR I_TABCON-CURRENT_LINE.
MODULE I_TABCON_CHANGE_FIELD_ATTR.
ENDLOOP.
MODULE STATUS_0300.
So in the MODULE I_TABCON_CHANGE_FIELD_ATTR is where you will turn off the one row. Here we are making only the first row as inactive.
module i_tabcon_change_field_attr output.
modify i_tab index i_tabcon-current_line.
if i_tabcon-current_line = '1'.
loop at screen.
screen-input = '0'.
modify screen.
endloop.
endif.
endmodule.
Regards,
Rich Heilman
2007 Jun 12 5:42 PM
You need to change the field attributes of the one line, see this code.
This is the screen flow logic within the screen. Notice the MODULE inside the loop. Here I_TAB is the name of the internal table used in the table control named I_TABCON
PROCESS BEFORE OUTPUT.
LOOP AT I_TAB
WITH CONTROL I_TABCON
CURSOR I_TABCON-CURRENT_LINE.
MODULE I_TABCON_CHANGE_FIELD_ATTR.
ENDLOOP.
MODULE STATUS_0300.
So in the MODULE I_TABCON_CHANGE_FIELD_ATTR is where you will turn off the one row. Here we are making only the first row as inactive.
module i_tabcon_change_field_attr output.
modify i_tab index i_tabcon-current_line.
if i_tabcon-current_line = '1'.
loop at screen.
screen-input = '0'.
modify screen.
endloop.
endif.
endmodule.
Regards,
Rich Heilman
2007 Jun 12 6:30 PM
2007 Jun 12 6:32 PM