Sie sind auf Seite 1von 8

11/13/2014

ABAP | Table Controls

Home
Testing

SAP

http://www.guru99.com/abap-table-controls.html

1/8

11/13/2014

ABAP | Table Controls

Web

Live Projects

Must Learn!

http://www.guru99.com/abap-table-controls.html

2/8

11/13/2014

ABAP | Table Controls

Blog
Quiz

ABAP | Table Controls

Table controls and step loops are objects for scr


that you add to a screen in the Screen Painter.

From a programming standpoint, table controls


are almost exactly the same. Table controls are
step loops that display data with the look and fe
tables in desktop applications.
With table controls, the user can:

Scroll through the table vertically and horizonta


Re-size the width of a column
Scroll within a field (when field contents are wid
Select table rows or columns
Re-order the sequence of columns
Save the current display settings for future use

Table controls also offer special formatting features (some automatic, some optional) that m
to look at and use. Table Control provides automatic table resizing (vertical and horizontal) when the user resizes the window
separator lines between rows and between columns (vertical and horizontal)
column header fields for all columns

One feature of step loops is that their table rows can span more than one line on the screen.
control, on the other hand, must always be contained in a single line (although scrolling is po

In general, many of the features provided by the table control are handled locally by y
http://www.guru99.com/abap-table-controls.html

3/8

11/13/2014

ABAP | Table Controls

SAPgui frontend, so you do not need to program them yourself. The only notable excep
vertical scrolling.
Example (Transaction TZ60)

Syntax

To handle table controls in ABAP programs, you must declare a control in the declaration par
for each table control using the following statement:
1

CONTROLS <ctrl> TYPE TABLEVIEW USING SCREEN <scr>

where <ctrl> is the name of the table control on a screen in the ABAP program. The control a
program to read the attributes of the table control and to influence the control .Here, <scr>
number where the initial values of the table are loaded.
Cursor Position for a table control can be set in following ways:
At PBO you can set the cursor on a specific field of a specific row of a table control.
1

SET CURSOR FIELD <f> LINE <lin> [OFFSET <off>]

Using the optional addition OFFSET, you can enter the offset of the cursor in the field as desc
Setting the Cursor Position.
At PAI you can read the current cursor position.
1

GET CURSOR FIELD <f> LINE <lin> ...

http://www.guru99.com/abap-table-controls.html

4/8

11/13/2014

ABAP | Table Controls

In addition to the information given under Finding Out the Cursor Position, field <lin> contain
which row of the table control the cursor is currently on. You can also use
1

GET CURSOR LINE <lin>.

to determine the row of the table control. SY-SUBRC allows you to check if the cursor is plac
table control.
For getting the corresponding line of the internal table :
1
2
3
4
5

GET CURSOR line <lin>.


ind = <table_control>-top_line + <lin> - 1.
Read table <itab> index ind.

The system variable stepl - contains the current table line index in a loop ... endloop. Loopc
of lines visible in the table

To create a table control


1.Add a table control element to your screen
2.Give a name to the table control. In the ABAP program declare a structure with the same (
type TABLEVIEW USING SCREEN <scrn >)
3.To create fields go to the Dict./Program fields function.

Enter the name of the structure whose fields you want. (If you want it to pick it from dictio
program click the relevant puhbutton).
In the field list choose the fields you want and choose ok.
Click in the table control area

If you want a selection column , check the appropriate check box in the attributes and give it
the field in the ABAP program.
In the PBO you should have the statement
1
2

LOOP at <itab> USING CONTROL <cntrl_name>.

http://www.guru99.com/abap-table-controls.html

5/8

11/13/2014

ABAP | Table Controls

ENDLOOP.

In the PAI you should have.


1
2
3

LOOP at <itab>.
ENDLOOP.

It is within the loops that data transfer happens between the screen and the internal table.W
the internal table use DESCRIBE TABLE <itab> LINES <cntrl_name>-lines, to store the total nu
the control.The FIELD statement can be used to control when the data transfer happens
To change the attributes of individual cells temporarily change the SCREEN table in the PBO.
the attributes of the structure created by the CONTROLS statement
1
2
3
4
5

<cntrl>-fixed_cols etc are the attributes of the control


<cntrl>-cols-index etc are the attributes of the columns.

<cntrl>-cols-screen-invisible etc are the screen attributes of each co

Like

Tweet

Share

< Prev

http://www.guru99.com/abap-table-controls.html

6/8

11/13/2014

ABAP | Table Controls

AROUND THE WEB

Stack

Disqus

VIDEO: A Day In the Life of NBA DLeague's Gilbert Brown

Check Out the 5 Companies T


Transformed Advertising in 201

World News

Cracker Barrel rejects latest attempt to


force a sale
ALSO ON GURU99

Live Selenium Project 4 comments

How sorting is done in SQL using ORD


ASC 3 comments

Accessing Forms using Selenium WebDriver 1 comment

Introduction to Cucumber 2 comments

0 Comments

Guru99

Sort by Best

Start the discussion

About

Contact Us

About us

Contact us

http://www.guru99.com/abap-table-controls.html

Android App

Certificatio

Selenium Ce
7/8

11/13/2014

ABAP | Table Controls

Corporate Training
Jobs

FAQ
Teach Online
Sitemap

ISTQB Certif
MySQL Cert
QTP Certific
Testing Cert

Copyright - Guru99 2014

http://www.guru99.com/abap-table-controls.html

8/8

Das könnte Ihnen auch gefallen