SAP COMPUTE STRING FORMAT OPTIONS ABAP Statements

Get Example source ABAP code based on a different SAP table
  



Embedded Expressions - format_options
• WIDTH ABAP_STRING_TEMPL
• ALIGN ABAP_STRING_TEMPL
• LEFT ABAP_STRING_TEMPL
• RIGHT ABAP_STRING_TEMPL
• CENTER ABAP_STRING_TEMPL
• PAD ABAP_STRING_TEMPL
• CASE ABAP_STRING_TEMPL
• RAW ABAP_STRING_TEMPL
• UPPER ABAP_STRING_TEMPL
• LOWER ABAP_STRING_TEMPL
• SIGN ABAP_STRING_TEMPL
• LEFTPLUS ABAP_STRING_TEMPL
• LEFTSPACE ABAP_STRING_TEMPL
• RIGHTPLUS ABAP_STRING_TEMPL
• RIGHTSPACE ABAP_STRING_TEMPL
• EXPONENT ABAP_STRING_TEMPL
• DECIMALS ABAP_STRING_TEMPL
• XSD ABAP_STRING_TEMPL
• ZERO ABAP_STRING_TEMPL
• YES ABAP_STRING_TEMPL
• NO ABAP_STRING_TEMPL
• NUMBER ABAP_STRING_TEMPL
• USER ABAP_STRING_TEMPL
• ENVIRONMENT ABAP_STRING_TEMPL
• COUNTRY ABAP_STRING_TEMPL
• STYLE ABAP_STRING_TEMPL
• CURRENCY ABAP_STRING_TEMPL
• ALPHA ABAP_STRING_TEMPL
• DATE ABAP_STRING_TEMPL
• ISO ABAP_STRING_TEMPL
• TIME ABAP_STRING_TEMPL
• TIMESTAMP ABAP_STRING_TEMPL
• SPACE ABAP_STRING_TEMPL
• TIMEZONE ABAP_STRING_TEMPL


ABAP Syntax ... [WIDTH = len]

[ALIGN = LEFT|RIGHT|CENTER|(val)]
[PAD = c]
[CASE = RAW|UPPER|LOWER|(val)]
[SIGN = LEFT|LEFTPLUS|LEFTSPACE|RIGHT|RIGHTPLUS|RIGHTSPACE|(val)]
[EXPONENT = exp]
[DECIMALS = dec]
[ZERO = YES|NO|(val)]
[XSD = YES|NO|(val)]
[STYLE = SIMPLE|SIGN_AS_POSTFIX|SCALE_PRESERVING
|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO
|SCALE_PRESERVING_SCIENTIFIC|ENGINEERING
|(val)]
[CURRENCY = cur]
[NUMBER = RAW|USER|ENVIRONMENT|(val)]
[ALPHA = IN|OUT|RAW|(val)]
[DATE = RAW|ISO|USER|ENVIRONMENT|(val)]
[TIME = RAW|ISO|USER|ENVIRONMENT|(val)]
[TIMESTAMP = SPACE|ISO|USER|ENVIRONMENT|(val)]
[TIMEZONE = tz]
[COUNTRY = cty] ... .

ABAP Addition
1 ... WIDTH = len ...
2 ... ALIGN = LEFT|RIGHT|CENTER|(val) ...
3 ... PAD = c ...
4 ... CASE = RAW|UPPER|LOWER|(val) ...
5 ... SIGN = LEFT|LEFTPLUS|LEFTSPACE|RIGHT|RIGHTPLUS|RIGHTSPACE|(val) ...
6 ... EXPONENT = exp ...
7 ... DECIMALS = dec ...
8 ... ZERO = YES|NO|(val) ...
9 ... XSD = YES|NO|(val) ...
10 ... STYLE = ...|(val) ...
11 ... CURRENCY = cur ...
12 ... NUMBER = RAW|USER|ENVIRONMENT|(val) ...
13 ... ALPHA = IN|OUT|RAW|(val) ...
14 ... DATE = RAW|ISO|USER|ENVIRONMENT|(val) ...
15 ... TIME = RAW|ISO|USER|ENVIRONMENT|(val) ...
16 ... TIMESTAMP = SPACE|ISO|USER|ENVIRONMENT|(val) ...
17 ... TIMEZONE = tz ...
18 ... COUNTRY = cty ...

