‎2010 Feb 26 6:11 AM
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.
‎2010 Feb 26 6:27 AM
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.
‎2010 Feb 26 6:20 AM
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
‎2010 Feb 26 6:27 AM
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.
‎2010 Feb 26 6:29 AM
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
‎2010 Feb 26 6:32 AM
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
‎2010 Feb 26 7:20 AM
delete cause of Double display
Edited by: stéphane mouraux on Feb 26, 2010 8:20 AM
‎2010 Feb 26 7:20 AM
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
‎2010 Feb 26 7:27 AM
Small point of confusion .....
If this column is made invisible , will the existing validation work on it ???