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

Add dynamic column to table control

Former Member
0 Likes
1,086

Hi experts,

I want add new column dynamically (code abap) to table control

How can i do?

Thanks

3 REPLIES 3
Read only

Kiran_Valluru
Active Contributor
0 Likes
654

Hi,

As far I know it is not possible to add columns to table control dynamically, Instead first Add all columns to table control and hide them . At runtime you can show the columns of table control.

Else,

If you want to add dynamically only then.,

Use OO ALV. build a dynamic internal table and pass it to ALV ..

hope this helps u.,

Thanks & Regards,

Kiran

Read only

Former Member
0 Likes
654

Hi,

declare as many columns as u like initially. u can hide the display of the columns as and when u wish..

it is possible with the use of TYPE-POOLS cxtab.

declare TYPE-POOLS cxtab.

DATA v_tccols TYPE cxtab_column .

FIELD-SYMBOLS: <tc_cols> TYPE cxtab_control .

data tcname(25) type c.

assign table control name to tcname and assign tcname to tc_cols.

with this u can manipulate what ever columns u want to display or hide

Read only

Former Member
0 Likes
654

Hi,

declare as many columns as u like initially. u can hide the display of the columns as and when u wish..

it is possible with the use of TYPE-POOLS cxtab.

declare TYPE-POOLS cxtab.

DATA v_tccols TYPE cxtab_column .

FIELD-SYMBOLS: <tc_cols> TYPE cxtab_control .

data tcname(25) type c.

assign table control name to tcname and assign tcname to tc_cols.

with this u can manipulate what ever columns u want to display or hide

Edited by: sapabap403 on Sep 14, 2011 10:09 AM