Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamic strctures about TABLEVIEW and SCREEN

Former Member
0 Likes
1,868

Hi experts ,

Can any one send me and help me to explain about dynamic stctures(or tables)

Dynamic strctures about TABLEVIEW and SCREEN.

what are the fields are consist of this stctures and their ussage in screen programming for table control

say like top_line and current_line like and input ,invisible.

CONTROLS: tc_tablecontrol TYPE TABLEVIEW USING SCREEN 1000,

Thanks

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
1,006

Screen:

Component Length Type Attribute Description

name 132 c Name Name

group1 3 c Group1 Modification group

group2 3 c Group2 Modification group

group3 3 c Group3 Modification group

group4 3 c Group4 Modification group

required 1 c Required-entry field Mandatory field

input 1 c Input input-enabled field

output 1 c Output display field

intensified 1 c Intensified intensified field

invisible 1 c Invisible invisible element

length 1 x visLength Field length

active 1 c Input/Output/Invisible active field

display_3d 1 c Two-dimensional Box

value_help 1 c Input help Input help key

request 1 c - Input exists

values_in_combo 1 c Dropdown listbox Value help exists

Tableview (structure CXTAB_CONTROL)

Via se11, enter type group CXTAB.

Edited by: Micky Oestreich on May 26, 2009 11:51 AM

Hi experts ,

Can any one send me and help me to explain about dynamic stctures(or tables)

Dynamic strctures about TABLEVIEW and SCREEN.

what are the fields are consist of this stctures and their ussage in screen programming for table control

say like top_line and current_line like and input ,invisible.

CONTROLS: tc_tablecontrol TYPE TABLEVIEW USING SCREEN 1000,

Thanks

4 REPLIES 4
Read only

Sm1tje
Active Contributor
0 Likes
1,007

Screen:

Component Length Type Attribute Description

name 132 c Name Name

group1 3 c Group1 Modification group

group2 3 c Group2 Modification group

group3 3 c Group3 Modification group

group4 3 c Group4 Modification group

required 1 c Required-entry field Mandatory field

input 1 c Input input-enabled field

output 1 c Output display field

intensified 1 c Intensified intensified field

invisible 1 c Invisible invisible element

length 1 x visLength Field length

active 1 c Input/Output/Invisible active field

display_3d 1 c Two-dimensional Box

value_help 1 c Input help Input help key

request 1 c - Input exists

values_in_combo 1 c Dropdown listbox Value help exists

Tableview (structure CXTAB_CONTROL)

Via se11, enter type group CXTAB.

Edited by: Micky Oestreich on May 26, 2009 11:51 AM

Read only

Former Member
0 Likes
1,006

Hi,

For screen got the SE11 transaction and type in the table name as SCREEN and click on DISPLAY, it will show all the fileds present. These are again the attributes of the screen fields whta you create in the Screenlayout editor (or SE51 transaction).

for example,

loop at screen.

if screen-name = 'MARA-MATNR'.

screen-invisible = 1. -


> this will make the filed invisible.

modify screen.

endif.

endloop.

similarly you can make the files, active, inactive, visible invisible, output only, both input and output, you can change the grouping of radio buttonts etc.

When it comes to Table controls....

CONTROLS: tc_tablecontrol TYPE TABLEVIEW USING SCREEN 1000

in degub mode if you check the structure of "tc_tablecontrol", it will have LINES, CURRENT LINE etc.

LINES will have the total number of active lines in your table control

CURRENT LINE will contain the number of the current line that is edited or selected

LINE SELECTED will be 'X' if that line is selected etc.

Regards,

S.Dakshna Nagaratnam.

Read only

0 Likes
1,006

These are the TABLEVIEW dynamic strctre fields details.

TYPE-POOL CXTAB .

TYPES:

BEGIN OF CXTAB_COLUMN,

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 CXTAB_COLUMN,

BEGIN OF CXTAB_CONTROL,

FIXED_COLS TYPE I, "Number of fixed columns

LINES TYPE I, "Number of lines to display

TOP_LINE TYPE I, "Top line during next PBO

CURRENT_LINE TYPE I, "Current line during LOOP/ENDLOOP

LEFT_COL TYPE I, "Fist scrollable column after fixed area

LINE_SEL_MODE TYPE I, "Line-selection : none(0), single(1),

COL_SEL_MODE TYPE I, "Column-selection: multiple(2)

LINE_SELECTOR(1) TYPE C, "Indicator: 'With line-selection col'

V_SCROLL(1) TYPE C, "not used

H_GRID(1) TYPE C, "Indicator: 'Horizontal grid-lines'

V_GRID(1) TYPE C, "Indicator: 'Vertikal grid-lines'

COLS TYPE STANDARD TABLE OF CXTAB_COLUMN

WITH NON-UNIQUE DEFAULT KEY,

INVISIBLE(1) TYPE C,

END OF CXTAB_CONTROL,

BEGIN OF CXTAB_TABSTRIP,

ACTIVETAB LIKE SCREEN-NAME,

%_SCROLLPOSITION LIKE SCREEN-NAME,

INVISIBLE(1) TYPE C,

END OF CXTAB_TABSTRIP.

Read only

0 Likes
1,006

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