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

Table Control - Add columns at runtime

Former Member
0 Likes
595

Hello,

Is it possible to add columns to a table control at runtime?

Thanks in advance!

With kind regards,

Sven

3 REPLIES 3
Read only

Former Member
0 Likes
362

SVEN,

JUST CHECK THE LINKS BELOW

if u find useful award some points

regards

Naveen

Read only

Former Member
0 Likes
362

Hi Sven,

I think you can do this.. Declare all the columns and hide some of them during PBO and as per the user action, diplay the column in PAI.

Regards,

Tanveer.

Mark helpful answers.

Read only

Former Member
0 Likes
362

Hi,

Adding to what Tanveer said, to hide the coloumns at runtime you can use the following code and then display all of them in the PAI.

How do I hide a column in a table control at runtime? 1. define group name(s) for the columns to be hidden

2. Add the following code...

(define)

controls tbl_ctrl type tableview ...

wa like tbl_ctrl-cols.

loop at tbl_ctrl-cols into wa.

if wa-screen-group1 = <group defined for the column>

wa-invisible = 1.

modify tbl_ctrl-cols from wa

endif

endloop

How do I change attributes of an item in a screen and in a table control at runtime?

add the following code in PBO

loop at screen.

if screen-name = 'NAME_OF_FIELD_HERE_IN_CAPS'.

set attributes of screen such as REQUIRED, INPUT, OUTPUT, INTENSIFIED, INVISIBLE, ACTIVE, DISPLAY_3D, VALUE_HELP to 1(ON) or 0(OFF)

e.g. screen-output = 1.

modify screen.

endif.

endloop

if the field is part of a table control, put the above code within the the loop...endloop of the table control in PBO

Please reward if it helps.

Regards,

Amit Mishra