SAP ABAP Table Control with Examples

Table controls and step loops are objects for screen table display that you add to a screen in the Screen Painter.

From a programming standpoint, table controls and step loops are almost exactly the same. Table controls are simply improved step loops that display data with the look and feel associated with tables in desktop applications.

With table controls, the user can:

Table controls also offer special formatting features (some automatic, some optional) that make tables easier to look at and use. Table Control provides -

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

In general, many of the features provided by the table control are handled locally by your system's SAPgui frontend, so you do not need to program them yourself. The only notable exception to this is vertical scrolling.

Example (Transaction TZ60)

LOOP at <itab> USING CONTROL <cntrl_name>.

ENDLOOP.

In the PAI you should have.

LOOP at <itab>.

ENDLOOP.

It is within the loops that data transfer happens between the screen and the internal table.When you populate the internal table use DESCRIBE TABLE <itab> LINES <cntrl_name>-lines, to store the total number of lines in 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. You can change the attributes of the structure created by the CONTROLS statement

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

 

 

YOU MIGHT LIKE: