SAP PM & ABAP Code Niraj Visnoi

CXTAB_CONTROL in SAP ABAP and TABLE CONTROL

Home
What is SAP ?
SAP LSMW Explained with example
SAP PM T-Codes
PM BRD/COR Maintenance
Add Your URL
User Exits & Enhancements
Best Of SAP Links
BDC Code
My Resume
SAP SmartForms Step by Step
SAP ABAP ALV Grid Explained with Example
Useful Tips
Contact Information Guest Book and Consultants List
ABAP Code
ABAP System Fields
SAPScript
SAPScript Graphics
SAPScript Print Program
ABAP ListViewer
Dialog Programming
SAP Tables
SAP ALE and IDOC
Recommended SAP ABAP Coding guidelines
SAP General ABAP
Submit Your Code
SAP Books For consultants
Free Website Submission and ROR Sitemap generator
Free Domain Search
Free HoroScope

CXTAB_CONTROL deep structure explained .

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 ' '.
 

Enter supporting content here

http://sap.niraj.tripod.com

Search http://sap.niraj.tripod.com Search www

 http://sap.niraj.tripod.com      Niraj Visnoi *INDIA * niraj_visnoi@consultant.com      
 CELL No. 91 9911413767       Copyright © 2006 all rights reserved