CXTAB_CONTROL
When we create a control variable of type TABLEVIEW by using CONTROLS
statement in ABAP to access table control from within ABAP ,the control variable
created is of deep structure type CXTAB_CONTROL.This structure itself consists of a structure(or
line) of type CXTAB_COLUMN which represents the columns found on the table control and can be used
to modify column properties.These
structures are defined in type group CXTAB.
By changing or reading various fields of these structures we can modify the behaviour of table control at
run time in general and its columns.
e.g.
To make a particular record as the top record in the table control we can use the field TOP_LINE
of the structure CXTAB_CONTROL .
tab_con-TOP_LINE = 5 " here tab_con is the name of the table control.
Some of the useful fields of the structure CXTAB_CONTROL are:
LINES
This field or attribute is used to specify the total number of records the table control will be showing and according
to SAP must be filled explicitly before any LOOP ... ENDLOOP statement .LINES field having a correct value ensures automatic
and correct scrolling.It sis of TYPE I.
TOP_LINE
This field indicates the index of the record being shown in the top of the table control.It is of TYPE I.This field is
used often for extended or self scrolling functions.
CURRENT_LINE
This field specifies the index of the current record being processed in the screen loop statement.It cannot be changed
and its value is set by the system.It is of TYPE I.This field is used to determine the index and
then used in PBO or PAI
to read the internal table or to modify the internal table.
e.g.
READ TABLE itab INTO workarea INDEX tab_con-CURRENT_LINE .
MODIFY TABLE itab FROM workarea INDEX tab_con-CURRENT_LINE.
FIXED_COLS
This field is used to change the number of lead columns(fixed) in table control at runtime.It is of TYPE
I.
LEFT_COL
This field is used to speify the first column that can be horizontallyy scrolled from the lead columns.It is of TYPE I.
INVISIBLE
This field can be used to hide or make visible the entire table control at run time.It is of TYPE
C(1) and can have value of 'X' or ' '.
COLS
This field is used to modify various column attributes at run time and represents
the collection of all the columns in the table control.It is of TYPE CXTAB_COLUMN which
is an internal table without header line.