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

Dynamic Hide column in table control

Former Member
0 Likes
6,345

I want to hide colum of table control in program, and then it can invisible,but others is visible.

how should i do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,197

Hi, Try this:

Use structure 'cols'

eg. my_control is your table control

code:-

loop at my_control-cols into wa.

if wa-index = 2. "your hidden column

wa-invisible = 1.

endif.

modify my_control-cols from wa.

endloop.

Hope it helps,

Victor.

9 REPLIES 9
Read only

Former Member
0 Likes
3,197

Hi,

try this...

loop at screen.
if screen-name eq 'XXXX'.
screen-invisible eq '1'.
endif.
endloop.

Regards,

Sathish Reddy.

Read only

0 Likes
3,197

thank you !

But i want to hide column.

if i do it like you said,i only hide data of the column,but colum is invisible.

Read only

Former Member
0 Likes
3,197

Hello,

You can do like this

LOOP AT SCREEN.
CASE screen-name.
WHEN 'CCC'.
screen-input = 0.
screen-output = 0.
screen-active = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.

Regards,

Vasanth

Read only

0 Likes
3,197

hello,

thanks.

It also can not work as i think.

Read only

Former Member
0 Likes
3,198

Hi, Try this:

Use structure 'cols'

eg. my_control is your table control

code:-

loop at my_control-cols into wa.

if wa-index = 2. "your hidden column

wa-invisible = 1.

endif.

modify my_control-cols from wa.

endloop.

Hope it helps,

Victor.

Read only

0 Likes
3,197

yes, it work.

thank you very much!

Read only

0 Likes
3,197

Loop at screen is not going to that field for which i want to hide the value.

Can u plz help!!!

Read only

0 Likes
3,197

Perfect! Let me just add that this works also if you want to hide a column in a generated view maintenance screen (transaction SM30): There is the global variable <vim_tctrl>: At PBO you can loop at <vim_tctrl>-cols and set the flag <vim_tctrl>-cols-invisible = 1.

Read only

Former Member
0 Likes
3,197

Hello All,

I am trying to implement the above solution. I am facing some issues.

I have used a table maintenance generator. So Depending on the Fields I have choosed, screen is automatically generated with table control : TCTRL_FSH_SOFN_V.

Now, I have to declare a work area to store the values of the above type.

How do i do it??

The highlighted portion gives an syntax error as the table control is not defined.

data: wa_FSH_SOFN_V_cols type LINE OF TCTRL_FSH_SOFN_V-COLS.

loop at TCTRL_FSH_SOFN_V-COLS to wa_FSH_SOFN_V_cols."into .

   if sytabix = 4.

     wa_FSH_SOFN_V_cols-INVISIBLE = 1.

     MODify TCTRL_FSH_SOFN_V-COLS from wa_FSH_SOFN_V_cols.

    endif.

   

    endloop.