‎2007 Dec 13 12:17 PM
Dear All,
I have to change the table control column header with internal table value dynamically. Can anyone please help me out. The table control column needs to be replaced with internal table value.
Hoping for your wonderful support.
Thanks and regards,
Atanu
‎2007 Dec 13 12:24 PM
Hi,
Just set it to a global variable name, and then set the value of that global variable as needed, e.g. in your TOP include define "g_my_header(20) type c" and then use g_my_header in the "Table column header" definition in the Dynpro... and in your PBO code put a value in g_my_header.
Reward points if found helpful...
Cheers,
Chandra Sekhar.
‎2007 Dec 13 12:24 PM
‎2007 Dec 13 12:28 PM
Hi
Attributes & Creation CXTAB_CONTROL Modification
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.
CXTAB_COLUMN
To access and modify the columns of the table control at run time w have to use the fields of the structure CXTAB_COLUMN which is a line of the structure CXTAB_CONTROL..This structure has 5 fields
The fields of this structure are :
SCREEN
This filed is of TYPE SCREEN (screen table noramally used in ABAP) .It is
used to modify and access various screen element attributes that created the column .
e.g. SCREEN-NAME will return the screen element that created the
column ( e.g if the screen elemrnt ADDRESS-PHONE created the column PHONE than the SCREEN-NAME will return the value ADDRESS-PHONE
and not PHONE ,so we have to use offset method to retrieve the correct field name i.e SCREEN-NAME(+7) will give us the value PHONE ,This method can
be used for example in dynamic sorting of the column fields when the name
of the column selected is required and not its screen element name
e.g SORT itab STABLE BY SCREEN-NAME(+7) .
INDEX
This field represents the position of the column in the table control.It is of TYPE I.
INVISIBLE
This field is used to make a particular column invisible or visible.It is of TYPE C(1) and can have a vale of 'X' or ' '.
VISLENGTH
This field represents the visible length of the column.It is of TYPE I.
SELECTED
This field represents whether the column is selected or not.It is of TYPE C(1) and can have a value of 'X' or ' '.
Reward if useful
Jgds