What does it do? These formatting options override the predefined formats of embedded expressions in string templates. The formatting options are specified as optional keyword parameters to which an actual parameter is assigned.

The possible formatting options depend on the data type of the embedded expression. The formatting options NUMBER, DATE, TIME, TIMESTAMP, and COUNTRY are mutually exclusive.

If a formal parameter or a field symbol with a generic data type is specified as an embedded expression, only those formatting options can be specified that are permitted for all possible specific data types.

ABAP Addition

What does it do? This formatting option defines the length of the string displayed by the embedded expression as the value of len, where len is a numerical expression position.

The option WIDTH can be specified for all data types of the embedded expression. If the value of len is less than the minimum required length, it is ignored. This means that the predefined length cannot be reduced, only increased. By default, a string is extended on the right and padded with blanks. This default setting can be overridden using the formatting options ALIGN and PAD.



Example ABAP Coding
See Character
String Templates, Length

ABAP Addition

What does it do? This formatting option defines the alignment of the string represented by the embedded expression. It only takes effect if WIDTH is used to define a length that is greater than the minimum required length.

The alignment 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. ParameterValue of valEffect LEFTCL_ABAP_FORMAT=>A_LEFTLeft-aligned RIGHTCL_ABAP_FORMAT=>A_RIGHTRight-aligned CENTERCL_ABAP_FORMAT=>A_CENTERCentered

The default setting is LEFT. Depending on the alignment, excess characters in the result are padded with blanks (default) on the right, left, or alternately left and right. This default setting can be overridden using the formatting option PAD.



Example ABAP Coding
See Character
String Templates, Alignments, and Padding

ABAP Addition

What does it do? This formatting option defines the character used to pad any excess places in the result. It only takes effect if WIDTH is used to define a length that is greater than the minimum required length.

A data object of data type c or string can be defined for c, the first character of which is used as padding. If the PAD option is not specified or if c is specified as an empty string, blanks are used as padding.



Example ABAP Coding
See Character
String Templates, Alignments, and Padding

ABAP Addition

What does it do? This formatting option defines the case of the string represented by the embedded expression. It can be specified for all data types of the embedded expression.

The case (upper/lower) 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. ParameterValue of valEffect RAWCL_ABAP_FORMAT=>C_RAWUnchanged UPPERCL_ABAP_FORMAT=>C_UPPERUppercase LOWERCL_ABAP_FORMAT=>C_LOWERLowercase

The default setting is RAW.

Latest notes:The formatting option CASE affects the letters in a string. It has no effect on padding characters specified using PAD . In numeric data types, the 'e' or 'E' of an exponent is affected; in byte-like data types, the letters in a hexadecimal representation are affected.



Example ABAP Coding
See String
Templates, Upper/Lower Case

ABAP Addition LEFT|LEFTPLUS|LEFTSPACE|RIGHT|RIGHTPLUS|RIGHTSPACE|(val) ...

What does it do? This formatting option defines the format of the +/- sign when the string represented by the embedded expression contains a numeric value. It can be specified only if the embedded expression has a numeric data type.

The format of the +/- sign 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. ParameterValue of valEffect LEFTCL_ABAP_FORMAT=>S_LEFT'-' left without space, no '+' LEFTPLUSCL_ABAP_FORMAT=>S_LEFTPLUS'-' and ' +' left without space LEFTSPACECL_ABAP_FORMAT=>S_LEFTSPACE'-' left without space, blank left for '+' RIGHTCL_ABAP_FORMAT=>S_RIGHT'-' right without space, no '+' RIGHTPLUSCL_ABAP_FORMAT=>S_RIGHTPLUS'-' and ' +' right without space RIGHTSPACECL_ABAP_FORMAT=>S_RIGHTSPACE'-' left without space, blank right for '+'

The default setting is LEFT.



Example ABAP Coding
See String
Templates, Sign

ABAP Addition

What does it do? This formatting option defines the exponent as the value of exp when formatting floating point numbers, where exp is a numerical expression position . The option EXPONENT can be specified only if the embedded expression has a numeric data type. It cannot be specified in combination with the option TIMEZONE.

The option EXPONENT only affects the data type f or if the option STYLE is specified with the value scientific. The string is then formatted in exactly the same way as with the formatting option EXPONENT of the statement WRITE TO, with the following exception:

