‎2006 Apr 25 4:15 PM
Hello,
Is it possible to add columns to a table control at runtime?
Thanks in advance!
With kind regards,
Sven
‎2006 Apr 25 4:21 PM
‎2006 Apr 25 4:32 PM
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.
‎2006 Apr 25 4:38 PM
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