Show TOC

Defining Column WidthLocate this document in the navigation structure

Use

You are able to change the width of the columns in the ALV output in different ways. Here you differentiate between columns in the content of the ALV output (represented by a COLUMN object) and other types of columns (such as Hierarchy Column of the Tree Structure, Column in Design Object).

Features

You are able to make the following settings for column width:

Set Output Width

You are able to set the width of a column in the content of the ALV output no matter how large the field has been defined for the internal data table.

ALV Tool

Display type

Function available

Simple, Two-Dimensional Table

Classic ABAP List

Yes

Fullscreen

Yes

In the Container

Yes

Hierarchical-sequential list

Classic ABAP List

Yes

Tree structure

Fullscreen

Yes

In the Container

Yes

Function

Class

Method

Set column width

CL_SALV_COLUMN

SET_OUTPUT_LENGTH

Get column width

GET_OUTPUT_LENGTH

Get column width of the referenced data element

GET_DDIC_OUTPUTLEN

Set width of hierarchy column

You are able to choose whether you want to specify the width of the hierarchy column in the tree structure in pixels or in characters.

ALV Tool

Display type

Function available

Simple, Two-Dimensional Table

Classic ABAP List

No

Fullscreen

No

In the Container

No

Hierarchical-sequential list

Classic ABAP List

No

Tree structure

Fullscreen

Yes

In the Container

Yes

Function

Class

Method

Set whether the width of the hierarchy column is specified in characters or in pixels

CL_SALV_ TREE_SETTINGS

SET_HIERARCHY_SIZE_IN_PIXEL

Check whether the width of the hierarchy column is specified in characters or in pixels

IS_HIERARCHY_SIZE_IN_PIXEL

Set width of hierarchy column

SET_HIERARCHY_SIZE

Get width of hierarchy column

GET_HIERARCHY_SIZE

Width of a Column in Table-Type Layout of a Design Object

If you use a table-like layout in a design object, you can control the width of the columns and their contents there: The longer the text is in a cell, the wider the column.

Adapt Width to Space Required by Values

You are able to automatically set the width of columns so that all values are displayed completely by optimizing the column. You can make this setting for each column individually or for all columns simultaneously.

ALV Tool

Display type

Function available

Simple, Two-Dimensional Table

Classic ABAP List

Yes

Fullscreen

Yes

In the Container

Yes

Hierarchical-sequential list

Classic ABAP List

Yes

Tree structure

Fullscreen

Yes

In the Container

Yes

Function

Class

Method

Optimize individual column

CL_SALV_COLUMN

SET_OPTIMIZED

Check whether a column is optimized

IS_OPTIMIZED

Optimize all columns simultaneously

CL_SALV_COLUMNS

SET_OPTIMIZE

Check whether all columns are optimized

IS_OPTIMIZED

Note

In the printout, the columns that are output are exactly as wide as they are on the screen by default. In the full-screen display of a simple, two-dimensional table, you are able to determine that the column widths be optimized in the printout. To do this, use the method SET_COLUMN_OPTIMIZATION in the CL_SALV_PRINT class. With the IS_COLUMN_OPTIMIZATION you check whether the columns are optimized in the printout.