Predefined Types, Data Objects, and Functions

«« Previous
Next »»

◉ Predefined Data Types

The following predefined data types are used in ABAP programs:

1. Predefined ABAP types


All predefined ABAP types from these tables are elementary and are included in the generic type simple. Apart from the types b and s, the predefined ABAP types can also be used to define separate data types and data objects and for typing.

Besides the predefined ABAP types, there is a global predefined data type cursor, which currently has the same meaning as the predefined ABAP type i. This is required for the declaration of a cursor variable for database cursor handling.

Notes

◈ If a start value is not specified when creating a data object with one of the predefined ABAP types, the start value is set to the initial value specified for the relevant type.
◈ The predefined data types string and xstring describe data objects of variable length (dynamic data objects). While the length of data objects in all other elementary data types is determined for its whole lifetime, the length of text and byte strings varies according to their content (the maximum size of a string is determined by the profile parameter ztta/max_memreq_MB, see Maximum size of dynamic data objects).

The following types are predefined in every ABAP program:

◈ Predefined Numeric Types

The data objects of the numeric data types are used to handle number values.

Properties

Type Length  Standard Length Name 
b 1 byte  1-byte integer (internal)
2 byte  2-byte integer (internal)
4 byte  4-byte integer 
int8  8 byte 8-byte integer 
p 1 to 16 bytes  8 byte Packed number 
decfloat16  8 byte  Decimal floating point number with 16 places 
decfloat34  16 byte  Decimal floating point number with 34 places 
f 8 byte  Binary floating point number with 17 places 

Value Ranges and Initial Values

Type Value Range Initial Value
b 0 to 255 0
-32,768 to +32,767
-2,147,483,648 to +2,147,483,647
int8  -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
p The valid length for packed numbers is between 1 and 16 bytes; two places are packed into one byte, where the last byte only contains one place and the sign (the number of places or digits is calculated from 2 * len-1); after the decimal separator, up to 14 decimal places are permitted. Depending on the field length len and the number of decimal places dec, the following applies to the value range: (-10^(2len-1) +1) / (10^(+dec)) to (+10^(2len-1) -1) /(10^(+dec)) in increments of 10^(-dec); any intermediate values are rounded (decimal); invalid content produces undefined behavior. 0
decfloat16  Decimal floating point numbers of this type are represented internally with 16 places in accordance with the IEEE-754-2008 standard; valid values are numbers between 1E385(1E-16 - 1) and -1E-383 for the negative range, 0 and +1E-383 to 1E385(1 - 1E-16) for the positive range. Values lying between the ranges form the subnormal range and are rounded; outside of the subnormal range, each 16-digit decimal number can be represented precisely with a decimal floating point number of this type 0
decfloat34  Decimal floating point numbers of this type are represented internally with 34 places in accordance with the IEEE-754-2008 standard; valid values are numbers between 1E6145(1E-34 - 1) and -1E-6143 for the negative range, 0 and +1E-6143 and 1E6145(1 - 1E-34) for the positive range. Values lying between the ranges form the subnormal range and are rounded; outside of the subnormal range, each 34-digit decimal number can be represented precisely using a decimal floating point number like this. 0
f Binary floating point numbers are represented internally in accordance with the IEEE-754 standard (double precision); in ABAP, 17 places are represented (one integer digit and 16 decimal places). Valid values are numbers between -1.7976931348623157E+308 and -2.2250738585072014E-308 for the negative range and between +2.2250738585072014E-308 and +1.7976931348623157E+308 for the positive range, plus 0. Both validity intervals are extended in the direction of zero using subnormal numbers in accordance with the IEEE-754 standard. 0

Notes

◉ The numeric data types are used for numeric calculations. Here, the data type f for binary floating point numbers is replaced largely by the types decfloat16 and decfloat34 for decimal floating point numbers.
◉ The types b and s are internal types and cannot be specified either statically or dynamically in ABAP statements. Self-defined data types and data objects in ABAP programs have the data types b or s if they have been defined with reference to data elements in ABAP Dictionary that have the external data types INT1 or INT2.
◉ The system class CL_ABAP_MATH contains constants for the minimum and maximum values of most numeric types.
◉ The system class CL_ABAP_ELEMDESCR in RTTS contains constants TYPE_P_MAX_LENGTH and TYPE_P_MAX_DECIMALS for the maximum length and the maximum number of decimal places p.
◉ Since the decimal places in a floating point number of type f are represented internally as dual fractions, there is not an exact equivalent for every number that can be represented in the decimal system. This can produce rounding errors in conversions and intermediate results of calculations. These errors can be avoided by using a two-step rounding procedure.
◉ The type p, for which a length interval is specified in the second column in the first table, is generic, which means that the length is not part of the type description. Also, both the decimal places and the length are undefined. The entry in the Standard Length column specifies the length used in declarations of data objects when using types with generic lengths, if no explicit length is specified in the relevant statement.
◉ The data type p is used to implement fixed point numbers. The number of decimal places in a packed number with the type p is a type attribute defined using the addition DECIMALS and is not saved together with the number. Technically, the number value is determined by dividing the saved sequence of digits in the packed number by 10 to the power of the number of decimal places (10^(+dec)). In the definition of a packed number, the number of decimal places cannot be greater than the number of places calculated from 2 *  len - 1. Otherwise, the decimal separator is outside the sequence of digits and not all decimal places can be given values. For example, if a packed number with length 1 and two decimal places has a value range of -0.09 to +0.09 in increments of 0.01, there is no possible value for which the first decimal place is filled, for example 0.14.
◉ For data objects of data type p, the program attribute Fixed Point Arithmetic must be set so that the decimal separator is respected. Otherwise, in all operations, the content is handled as if there is no decimal separator. The sequence of digits in the variables of type p is interpreted as an integer value. Exceptions are:

     ◉ Representation on dynpros
     ◉ Formatting with WRITE [TO]
     ◉ Assignments to character-like objects with the types c and string

Example

In accordance with the formula in the table, the value range of a packed number with length 2 and two decimal places is (-10^(2x2 -1) +1) / (10^2) to (+10^(2x2 -1) -1) / (10^2) and therefore =-9.99 to +9.99 in increments of 0.01. A value within this range, for example 1.428, is rounded up to 1.43.

DATA: pack   TYPE p LENGTH 2 DECIMALS 2, 
      result TYPE REF TO data. 

FIELD-SYMBOLS <result> TYPE ANY. 

result = cl_abap_exceptional_values=>get_min_value( pack ). 

IF result IS NOT INITIAL. 
  ASSIGN result->* TO <result>. 
  cl_demo_output=>write_data( <result> ). 
ENDIF. 

result = cl_abap_exceptional_values=>get_max_value( pack ). 

IF result IS NOT INITIAL. 
  ASSIGN result->* TO <result>. 
  cl_demo_output=>write_data( <result> ). 
ENDIF. 

cl_demo_output=>display( ).

◈ Predefined Character-Like Types

The data objects of the character-like data types are used to handle character strings.

Properties

Type Length Standard Length Name 
c 1 to 262,143 characters One character Text field
1 to 262,143 characters  One character Numeric text field 
string  Variable  Text string 

Value Ranges and Initial Values

Type Length Standard Length
c Any alphanumeric characters " " for every place
Any alphanumeric characters; only valid values are the digits 0 to 9, however "0" for every place
string  As for type c Empty string with length 0

Notes

◉ The character-like data types are mainly used for string processing.
◉ The data types c and string are general character-like data types; n, on the other hand, has special properties. The data type n corresponds to the special type NUMC in ABAP Dictionary.
◉ Further character-like data types with special properties are the predefined date types and time types that match the corresponding types DATS and TIMS in ABAP Dictionary. All other special character-like data types in ABAP Dictionary are assigned to the general ABAP types listed here.
◉ The content of the data objects of character-like data types is saved in the memory in accordance with the current system code page
◉ When specifying lengths for character-like types, note that the length of a character in bytes depends on the character representation used. The length of a character is two bytes for the character representation UCS-2 used by the ABAP programming language.
◉ The types c and n, for which a length interval is specified in the second column in the first table, are generic, which means that the length is not part of the type description. The entries in the Standard Length column specify the length used in declarations of data objects when using types with generic lengths, if no explicit length is specified in the relevant statement.
◉ The system class CL_ABAP_ELEMDESCR contains constants TYPE_C_MAX_LENGTH and TYPE_N_MAX_LENGTH for the maximum length of the types c and n.
◉ The valid values of the data type n are a subset of its value range. ABAP statements that work with data objects of this type are only guaranteed to function correctly for operands with valid values.
◉ The maximum size of strings must be respected.

◈ Predefined Byte-Like Types

The data objects of the byte-like data types are used to include byte strings.

Attributes

Type Length  Standard Length Name 
x 1 to 524,287 bytes  1 byte Byte field
xstring  Variable Byte string

Value Ranges and Initial Values

Type Length  Standard Length
x Any byte values, hexadecimal 00 to FF Hexadecimal 00
xstring  As for type x Empty string with length 0

Notes

◈ The byte-like data types are used for byte string processing.
◈ The type x, for which a length interval is specified in the second column in the first table, is generic, which means that the length is not part of the type description. The entry in the Standard Length column specifies the length used in declarations of data objects when using types with generic lengths, if no explicit length is specified in the relevant statement.
◈ The system class CL_ABAP_ELEMDESCR contains a constant TYPE_X_MAX_LENGTH for the maximum length of the type x.
◈ The maximum size of strings must be respected.

◈ Predefined date types and time types

The data objects of the date types and time types are used to add calendar dates and times.

Attributes

Type Length  Standard Length Name 
d 8 characters 1 byte Date field
6 characters Time field

Value Ranges and Initial Values

d Any eight alphanumeric characters; only those digits are valid, however, that are valid as dates in accordance with the calendar rules in the format "yyyymmdd": "yyyy" (year): 0001 to 9999, "mm" (month): 01 to 12, "dd" (day): 01 to 31  "00000000" 
t Any six alphanumeric characters; only those digits are valid, however, that are valid as times in accordance in the format 24-hour clock format "hhmmss". "hh" (hours): 00 to 23, "mm" (minutes): 00 to 59, "ss" (seconds): 00 to 59. "000000"
Notes

◈ The date types and time types are used to handle values for calendar dates and times. Information about how they are used and their special handling can be found under Date Fields and Time Fields.
◈ From a technical perspective, the data types d and t are flat character-like types. The content of their data objects is saved in accordance with the current system code page.
◈ As character-like data types, data objects of the data types d and t can be used like text fields of the type c. This applies in particular also to structures with components of the types d and t.
◈ The generic type clike also covers the types d and t.
◈ Data objects of the types d and t display character-like behavior in character-like operand positions and numeric behavior in numeric operand positions.
◈ The data types d and t are the predefined ABAP types that correspond to the special types DATS and TIMS in ABAP Dictionary.
◈ The valid values of the data types d and t are a subset of their value range. ABAP statements that work with data objects of these types are only guaranteed to function correctly for operands with valid values.

2. Generic ABAP types


The following table shows the predefined generic ABAP types. A generic data type is an incomplete type specification that includes multiple complete type specifications. With the exception of object, all generic types can be used after TYPE for the typing of field symbols and formal parameters. When a data object is assigned to generically typed field symbols using the statement ASSIGN, or to a formal parameter in procedure calls, the system checks whether its concrete data type is compatible with it, that is whether it is a subset of the generic type.

The only generic types that can be used after TYPE REF TO are data, for the generic typing of data references, and object for the generic typing of object references.

Type Description
any Any data type
any table Internal table with any table category
c Text field with a generic length 
clike  Character-like (c, n, and string plus the date/time types d, t and character-like flat structures) 
csequence  Text-like (c, string) 
data  Any data type 
decfloat  Decimal floating point number (decfloat16, decfloat34) 
hashed table  Hashed table 
index table  Index table 
n Numeric text with generic length 
numeric  Numeric ((b, s), i, int8, p, decfloat16, decfloat34, f) 
object  Any object type (root class of the inheritance hierarchy)
Packed number with generic length and generic number of decimal places 
simple  Elementary data type including structured types with exclusively character-like flat components 
sorted table  Sorted table 
standard table  Standard table 
table  Standard table 
Byte field with generic length
xsequence Byte-like (x, xstring) 

Besides the predefined generic types shown in the table above, ABAP at present includes exactly one kind of self-defined generic type: A table type defined with TYPES - TABLE OF or defined in ABAP Dictionary is generic if the primary table key is not defined or is incompletely defined and if the secondary table key of the table type is generic.

Notes

◈ When generic types are used for the typing of field symbols and formal parameters, it must be ensured that the correct results are obtained regardless of the actual type being used. For example, if csequence is used, the potential fixed types c and string must display different behavior with respect to trailing blanks or the potential numeric types in calculations for numeric must produce different calculation types. More specifically, when existing typings are generalized, it may be necessary to modify the implementation accordingly.

