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: 

Adding Columns to a table control at Run Time

Former Member
0 Kudos
155

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

former_member188685
Active Contributor
0 Kudos
53

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

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos
54

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

0 Kudos
53

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

0 Kudos
53

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

Former Member
0 Kudos
53

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