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

Former Member
0 Likes
459

Is it possible in table control to control the input status in different lines for the same column?

Exemple: Line 1 Column 1 input is active

Line 2 Column 1 input is inactive

Line 3 Column 1 input is active etc..

Regards,

Daniel Cantin

1 ACCEPTED SOLUTION
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
434

Your case of making certain rows editable can be handled but I am not sure if it can be done to a particular column level.

We can make desired rows (all columns) editable by including a module in PBO of that screen

Sample code: ( Here I am making certain rows editable based on a flag)

In PBO, write a module (here module editnew).

loop at ITAB with control TC_4000 cursor tc_4000-current_line.

module TC_4000_get_lines.

module editnew.

endloop.

MODULE editnew OUTPUT.

if itab-flag = 'X'.(Here flag is set for the rows to be made editable)

loop at screen.

screen-input = 1.

modify screen.

endloop.

endif.

ENDMODULE. "

4 REPLIES 4
Read only

madhu_vadlamani
Active Contributor
0 Likes
434

Hi Daniel,

What is the business requirement.What values are planning to display.

Regards,

Madhu.

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
435

Your case of making certain rows editable can be handled but I am not sure if it can be done to a particular column level.

We can make desired rows (all columns) editable by including a module in PBO of that screen

Sample code: ( Here I am making certain rows editable based on a flag)

In PBO, write a module (here module editnew).

loop at ITAB with control TC_4000 cursor tc_4000-current_line.

module TC_4000_get_lines.

module editnew.

endloop.

MODULE editnew OUTPUT.

if itab-flag = 'X'.(Here flag is set for the rows to be made editable)

loop at screen.

screen-input = 1.

modify screen.

endloop.

endif.

ENDMODULE. "

Read only

deepak_dhamat
Active Contributor
0 Likes
434

Hi ,

You can do that at each cell of table control I.E

suppose you have column name it_tab-qty1 and screen name it_tab-qty1 .

you can add logic to make editable and non editable as per your wish .

loop at screen.
    if ( screen-name = 'IT_QTY-QTY1' and it_qty-qty1 = 0 ) or ( screen-name = 'IT_QTY-QTY2' and it_qty-qty2 = 0 )
      or ( screen-name = 'IT_QTY-QTY3' and it_qty-qty3 = 0 )  or ( screen-name = 'IT_QTY-QTY4' and it_qty-qty4 = 0 )
      or ( screen-name = 'IT_QTY-QTY5' and it_qty-qty5 = 0 )  or  ( screen-name = 'IT_QTY-QTY6' and it_qty-qty6 = 0 )
      or ( screen-name = 'IT_QTY-QTY7' and it_qty-qty7 = 0 ) or ( screen-name = 'IT_QTY-QTY8' and it_qty-qty8 = 0 ).

      screen-input = 1.
      modify screen.
    endif.
  endloop.

in above logic it will keep cells editable which are having '0' value else non editable .

regards

Deepak.

Read only

0 Likes
434

Hi Daniel,

In the PBO of the module pool, inside the loop endloop, If I assume the module name to be 'MODULE HANDLE_FIELD':-

Loop at it_tab with control it_tab_cntrl.

module handle_field.

endloop.

MODULE HANDLE_FIELD.

  • Check if the column needs to be active for input

if it_tab-flag = 'X'.

loop at screen.

if screen-name = 'IT_TAB-COL1'.

screen-input = 1.

modify screen.

endif.

endloop.

endif.

ENDMODULE.