Professional Documents
Culture Documents
DATA TYPES
Types are descriptions that do not occupy memory.
DATA OBJECTS
Objects are instances of types, and do occupy their own
memory space.
Elementary types
Complex types
Reference types
Fixed Length
Variable Length
Character Type
– Character C
– Numeric N
– Date(8) D
– Time(6) T
– Hexadecimal X
Integer I
Range -2**31 to 2**31-1 only whole numbers.
Float F
Packed P
P allows digits after the decimal point up to 14 digit.
String
A string is a sequence of characters with variable length.
XString
A byte string is a hexadecimal type with variable length.
STRUCTURE
A structure is a sequence of any elementary types, reference
types, or complex data types.
INTERNAL TABLE
Internal tables consists of a series of lines that all have the
same data type.
Eg:
REPORT demo_types_statement.
4 / 3 = 1.33
14-Sep-09 Kaavian Systems 12
Data Objects
Data objects contain the data with which ABAP programs work at
runtime.
– Literals
Types of Literals:
− Number literals
− Character Literals
Their technical attributes - field length, number of decimal places, and data type -
are always fixed.
A text symbol is a named data object that is generated when you start the
program from the texts in the text pool of the ABAP program. It always
has the data type C.
Text symbols, along with the program title, list headings, and selection
texts, belong to the text elements of a program.
In the program, you can address text symbols using the following form:
TEXT-<idt>
Constants are named data objects that you create statically using a
declarative statement. They allow you to store data under a
particular name within the memory area of a program.
Example:
PROGRAM demo_elementary_data_objects.
Syntax
REPORT - list_options
Comments are texts that you can write between the statements of
your ABAP program to explain their purpose to a reader.
Example
Types of Structure
Nested, Flat, Deep
Syntax
PARAMETERS <p>[(<length>)] [TYPE <type>|LIKE <obj>]
[DECIMALS <d>].
Syntax: WRITE<f>.
− A Field Symbol
− A Text Symbol
Syntax
They do not physically reserve space for a field, but point to its
contents.
Syntax
FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s>
DEFAULT <wa>].
Assigning Values
Numeric Operations
MOVE
WRITE TO
CLEAR
Move data into or between variables is done using the move statement.
There are two forms of the move statement
or
f2 = f1
WRITE TO
clear <f>