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: 

table control

Former Member
0 Kudos

hi

Can anyone tell me how do I hide a column in a table control at runtime?

regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try the following steps

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

Award pts if helpful

Ankit

3 REPLIES 3

Former Member
0 Kudos

Hi,

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

Hope this helps.

Former Member
0 Kudos

Try the following steps

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

Award pts if helpful

Ankit

former_member150733
Contributor
0 Kudos

Create a <b>new module in PBO</b>... and in the module do coding as below:

DATA:cols TYPE cxtab_column.

LOOP AT TABC_200-cols INTO cols WHERE SCREEN-NAME = <i>'field u want to hide'</i>.

cols-invisible = 'X'.

MODIFY TABC_200-cols FROM cols.

ENDLOOP.

<b>In TOP include:</b>

CONTROLS:TABC_200 TYPE TABLEVIEW USING SCREEN 200.

where TABC_200 is the table control name & 200 is the Screen Number

Regards,

Anish Thomas

<i>Pls reward all useful answers</i>