If exp is specified as the value of the constant CL_ABAP_FORMAT=>EXP_PRESERVE, the exponent is used that matches the internal representation of the floating point value.

ABAP Addition

What does it do? This formatting option defines the number of decimal places as the value of dec, where dec is a numerical expression position . The option DECIMALS can be specified only if the embedded expression has a numeric data type. It cannot be specified in combination with the option TIMEZONE.

The string is then formatted in exactly the same way as with the formatting option DECIMALS of the statement WRITE TO.



Latest notes:The DECIMALS formatting option does not override the
predefined format specifying that thousands separators are not inserted.

ABAP Addition

What does it do? This formatting option defines the format of the numeric value zero. The option ZERO can be specified only if the embedded expression has a numeric data type. It cannot be specified in combination with the option TIMEZONE.

The format of the value zero 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. ParameterValue of valEffect YESCL_ABAP_FORMAT=>Z_YESThe value zero is represented as a numeric value in accordance with the current formatting. NOCL_ABAP_FORMAT=>Z_NOThe value zero is represented as an empty string.

The default setting is YES.

ABAP Addition

What does it do? This formatting option formats the value of the embedded expression in the axXML format that is associated with its data type. The option XSD can be specified for all elementary data types. It cannot be specified together with other formatting options; with the exception of WIDTH, ALIGN , PAD, CASE, and ZERO.

The option XSD affects all data types listed under Mapping of Elementary ABAP Types, as specified there.

The asXML format can either be enabled statically using 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. ParameterValue of valEffect YESCL_ABAP_FORMAT=>X_YESThe data type of the embedded expression determines how it is formatted in accordance with the asXML format specified under Mapping of Elementary ABAP Types. If the data type references one of the domains specified under Mapping of Further XML Schema Data Types (with the exception of XSDQNAME), then the format listed there is used. XML fragments cannot be mapped using the domain XSDANY. NOCL_ABAP_FORMAT=>X_NOUnchanged

If the data type of the embedded expression has the type x or xstring, then a formatting option CASE specified at the same time is ignored (unless it refers to the domain XSDUUID_RAW ).



Latest notes:The formatting of an embedded expression generally produces
the same result as applying the predefined identity transformation ID. Unlike a CALL TRANSFORMATION call, exceptions that can be raised by mappings, but not wrapped, should be handled directly



Example ABAP Coding
See String Templates,
asXML Format.
• SIMPLE ABAP_STRING_TEMPL
• SIGN_AS_POSTFIX ABAP_STRING_TEMPL
• SCALE_PRESERVING ABAP_STRING_TEMPL
• SCIENTIFIC ABAP_STRING_TEMPL
• SCIENTIFIC_WITH_LEADING_ZERO ABAP_STRING_TEMPL
• SCALE_PRESERVING_SCIENTIFIC ABAP_STRING_TEMPL
• ENGINEERING ABAP_STRING_TEMPL

ABAP Addition

What does it do? This formatting option defines the style of decimal floating point numbers. The option STYLE can be specified only if the embedded expression has a numeric data type. It cannot be specified in combination with the options CURRENCY, SIGN, or TIMEZONE.

The style of a decimal floating point number can either be specified statically with a predefined parameter 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. The following table shows the predefined parameters and the constants of the class CL_ABAP_FORMAT: ParameterValue of val SIMPLECL_ABAP_FORMAT=>O_SIMPLE SIGN_AS_POSTFIXCL_ABAP_FORMAT=>O_SIGN_AS_POSTFIX SCALE_PRESERVINGCL_ABAP_FORMAT=>O_SCALE_PRESERVING SCIENTIFICCL_ABAP_FORMAT=>O_SCIENTIFIC SCIENTIFIC_WITH_LEADING_ZERO CL_ABAP_FORMAT=>O_SCIENTIFIC_WITH_LEADING_ZERO SCALE_PRESERVING_SCIENTIFIC CL_ABAP_FORMAT=>O_SCALE_PRESERVING_SCIENTIFIC ENGINEERINGCL_ABAP_FORMAT=>O_ENGINEERING

The default setting is SIMPLE. The string is then formatted in exactly the same way as with the formatting option STYLE of the statement WRITE TO. This means that the numeric value is converted to the data type decfloat34 and is handled as described here. Unlike WRITE TO, the following applies: SIMPLE uses the predefined format of embedded expressions. The general rules for embedded expressions apply to thousands separators and decimal separators for embedded expressions.

