‎2008 Sep 15 10:56 AM
hi all,
how to make fields in a table control as visible and invisible at programming level?
i know how to do it at screen level.
please help me on this issue.
thanks in advance...
‎2008 Sep 15 11:06 AM
Hi
It can't hide a single field of table control, but only to make it available for input/output or output only.
It can do it by LOOP AT SCREEN statament into LOOOP/ENDLOOP of table control in PBO:
PROCESS PBO
LOOP AT. ....
MODULE SCREEN.
ENDLOOP.
MODULE SCREEN.
LOOP AT SCREEN.
IF ......
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDMODULE.It can hide a colunm changing the parameters of table control:
CONTROLS: T_CTRL TYPE TABLEVIEW .............................
* Workarea for table control
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.
PROCESS PBO
MODULE CHANGE_T_CTRL.
MODULE CHANGE_T_CTRL.
LOOP AT T_CTRL-COLS INTO WA_CTRL.
IF .......
WA_CTRL-INVISIBLE = 'X'.
MODIFY T_CTRL-COLS FROM WA_CTRL.
ENDIF.
ENDLOOP.
ENDMOUDLE.Max
‎2008 Sep 15 11:06 AM
Hi
It can't hide a single field of table control, but only to make it available for input/output or output only.
It can do it by LOOP AT SCREEN statament into LOOOP/ENDLOOP of table control in PBO:
PROCESS PBO
LOOP AT. ....
MODULE SCREEN.
ENDLOOP.
MODULE SCREEN.
LOOP AT SCREEN.
IF ......
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDMODULE.It can hide a colunm changing the parameters of table control:
CONTROLS: T_CTRL TYPE TABLEVIEW .............................
* Workarea for table control
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.
PROCESS PBO
MODULE CHANGE_T_CTRL.
MODULE CHANGE_T_CTRL.
LOOP AT T_CTRL-COLS INTO WA_CTRL.
IF .......
WA_CTRL-INVISIBLE = 'X'.
MODIFY T_CTRL-COLS FROM WA_CTRL.
ENDIF.
ENDLOOP.
ENDMOUDLE.Max
‎2008 Sep 15 11:09 AM
Hi Raghu,
You can do this at programming level too.
in PBO write the following code.
loop at screen.
if ( screen-group1 EQ 'ZR1' ).
screen-invisible = 1.
endif.
modify screen.
endloop.
Regards,
Kiran
‎2008 Sep 15 11:09 AM
you need to loop on the screen table
in the pbo module, write a code similar to this...
suppose your table control is named as tabctrl and it has two fields f1 and f2.
loop at screen.
if screen-name = 'TABCTRL-F1'.
screen-invisible = 1. "this will make the entire column F1 visible, for particular cells, you will need to pass the index as for example TABCTRL-F1(1) - first row
endif.
modify screen.
endloop.
‎2008 Sep 15 11:14 AM
Just do loop at screen , and inside the loop make the field invisible for that particular screen element name. Refer the example code below. This will make the screen invisible for the field LIPS-LGORT
LOOP AT SCREEN.
CHECK SCREEN-NAME = 'LIPS-LGORT'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDLOOP.
‎2008 Sep 15 11:51 AM
hi,
try like this...
data : cols like line of tc-cols.in PBO
loop at tc-cols into cols.
if cols-screen-group1 eq 'MOD'.
screen-input eq '0'.
modify tc-cols from cols.
endif.
endloop.here tc is table control.
MOD is group specified in screen painter.
Regards,
Sathish Reddy.