◈ The generic type any can, like all generic types listed here except data and object, only be specified directly after TYPE and has exactly the same effect there as the generic type data. After TYPE REF TO, only data (for fully generic data reference variables) and object (for fully generic object reference variables) can be specified. Specifying REF TO any would define a fully generic reference variable covering data references and object references. This is not currently possible.

◈ The generic type object can only be specified after REF TO and not directly after TYPE.

◈ The object type object plays a special role, because strictly speaking it is not a genuine generic type but the empty root class of all object classes of ABAP Objects. An object reference variable typed using REF TO object can point to any object because of the general reference variable property stating that reference variables with the static type of a superclass can point to objects in all related subclasses. When compared with a data reference variable typed using the real generic data type data, which can point to any data object, it is perfectly possible to classify object as a generic type.

◉ Predefined Data Objects

ABAP programs have access to a range of predefined data objects:

1.1 ABAP System Fields

System fields are filled by the ABAP runtime environment and can be used in an ABAP program to query system statuses. Except for one field (sy-repid), the system fields are variables, but nevertheless they should be used only for reads, since otherwise important information for the execution of subsequent programs may be lost. System fields in ABAP programs can be overwritten in rare cases only, to control system behavior.

With the exception of sy-repid, the data types of the system fields are defined in the structure SYST in ABAP Dictionary, and are instantiated in ABAP programs as components of the predefined structure sy. The structure sy exists only once in an internal session and is shared by all programs in this internal session.

The structure sy can also be addressed using syst. There is also a predefined data type sy, which can be used instead of the data type SYST of ABAP Dictionary.

The table below shows the system fields which can be used in ABAP programs. All other components of the structure sy are either intended only for internal use by the ABAP runtime environment or are obsolete.

The system field sy-repid is no longer a part of the structures syst or sy. Instead, each program contains the predefined constants sy-repid and syst-repid, which both contain the name of the relevant program. There are also two predefined types with the same names, sy-repid and syst-repid, of type c and length 40.

Notes

◉ Although it is not forbidden, it is recommended that user-defined data objects or types in a program that are named sy or syst are not used, since they can obscure predefined data objects and types.
◉ The content of system fields is defined only as stated in the table above, or as described in individual ABAP statements. In any other contexts, the content of system fields is not reliable. In particular those statements whose effect on system fields is undocumented can influence the content of certain system fields in undefined ways, for example sy-subrc. This applies especially to statements that call ABAP code implicitly or explicitly when executed.
◉ If possible, a system field should be evaluated directly after the statement that set it, to prevent it from being overwritten by other statements. If necessary, the values of system fields should be saved in auxiliary variables.
◉ A system field should only be used as an operand in a reading position if its content is not set by the same statement. Otherwise, the system may behave unexpectedly.
System fields and the associated structure SYST have an entirely program-internal function. No dynpro fields should be created with reference to system fields, since the associated field helps are not intended for end users.
◉ Internal system fields are intended entirely for internal use in the ABAP runtime environment and in the ABAP kernel. Never overwrite them from within an ABAP program and do not even process them in read-only mode.
◉ Most of the obsolete system fields were kept during the transition from R/2 to R/3 and are no longer filled. These system fields can no longer be used.
◉ The static methods of the system class CL_ABAP_SYST also provide important system states. The use of these methods can replace the evaluation of the associated system fields in cases where it is important that a system field has not been incorrectly overwritten in the program. In the case of sy-dbsys, it is recommended that the class CL_DB_SYS is used.

1.1.1 Internal System Fields

Internal system fields are intended solely for internal use within the ABAP runtime environment and in the kernel. They must never be overwritten from within an ABAP program and they cannot even be accessed in read-only mode.

