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

Table Control with a line read only

Former Member
0 Likes
1,389

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

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
804

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

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

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
805

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

Read only

0 Likes
804

Perfect, thanks a loooooooooooooooooot!

Cristiana

Read only

0 Likes
804

Sweet........right? Your welcome.

Regards,

Rich Heilman