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

Hiding a Table Control

Former Member
0 Likes
620

Is it possible to hide a table control based on some conditions? If so, how?

Thanks in advance!

4 REPLIES 4
Read only

Former Member
0 Likes
596

data cols like line of itab-cols.

loop at itab-cols into cols.

if cols-screen-group1 = 'G1' or cols-screen-group1 = 'G2'.

cols-screen-input = '0'.

else.

cols-screen-input = '1'.

endif.

modify itab-cols from cols index sy-tabix.

endloop.

try to use the above code in PBO event

Hope it will be help

don't forget reward points if helpful

Read only

Former Member
0 Likes
596

Hi

U can hide the colunms only, not the table control.

If you want to hide the table control you should use a two subscreens, one with the table control and one empty; when you want to hide the tc you call the empty subscreen instead of the subscreen with tc.

If you want to hide the colunms:

TYPE-POOLS: CXTAB.

DATA: COL LIKE CXTAB_COLUMN.

LOOP AT <TABLE CONTROL>-COLS INTO COL.
  IF COL-SCREEN-NAME = . ......
    COL-SCREEN-INVISIBLE = 'X'.
    MODIFY <TABLE CONTROL>-COLS FROM COL.
  ENDIF.
ENDLOOP.

Place a code like above in PBO before the loop of table control.

Max

Read only

Former Member
0 Likes
596

Please try following code .

<table control>-invisible = 'X'.

If helpful this answer please award neccessary points.

Rgds,

Ranjith

Read only

Former Member
0 Likes
596

hi,

make one button in status.

and write in USER_COMMAND_9000 module of PAI.

<b>MODULE user_command_9000 INPUT.</b>

CASE sy-ucomm.

WHEN 'BACK' OR 'UP' OR 'CANC'.

LEAVE PROGRAM.

<b> WHEN 'HIDE'.

tab1-invisible = 'X'.</b>

ENDCASE.

<b>ENDMODULE. " USER_COMMAND_9000 INPUT</b>

reward if useful.