Name Length Type Content
sy-cfwae c Not documented
sy-chwae   Not documented
sy-debug   Not documented 
sy-dsnam   Name of the spool file 
sy-entry   72  Not documented 
sy-ffile   Not documented (flatfile) 
sy-fleng   Length of a data object 
sy-fodec   Decimal places in a data object 
sy-folen   Output length of a data object 
sy-ftype   Data type of a data object 
sy-group   Bundling 
sy-input   Not documented 
sy-lpass   Not documented 
sy-newpa   Not documented 
sy-nrpag   Not documented 
sy-oncom   On Commit Flag. This system field is set to different values depending on the call status of the ABAP program. Among these, only the meaning of the value 'P' is guaranteed . If queried at all, sy-oncom can only be queried for 'P'. The value 'P' means that the program is already executing a subroutine registered using PERFORM ... ON COMMIT and a further subroutine call using PERFORM ... ON COMMIT will produce a runtime error. 
sy-pauth   Not documented
sy-playo   Not documented 
sy-playp   Not documented 
sy-pnwpa   Not documented 
sy-pri40   Not documented 
sy-prini   Not documented 
sy-prlog   Not documented 
sy-repi2   40  Not documented 
sy-rstrt   Not documented 
sy-sfoff   i Not documented 
sy-subcs   Call status of an executable program
sy-subty   Call method of an executable program 
sy-tabid   Not documented 
sy-tlopc Not documented 
sy-tstis   Not documented 
sy-xcode 70  Extended function code. Is filled like sy-ucomm when user actions are performed on lists. Before the length of sy-ucomm was extended from four to 70 characters, sy-xcode was used internally to analyze longer input in the command field of the system toolbar of the list. Use sy-ucomm in application programs. 
sy-xform   30  SYSTEM-EXIT subroutine 
sy-xprog   40  SYSTEM-EXIT program

1.2 The Constant space

The program-global constant space has the data type c, length 1, and contains a blank character.

Note

For the space constant, trailing blanks are ignored at most operand positions, as for all character-like fields with fixed lengths. The space constant must therefore not be used in these positions.

Example

The result of the following concatenation is a string with exactly one blank. The blank characters in the first two space statements are ignored. Blank characters are only respected after SEPARATED BY. The example applies with the same result (except for space) to a text field literal ' ' with exactly one blank character.

DATA text TYPE string.

CONCATENATE space space INTO text SEPARATED BY space.

1.3 The Self Reference me

Within the implementation of every instance method, an implicitly created local reference variable called me is available, which points to the instance in which the method is currently being executed. me is treated like a local constant, that means the value of me cannot be altered in an instance method. The static type of me is the class in which the instance method is implemented.

Note: When an object is created, me also points to the instance of the generated subclass when an instance constructor of a superclass called using super->constructor is being executed. In the instance constructor of the superclass, or in methods that have been called by the instance constructor, specifying me-> in the method call has no effect. Instead, the method implementations of the superclass are always called.

◉ Predefined Functions

ABAP provides a set of predefined functions. A predefined function returns a return value for one or more arguments. Predefined functions can be called by functions in certain operand positions.

Predefined functions can be called functionally at certain operand positions. When a predefined function is called at an operand position, the function is executed before the operand is used and the return value of the predefined function is used as the operand, in accordance with its data type.

A predefined function is covered by a functional method, regardless of how many arguments it has.

1. Predefined Functions - Syntax

In the second case, there is usually a main argument val and additional, possibly also optional, arguments. The following sections show the general syntax for calling predefined functions.

Functions with an Unnamed Argument

Syntax

... func( arg ) ...

The syntax for functions with an unnamed argument is the same as the syntax for calling functional methods with an input parameter. func is the predefined function and the argument arg is an operand whose data type matches the function. The blanks after the opening and before the closing parentheses are relevant.

Functions with Named Arguments

Syntax

... func( val = arg p1 = arg1 p2 = arg2 ... ) ...

Functions with one or more named arguments are bound to keyword parameters in the same way as calling functional methods with multiple input parameters. Operands can be specified for the arguments, the data type of which matches the corresponding parameter. The blanks after the opening and before the closing parentheses are relevant. If one of these functions only has one argument or only the main argument is to be populated, the syntax can be simplified as follows:

... func( arg ) ...

2. Predefined Functions - Overview

The following tables show the predefined functions by purpose. Predefined functions are generally processing functions or description functions.

A processing function performs general processing and returns a return code according to its purpose.
A description function determines a property of an argument and usually returns this property as a numeric value.
Other functions are known as logical functions, which either evaluate a logical expression (Boolean functions) or return a truth value (predicate functions).

Logical Functions

Function Meaning
boolc, boolx, xsdbool  Boolean functions 
contains, contains_any_of, contains_any_not_of  Predicate functions for strings 
matches  Predicate function for strings 
line_exists  Predicate function for internal tables

Numeric Functions

Function Meaning
abs, ceil, floor, frac, sign, trunc General numeric functions
ipow Integer power function
nmax, nmin Numeric extremum functions
acos, asin, atan, cos, sin, tan, cosh, sinh, tanh, exp, log, log10, sqrt Floating point functions
round, rescale Rounding functions

String Functions

