p
with the length 8 and no decimal places ( TIMESTAMP from ABAP
Dictionary) or data type p with length 11 and seven decimal
places ( TIMESTAMPL from ABAP Dictionary). The value of the
embedded expression is interpreted as a time stamp.
The format of the time stamp can either be specified statically with
one of the predefined parameters or dynamically as the content of a data
object val , specified in parentheses. The possible values of
val are defined as constants in the class
CL_ABAP_FORMAT .
Parameter Value of val Effect
SPACE CL_ABAP_FORMAT= TS_SPACE The content of the time
stamp is converted by default to a date and time in
UTC reference time and they are both represented in accordance
with ISO 8601: "yyyy-mm-dd hh:mm:ss.zzzzzzz" . The option
TIMEZONE can be used to specify a different time zone.
ISO CL_ABAP_FORMAT= TS_ISO As SPACE , but in
accordance with ISO 8601 the character "T" is placed between the
date and the time and the decimal separator is always a comma ( ,
): "yyyy-mm-ddThh:mm:ss,zzzzzzz" .
USER CL_ABAP_FORMAT= TS_USER As SPACE , but the
date format and the time format are taken from the
user master record .
ENVIRONMENT CL_ABAP_FORMAT= TS_ENVIRONMENT As SPACE
. However, the date format and time format are defined in accordance
with
- CL_ABAP_FORMAT= TS_RAW The content of the time stamp is not
converted and the output is a packed number.
The default setting is SPACE .
ABAP_ADDITION_17 ... TIMEZONE = tz ...
What does it do? This formatting option converts the date and time
information of a time stamp to the
local date and the
local time of the specified
time zone . The information is formatted in
accordance with how the option TIMESTAMP is specified.
The option TIME ZONE can be specified only if the embedded
expression has one of the data types
TIMESTAMPL or TIMESTAMP from
ABAP Dictionary (as with type p with length 11 and 7 decimal
places or p with length 8 and no decimal places) as a
time stamp . Other data types produce a
syntax error or runtime error.
tz expects a character-like data object containing a
time zone from the database table
TTZZ . If the
rule set for the specified time zone is
incomplete, an exception that cannot be handled is raised. If tz
is initial, then the time zone is set implicitly to "UTC" .
If the addition TIME ZONE is specified for source fields with
the types TIMESTAMPL or
TIMESTAMP from ABAP Dictionary,
then the content of the source field is handled like a time stamp. If
the option TIMEZONE is specified without the option TIMESTAMP
, the parameter SPACE is added to the option TIMESTAMP
implicitly. The option TIMEZONE cannot be specified if the value
of CL_ABAP_FORMAT= TS_RAW is specified for TIMESTAMP in
val . The conversion is performed in the same way as with the
statement CONVERT TIME STAMP .
If the value of tz is not in the database table TTZZ , if
the source field does not contain a valid time stamp, or if the
conversion produces a local time outside the value range for local dates
and times, then the content is formatted as a UTC time stamp,
regardless of the value.
Example ABAP Coding See String
Templates, Time Zones
ABAP_ADDITION_18 ... COUNTRY = cty ...
What does it do? The formatting option COUNTRY defines a temporary
formatting setting for the currently
embedded expression. It can be specified as an alternative to all
formatting options for which the parameter ENVIRONMENT can be
specified (that is, instead of NUMBER , DATE , TIME ,
and TIMESTAMP ). The embedded expression is formatted as a number,
date, or time, or time stamp, depending on its data type.
cty expects a data object of the type LAND1 from ABAP
Dictionary. It must either contain a value from the LAND column
of the database table T005X or it must be initial. If not, an
exception of the class CX_SY_STRG_FORMAT is raised.
If cty contains a value from the table T005X , the
country-specific format defined there is
used. If cty is initial, the formatting specified in the
user master record is used.
Latest notes: Unlike using the statement SET
COUNTRY and the parameter ENVIRONMENT , there are no
side-effects when using the formatting option COUNTRY . The
country specified only has an effect on the currently embedded
expression and not on any subsequent statements from the current
internal mode.
In numbers, the COUNTRY formatting option overrides the
predefined setting with
regard to thousand separators.
Example ABAP CodingS See
Character String Templates,
Number Formats
Character String Templates, Date
Formats
Character String Templates, Time
Formats
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved