Start of Content Area

Function documentation Changing the Display of Numeric Values  Locate the document in its SAP Library structure

Use

You are able to determine how a numeric value from the internal data table is to be displayed in the ALV output. To do this, you can use the following properties:

·        Number of decimal places

·        Unit of measurement

·        Currency

·        Rounding

With each of these properties, you either move the decimal point the desired number of places (thus changing the value of the number) or you change the number of decimal places after the decimal point (the value of the number then stays the same). You are also able to combine two or more options.

You are able to apply each of the properties in two ways:

·        You assign the desired property with a specific value to the column that contains the values to be displayed. Each of the values in the column is changed and displayed in the same way.

·        You use a separate column that applies the desired property to individual rows of the ALV output. For more information, see Columns with Special Technical Significance, in the section called Control Columns That Are Assigned to a Column.

Features

You are able to make the following settings for numeric columns:

·        Setting properties such as number of decimal places, units of measure, currency and rounding

·        Displaying or hiding sign

·        Hide or display leading zeros

·        Determining Display of Empty Cells

The following is valid for all of these functions:

Display type

ALV Tool

Classic ABAP list

Full screen

In the Container

Simple, two-dimensional table

Yes

Yes

Yes

Hierarchical-sequential list

Yes

 

 

Tree structure

 

Yes

Yes

Determining Decimal Places, Units of Measure, Currency and Rounding

You determine the number of decimal places, along with the unit of measure, currency and rounding for each column individually.

Methods

Function

Class

Method

Determine number of decimal places

CL_SALV_COLUMN

SET_DECIMALS

Get number of decimal places

GET_DECIMALS

Determine unit of measure

SET_CURRENCY

Get unit of measure

GET_CURRENCY

Determine currency

SET_QUANTITY

Get currency

GET_QUANTITY

Determine rounding

SET_ROUND

Get rounding

GET_ROUND

Note

For columns with DDIC reference, the GET_DDIC_DECIMALS of class CL_SALV_COLUMN returns the number of decimal places that is set for the referenced data element.

Displaying or Hiding sign

By default, positive numbers are displayed without sign, and negative numbers are displayed with sign. You are able to determine that the sign (-) not be displayed for negative numbers.

Methods

Function

Class

Method

Displaying or hiding sign

CL_SALV_COLUMN

SET_SIGN

Checks whether sign is being displayed or hidden

HAS_SIGN

Hiding or Displaying Leading Zeros

For columns with data types n or NUMC (numeric text), the places that are in front of the value are filled with zeros (0). You are able to hide or display these zeros in front of a value.

Display type

ALV Tool

Classic ABAP list

Full screen

In the Container

Simple, two-dimensional table

Yes

Yes

Yes

Hierarchical-sequential list

Yes

 

 

Tree structure

 

Yes

Yes

Methods

Function

Class

Method

Hiding or Displaying Leading Zeros

CL_SALV_COLUMN

SET_LEADING_ZERO

Checks leading zeros are being displayed or hidden

HAS_LEADING_ZERO

 

 

End of Content Area