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 : Column Hiding Issue

Former Member
0 Likes
1,396

Hi All ,

Already made a search on SDN.

My requirement is to hide a column in table control , based on a condition.

Have already used code like :


  LOOP AT SCREEN.
    IF screen-name = 'XXX' .
"Condition 
        screen-active = 0.
        screen-invisible = 1.
        screen-input = 0.
"End Condition 
      ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

But not able to hide the column , by any combination of these.

Please help to hide whole column in table control.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,202

Hi,

To hide a column we will use the INVISIBLE field of the structure CXTABA_CONTROL and set its value to 'X'.

e.g. To hide column number 3.

DATA col LIKE LINE OF tab-con-COLS .

READ TABLE tab_con-COLS INTO col WHERE index = 3. "tab_con is the name

" of table control.

col-INVISIBLE = 3.

MODIFY tab-con-COLS FROM col INDEX 3.

7 REPLIES 7
Read only

Former Member
0 Likes
1,202

Hi Harsha,

After a Long time,

Check the Below thread

LOOP AT SCREEN.
    IF screen-name = 'XXX' .
"Condition 
        screen-active = 0.
        screen-invisible = 1.
        screen-input = 0. 
"With the above code the rows of table control get disabled not the Entire Column
"End Condition 
      ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Regards

Ram

Read only

Former Member
0 Likes
1,203

Hi,

To hide a column we will use the INVISIBLE field of the structure CXTABA_CONTROL and set its value to 'X'.

e.g. To hide column number 3.

DATA col LIKE LINE OF tab-con-COLS .

READ TABLE tab_con-COLS INTO col WHERE index = 3. "tab_con is the name

" of table control.

col-INVISIBLE = 3.

MODIFY tab-con-COLS FROM col INDEX 3.

Read only

Former Member
0 Likes
1,202

HI,

1.FIRST WRITE THE MODULE CODE TO INVISIBLE THE COLUMN IN PBO.

(i.e BETWEEN LOOP AND ENDLOOP OF INTERNAL TABLE WITH TABLE CONTROL).

2.IN MAIN PROGRAM WRITE THE BELOW SAID CODES FOR THE PARTICULAR INVISIBLE MODULE

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'GP1'.

SCREEN-ACTIVE = '0'.

SCREEN-INPUT = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

TRY THIS....

REGARDS,

SAKTHIVEL.VT

Read only

Former Member
0 Likes
1,202

hi,

try this-it might help.

use structure cols.

eg-my_control is your table control

code-

loop at my_controls into wa

if wa-index = 2. "ur hidden column

wa-invisible = 1.

endif

modify my_control-cols from wa.

endloop.

Regards,

Amruta

Read only

StMou
Active Participant
0 Likes
1,202

delete cause of Double display

Edited by: stéphane mouraux on Feb 26, 2010 8:20 AM

Read only

StMou
Active Participant
0 Likes
1,202

Hi,

See on SAP cours TAW12 2/3

You can change attributes. (intensified, reauired,...)


LOOP AT my_control-cols INTO wa.
IF wa-index BETWEEN 1 AND 3.
wa-screen-intensified = 1.
wa-invisible = 1.
ELSE.
wa-screen-intensified = 0.
wa-invisible = 0.
ENDIF.
MODIFY my_control-cols FROM wa.
ENDLOOP.

Rgds

Read only

Former Member
0 Likes
1,202

Small point of confusion .....

If this column is made invisible , will the existing validation work on it ???