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

Adding Columns to a table control at Run Time

Former Member
0 Likes
878

Hi All,

Is it possible to add columns to a table control dynamically?

Let us suppose that we have defined a table control with three columns (say matnr, matkl, meins) initially. Based on some values I would like to add one more column to the existing table contro at run time. Is it possible? If yes, could you let me know the procedure of doing it?

Thanks & Regards,

Phani.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
776

Hi,

The other way is possible...

add all columns.., Then Hide the unwanted columns. if you want them in runtime make it visible.

Regards

vijay

Regards

vijay

Hi All,

Is it possible to add columns to a table control dynamically?

Let us suppose that we have defined a table control with three columns (say matnr, matkl, meins) initially. Based on some values I would like to add one more column to the existing table contro at run time. Is it possible? If yes, could you let me know the procedure of doing it?

Thanks & Regards,

Phani.

4 REPLIES 4
Read only

Former Member
0 Likes
777

Hi,

The other way is possible...

add all columns.., Then Hide the unwanted columns. if you want them in runtime make it visible.

Regards

vijay

Regards

vijay

Read only

0 Likes
776

Hi Vijay,

Thanks for the prompt reply.

But I can not expect the number of columns. I will get some values into an internal table.

If I get two values into the table, then I have to display two columns, if I get 10 values then I have to display 10 columns with value as column header.

Thanks & Regards,

Phani

Read only

0 Likes
776

Hi,

in that case you can use OO ALV , here Build Dynamic internal table and show the data in ALV grid control.ALV grid and table control looks same.this is simple also.

Regards

vijay

Read only

Former Member
0 Likes
776

HI Phani,

I think we cannot change the number of columns to a table control.THe way vijay pointed was the only one.add all the colums and make them invisible.

THanks,

Santosh