ABAP Resultset without 2 decimals expected.

gram77
gram77 used Ask the Experts™
on
This is a simple program that aggregates columns providing resultset with 2 decimal places.
However, the result doesn't come with 2 decimal places, why?

Program:
DATA : average TYPE P DECIMALS 2,
      sum TYPE P DECIMALS 2.

SELECT AVG( menge ) SUM( menge )
  INTO (average, sum)
  FROM mari.

WRITE : / 'Average : ', average,
        /(30) ' Sum : ', sum


Result:
Average: 154.631,67
Sum: 1.478.278.810,02
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
SAP Technical Consultant
Commented:
Dear gram77

The SAP login id you are using has its 'Decimal Notation' set to the European standard (1.234.567,89).

In European standard comma (,) is used for Decimal point and stop (.) for thousand separator.

You can run tcode: SU3 and change the Decimal notation from the "Defaults" tab.

SU3-Default.png


thanks and regards
onn

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial