Ansicht
Dokumentation

ABAPASSIGN_DECIMALS - ASSIGN DECIMALS

ABAPASSIGN_DECIMALS - ASSIGN DECIMALS

ABAP Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

ASSIGN

Addition 3

... DECIMALS dec
See Obsolete casting in ASSIGN not allowed.

Effect

You should only use this addition with type P. The field symbol has dec decimal places.

Example

Display output in TDM

DATA SALES_DEC2(10) TYPE P DECIMALS 2 VALUE 1234567.
FIELD-SYMBOLS <SALES_DEC5> TYPE ANY.

ASSIGN SALES_DEC2 TO <SALES_DEC5> DECIMALS 5.
WRITE: / SALES_DEC2,
       / <SALES_DEC5>.

Output:
        1.234.567,00
         1.234,56700


Note

This statement causes a runtime error if the field symbol does not have type P or the number of decimal places is not between 0 and 14.






General Material Data   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 1228 Date: 20240614 Time: 054949     sap01-206 ( 18 ms )