Function Meaning 
charlen, dbmaxlen, numofchar, strlen Length functions
char_off  Length function 
cmax, cmin  Character-like extremum value functions 
count, count_any_of, count_any_not_of  Search functions 
distance  Similarity function 
condense  Condense function 
concat_lines_of  Concatenation function 
escape  Escape function 
find, find_end, find_any_of, find_any_not_of  Search functions 
insert   Insert function 
match  Substring function 
repeat  Repeat function 
replace  Replace function 
reverse  Reverse function 
Segment  Segment function 
shift_left, shift_right  Shift functions 
substring, substring_after, substring_from, substring_before, substring_to  Substring functions 
to_upper, to_lower, to_mixed, from_mixed  Case functions 
translate  Translation function 

Byte String Functions

Function Meaning
xstrlen Length function 
bit-set  Bit function 

Table Functions

Function Meaning
lines Row function
line_index Index function

◉ Constructor Operators for Constructor Expressions

Syntax

... NEW| VALUE| CONV| CORRESPONDING| CAST| REF| EXACT| REDUCE| FILTER| COND|SWITCH
     type( ... ) ...

Effect

A constructor expression consists of the following:

◉ A predefined constructor operator
◉ A data type or object type type that matches the operator and that can be derived implicitly from the operand position using #
◉ Type-specific parameters specified in parentheses

Each constructor expression creates a result whose data type is determined using the specified type. The parameters specified in parentheses are used to pass input values. The following constructor operators exist:

◉ The instance operator NEW is used to create objects in operand positions. The result is a reference variable of the static type type that points to the new object. The input values determine the content of the new object.
◉ The value operator VALUE is used to fill complex data objects with values in operand positions, create initial values of any data type, or control the results of table expressions. The result is a data object of the specified type type. The input values determine the content of the result.
◉ The conversion operator CONV is used for conversions between data types in operand positions. The result is a data object of the specified type type produced by the conversion from an input value.
◉ The casting operator CAST is used for down casts of reference variables in operand positions. The result is a reference variable of the static type type produced by the assignment from an input value.
◉ The reference operator REF is used to construct a data reference to a data object in operand positions or to control the results of table expressions. The result is a data reference variable.
◉ The component operator CORRESPONDING is used to construct a structure or an internal table in an operand position. The result is a structure or internal table whose components are filled with values from identically named components or from argument components specified in a parameter using a mapping rule.
◉ The lossless operator EXACT is used to create a value in an operand position without losing data. The result is a data object of the specified type, derived from a lossless assignment or a lossless calculation.
◉ The reduction operator REDUCE constructs a value from condition iterations or from table iterations.
◉ The filter operator FILTER constructs an internal table by filtering the rows of an internal table.
◉ The conditional operators COND and SWITCH are used to create values or raise class-based exceptions in operand positions in accordance with conditions. The result is determined by logical expressions or by a case distinction.

A constructor expression can be specified in general expression positions and functional positions with an appropriate operand type. The result is used here as an operand. In a calculation expression or relational expression, the specified type type is incorporated into the calculation type or comparison type. An expression with the operator VALUE that is not used to create an initial value cannot be specified directly in an arithmetic expression. This is because it never matches the operand type here. Expressions with the operators NEW and CAST can be positioned directly before the object component selector -> and can occur in chainings.

Data types and classes that are visible and usable in the current operand position can be specified for type. This includes the predefined ABAP types, types defined using TYPES, types from ABAP Dictionary, and both local and global classes.

If the data type required in an operand position is unique and fully recognizable, the # character can be used instead of an explicitly specified type type and the operand type is used. If the operand type is not unique and cannot be identified in full, a type inference is performed to determine a data type. This is described in each constructor expression.

LET expressions can be used to define local help fields in all suitable constructor expressions.

Notes
  • Constructor operators can be classified as follows:
    • Constructor operators like NEW and VALUE construct new values whose parts can be passed (except when the initial value is created), whereas constructor operators like CONV, CAST, REF, and EXACT convert a single passed value.
    • Constructor operators like NEW, CAST, and REF always return reference variables, whereas constructor operators like VALUE, CONV, and EXACT return all types of data objects.
  • Unlike method chainings or table expressions, constructor expressions cannot be placed on the left side of a structure component selector, since constructing a structure just to access a single component is pointless.
  • If a data type from ABAP Dictionary is used for the type, the result of a constructor is given its semantic attributes.

«« Previous
Next »»

No comments:

Post a Comment