Application Development 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: 

Dynamic Hide column in table control

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

try this...

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

Regards,

Sathish Reddy.

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

hello,

thanks.

It also can not work as i think.

Former Member
0 Kudos

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.

0 Kudos

yes, it work.

thank you very much!

0 Kudos

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

Can u plz help!!!

0 Kudos

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.

Former Member
0 Kudos

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.