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

sushant_singh
Participant
0 Likes
454

hi all,

i have an issue regarding table control.

i want to hide an entire column in a table control.

how can i do it.

please send me the code.

thanks .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

Hi Sushant, As per my understanding u want to hide the couloumn after a button click is it??? You can do this in the User command of the screen control by reading the reading the column which was selected using the below syntax...

Read TABLE <TCNAME>-COLS INTO <WA_TC> WITH KEY SELECTED = X

(declare a work area of type <TCNAME>-COLS ). Now try use the invisble option of this work area. I hope this might help you in solving u r query...

Regards,

Swaroop

4 REPLIES 4
Read only

andreas_mann3
Active Contributor
0 Likes
431

Hi,

try with abap command:

loop at screen.

..

screen-invisible = 1...

A.

Read only

Former Member
0 Likes
431

Hi

U need to change the attribute of table control out of the loop of PBO:

- In the TOP

CONTROLS <TABLE CONTROL> TYPE TABLEVIEW USING SCREEN <SCREEN>.

DATA: BEGIN OF WA_CTRL,
        SCREEN        LIKE SCREEN,     "Attributes struktur SCREEN
        INDEX            TYPE I,         "Position of a column on the screen
        SELECTED(1) TYPE C,          "Indicator 'column selected'
        VISLENGTH    LIKE ICON-OLENG, "Visualised length of a column
        INVISIBLE(1)   TYPE C,         "Indicator 'column invisible'
      END   OF WA_CTRL.

* In the PBO

MODULE CHANGE_TABLE_CONTROL.

LOOP..
ENDLOOP.

MODULE CHANGE_TABLE_CONTROL.
  LOOP AT  <TABLE CONTROL>-COLS INTO WA_CTRL.
    IF WA_CTRL-SCREEN-NAME.
      WA_CTRL-SCREEN-INPUT = 0.
      WA_CTRL-INVISIBLE = 'X'.
      MODIFY  <TABLE CONTROL>-COLS FROM WA_CTRL.
    ENDIF. 
  ENDLOOP.
ENDMODULE.

Max

Read only

Former Member
0 Likes
431

normally u can go to properties of table control and hide the column...or else in one scenario if u want then u have to loop at screen...and make the column invisible and modify screen...

Read only

Former Member
0 Likes
432

Hi Sushant, As per my understanding u want to hide the couloumn after a button click is it??? You can do this in the User command of the screen control by reading the reading the column which was selected using the below syntax...

Read TABLE <TCNAME>-COLS INTO <WA_TC> WITH KEY SELECTED = X

(declare a work area of type <TCNAME>-COLS ). Now try use the invisble option of this work area. I hope this might help you in solving u r query...

Regards,

Swaroop