As in WRITE TO, the following rules apply when combining these options with other formatting options: The option EXPONENT can only be specified in combination with the output style SCIENTIFIC. The option DECIMALS cannot be specified for output styles that include scaling.



Example ABAP Coding
See Decimal Floating Point
Number, Formatting with STYLE

ABAP Addition

What does it do? This formatting option defines the number of decimal places when formatting numeric values, dependent on a currency when specified incur using a currency code . The option CURRENCY can be specified only if the embedded expression has one of the numeric data types i, p, or f. It cannot be specified for the numeric data types decfloat16 and decfloat34 and not in combination with the options STYLE or TIMEZONE. The option SIGN can be used to control the formatting of the sign.

The string is formatted in exactly the same way as with the formatting option CURRENCY of the statement WRITE TO with the exception of data type p. In the case of data type p, the formatting depends on how the value is specified: When the value is specified as a data object or a functional method, CURRENCY works as in WRITE TO, meaning that the actual decimal places are ignored and the decimal separator is inserted according to the currency associated with the specified currency ID . When specifying a value of an arithmetic expression or a general numeric function, CURRENCY works as in DECIMALS.

cur in the numeric data types i, p, and f expects a currency ID from the column WAERS of the database table TCURC. Two decimal places are used for every currency ID specified, unless it is contained in the CURRKEY column of the database table TCURX. In this case, the number of decimal places is determined from the CURRDEC column of the corresponding row in table TCURX.



Latest notes:The CURRENCY formatting option does not override the
predefined format specifying that thousands separators are not inserted.

ABAP Addition

What does it do? This formatting option defines the format of the decimal representation (decimal and thousand separators). The option NUMBER can only be specified if the embedded expression has a numeric data type. As well as the exclusions mentioned above, it cannot be used in combination with the option TIMEZONE .

The format of the decimal representation 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. ParameterValue of valEffect RAWCL_ABAP_FORMAT=>N_RAWThe decimal separator is the period (.) and no thousand separators are inserted. USERCL_ABAP_FORMAT=>N_USERThe decimal and thousand separators are taken from the user master record. ENVIRONMENTCL_ABAP_FORMAT=>N_ENVIRONMENTThe decimal and thousand separators are determined
ABAP Code Snippet according to the current formatting setting of the language environment that can be set using SET COUNTRY.
ABAP Code Snippet

The default setting is RAW.
ABAP Code Snippet



Latest notes:If the formatting setting of the
language environment has not been set to a country-specific format by means of SET COUNTRY, the use of environment has the same effect as the use of USER.



Example ABAP Coding
See character string
templates, formatting settings
ABAP Code Snippet

ABAP Addition

What does it do? This formatting option adds leading zeros to numeric sequences or removes them. The option ALPHA can be specified only if the embedded expression has the data type string, c, or n. It cannot be specified together with other formatting options; apart from WIDTH and CASE.

The format of the numeric sequence 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. ParameterValue of valEffect INCL_ABAP_FORMAT=>L_INIf the character string of the embedded expression only contains an uninterrupted strings of digits (apart from opening and closing blanks), the numeric sequence is right-aligned in a character string of specific length (see below), which is padded the left with the digit '0', if necessary. Otherwise, the characters of the character string of the embedded expression are left-aligned in the character string and padded with blanks on the right, if necessary. If the length is not sufficient, the string is cut off on the right in both cases. OUTCL_ABAP_FORMAT=>L_OUTIf the character string of the embedded expression only contains an uninterrupted strings of digits (apart from opening and closing blanks), leading zeros are removed from the numeric sequence and the remaining digits are left-aligned in a character string of specific length (see below), which is padded on the right with blanks, if necessary Otherwise, all characters of the character string of the embedded expression are left-aligned in the character string and padded with blanks on the right, if necessary. If the length is not sufficient, the string is cut off on the right in both cases. RAWCL_ABAP_FORMAT=>L_RAWNo formatting

The length of the resulting character string is determined as follows: If the formatting option WIDTH is not specified and the embedded expression, as the only content of a character string template, is assigned to a fixed-length target field of type c, n, d, or t, the length of this field determines the available length. Otherwise, the length of the original field, including trailing blanks, is used. If the formatting option WIDTH is specified, the specified length is only used if it is greater than the length of the uninterrupted numeric sequence without leading zeros, or the character string without trailing blanks. Otherwise, the length of the uninterrupted numeric sequence without leading zeros, or the character string without trailing blanks is used.

