SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing Internal Data → Character String and Byte String Processing → Statements for Character String and Byte String Processing → WRITE - TO →WRITE - Predefined Formats
The predefined output format of the statements WRITE ... TO and WRITE depends on the data type and user-specific settings. It is partly dependent on the length available. In WRITE ... TO, this is the length of the target variable; in WRITE this is the output length. If the length is not sufficient, the variables are truncated as specified in the predefined cutoff behavior.
Orientation
The following table shows the predefined alignment for the predefined ABAP types.
Data Type | Orientation |
Numeric data types | Right-aligned |
Character-like data types | Left-aligned |
Byte-like data types | Left-aligned |
General Format
Numeric Data Types
Notes
Character-Like Data Types
Data objects with character-like data types are formatted in accordance with the code page. For information about character-like date fields and time fields, see below.
Byte-Like Data Types
Byte-like data objects are formatted in hexadecimal format, where one byte is represented by two characters.
Number, Date, and Time Formats
With one exception, numbers, date formats, and time formats are defined by the current formatting setting of the language environment, which can be configured using SET COUNTRY.
Number Output
The predefined number format for the output of numerical fields (which decimal and thousands separators are selected) is defined by the current formatting setting. The formats available correspond to the country-specific number formats. Thousands separators are inserted only if there is enough length available.
Date Output
The predefined date format for the output of character-like date fields of type d and time stamps is defined by the current formatting setting. The formats available correspond to the country-specific date formats. Separators are inserted only if there is enough length available. A character-like date field is formatted regardless of its content.
Time Output
Character-like time fields of type t and times specified in time stamps are by default always displayed in 24-hour format with colons as separators. Separators are inserted only if there is enough length available. To use a 12-hour format defined in the current formatting settings, the addition ENVIRONMENT TIME FORMAT must be used. A character-like time field is formatted regardless of its content.
Time Stamp Output
The output of time stamps for which the addition TIME ZONE is specified is constructed from a date output and a time output in the current format, separated by a blank. The 12-hour time format is not possible and the decimal separator for fractions of seconds is always a comma (,).
Example