SAP WRITE STYLE ABEXA



Get Example source ABAP code based on a different SAP table
  



Decimal Floating Point Numbers, Formatting with STYLE
This example demonstrates the formatting of decimal floating point numbers.

ABAP_SOURCE_CODE
DEMO CL_DEMO_STYLE

ABAP_DESCRIPTION
The class depicts the effects of all possible output formats for a decimal floating point number with the output formats from the class CL_ABAP_FORMAT. The possible output formats are read using RTTI and are sorted according to their value. Formatting takes place once with the addition STYLE of the statement WRITE TO and twice with the parameter STYLE in embedded expressions of string templates.
For the first string template, the format RAW is used implicitly for the formatting option NUMBER, which is why a period (. ) and not a thousands separator is used as the decimal separator. Explicitly specifying the format USER creates the same formatting as WRITE TO.