Latest notes:The formatting option ALPHA has the same function as the conversion routine CONVERSION_EXIT_ALPHA_INPUT or CONVERSION_EXIT_ALPHA_OUTPUT. The parameter IN can be used to convert numeric sequences without leading zeros to the format of numeric text with leading zeros. The parameter OUT can be used to convert numeric text with leading zeros to numeric sequences without leading zeros.



Example ABAP Coding
See String
Templates, Numeric Sequences

ABAP Addition

What does it do? This formatting option defines the format of a date. The option DATE can be specified only if the embedded expression has the data type d.

The format of the date 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. ParameterValue of valEffect RAWCL_ABAP_FORMAT=>D_RAWThe content of the date field is used without being formatted. ISOCL_ABAP_FORMAT=>D_ISOThe date if formatted in accordance with ISO 8601, using hyphens (-) as separators: 'yyyy-mm-dd'. USERCL_ABAP_FORMAT=>D_USERThe date is formatted in accordance with the information in the user master data. ENVIRONMENTCL_ABAP_FORMAT=>D_ENVIRONMENTThe formatting of the date is determined
ABAP Code Snippet according to the current formatting setting of the language environment that can be set using SET COUNTRY.
ABAP Code Snippet

The default setting is RAW.
ABAP Code Snippet



Latest notes:If the formatting setting of the
language environment has not been set to a country-specific format by means of SET COUNTRY, the use of environment has the same effect as the use of USER.



Example ABAP Coding
See character string
templates, formatting settings
ABAP Code Snippet

ABAP Addition

What does it do? This formatting option defines the format of a time. The option TIME can be specified only if the embedded expression has the data type t.

The format of the time 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. ParameterValue of valEffect RAWCL_ABAP_FORMAT=>T_RAWThe content of the time field is used without being formatted. ISOCL_ABAP_FORMAT=>T_ISOThe time is formatted in accordance with ISO 8601, in 24-hour format using colons (: ) as separators: 'hh:mm:ss'. USERCL_ABAP_FORMAT=>T_USERThe time is formatted in accordance with the information in the user master data. ENVIRONMENTCL_ABAP_FORMAT=>T_ENVIRONMENTThe formatting of the time is determined
ABAP Code Snippet according to the current formatting setting of the language environment that can be set using SET COUNTRY.
ABAP Code Snippet

The default setting is RAW.

Latest notes:A 24-hour format and four 12-month formats can be configured in the user master data or using the statement SET COUNTRY. To use 12-hour format, USER or ENVIRONMENT must be specified or the formatting option COUNTRY used.
ABAP Code Snippet



Latest notes:If the formatting setting of the
language environment has not been set to a country-specific format by means of SET COUNTRY, the use of environment has the same effect as the use of USER.



Example ABAP Coding
See character string
templates, formatting settings
ABAP Code Snippet

ABAP Addition ...

What does it do? This formatting option defines the format of a time stamp. The option TIMESTAMP can be specified only if the embedded expression has the data type 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. ParameterValue of valEffect SPACECL_ABAP_FORMAT=>TS_SPACEThe 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. ISOCL_ABAP_FORMAT=>TS_ISOAs 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'. USERCL_ABAP_FORMAT=>TS_USERAs SPACE, but the date format and the time format are taken from the user master record. ENVIRONMENTCL_ABAP_FORMAT=>TS_ENVIRONMENTAs SPACE . However, the date format and time format are defined in accordance with
ABAP Code Snippet according to the current formatting setting of the language environment that can be set using SET COUNTRY.
ABAP Code Snippet -CL_ABAP_FORMAT=>TS_RAWThe content of the time stamp is not converted and the output is a packed number.

The default setting is SPACE.
ABAP Code Snippet



Latest notes:If the formatting setting of the
language environment has not been set to a country-specific format by means of SET COUNTRY, the use of environment has the same effect as the use of USER.



Example ABAP Coding
See character string
templates, formatting settings
ABAP Code Snippet

ABAP Addition

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

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.

ABAP_EXAMPLES See Character String Templates, Number Formats Character String Templates, Date Formats Character String Templates, Time Formats

Return to menu