Please enable JavaScript.
Coggle requires JavaScript to display documents.
4.4 Introduction to the TYPE Concept (4.4.4 Data Objects (Constants…
4.4 Introduction to the TYPE Concept
4.4.1 Data Types
Elementary Data Types
specify the types of individual fields in an ABAP program
Predefined Elementary Data Types
numeric types
4-byte integer
i
8-byte integer
int8
binary floating-point number
f
packed number
p
decimal floating point number with 16 decimal places
decfloat16
decimal floating point number with 34 decimal places
decfloat34
nonnumeric types
text field
c
numeric character string
n
date
d
time
t
hedadecimal
x
Predifined Elementary ABAP Types with Variable Length
The field length for data types f, i, int8, decfloat16, decfloat34, d, t is fixed.
there can be situations in which you need a field with dynamic length because you won't know the length of the data until runtime
string
This is a character type with a variable length.
It can contain any number of alphanumeric characters.
xstring
This is a hexdadecimal type with a variable length.
The data x interprets individual bytes in memory.
2 more items...
Type Conversions
If you move data between dissimilar data objects, then the system performs type conversion automatically by converting the data in the source field to the target field using the conversion rules.
Conversion Rules
The conversion rule for a TYPE c source field and a TYPE i target field is that they must contain a number in commercial or mathematical notation.
User-defined Elementary Types
be declared locally in the program using the TYPE keyword or define them globally in the system in ABAP Data Dictionary
Complex Data Types
are made up of a combination of other data types and must be created using existing data types
work with interrelated data types under a common name
Reference Types
describe reference variables (data references and object references)
4.4.2 Data Elements
The global user-defined elementary types are called data elements and are created in ABAP Dictionary
If you change the definition of the data element, the changes will be automatically reflected for all the objects referring to that data element.
4.4.3 Domains
describes the technical attributes of a field
The primary function of a domain is to define a value range that describes the valid data values for the fields that refer to this domain.
If you plan to create multiple data elements that are technically the same, you can attach a domain to derive the technical attributes of a data element.
change the technical attributes once for the domain, and the change will be reflected automatically for all the data elements
top-down approach
create the domain separately first and attach it to a data element
bottom-up approach
create the domain while creating the data element
4.4.4 Data Objects
are declared in the ABAP program and are local to the program
Literals
not reusable data objects and contents can'be changed, unnamed data objects
numeric literals
not support decimal separators or notation with a mantissa and exponent
character literals
alphanumeric characters in the source code of the program enclosed in single quotation marks (') or back quotes (`)
in single quotes
have the predefined typ c
text field literals
with back quotes
have the predefined type string
string literals
Variables
contents can be changed via ABAP statements
DATA
defines a variable
PARAMETERS
defines a variable
generates a screen field (selection screen)
Constants
content cannot be changed
can be reused and maintained centrally
CONSTANT
mandatory to use the addition VALUE to assign an initial value
Text Symbols
not declared in the program itself
defined as a part of the text elements of the program
behaves like a constant and has the data type c with the length defined in the text element
accessed using the syntax text-nnn, where nnn is the text symbol number