Types of SAP ABAP Data Types Leeaning

In SAP ABAP programming, we need to use various variables to store various information. Variables are nothing but memory locations that are ordered to store values. This means that when you create a variable you reserve some space in memory. You might want to store information from various types of data such as characters, integers, floating points, etc. Based on the type of data from a variable, the operating system allocates memory and decides what can be stored in ordered memory.


Dasar Tipe Data


The following are the basic data types that are often used:
TypeKeyword
Byte fieldX
Text fieldC
IntegerI
Floating pointF
Packed numberP
Text stringSTRING

Baca Juga: Tutorial Lengkap SAP ABAP

The following table shows the data type, how much memory is needed to store the value in memory, and the minimum and maximum values ​​that can be stored in the variable types above
TypeTypical LengthTypical Range
X1 byteAny byte values (00 to FF)
C1 character1 to 65535
N (numeric text filed)1 character1 to 65535
D (character-like date)8 characters8 characters
T (character-like time)6 characters6 characters
I4 bytes-2147483648 to 2147483647
F8 bytes2.2250738585072014E-308 sd 1.7976931348623157E+308 positive atau negative
P8 bytes[-10^(2len -1) +1] to [+10^(2len -1) 1] (dimana len = fixed length)
STRINGVariableAny alphanumeric characters
XSTRING (byte string)VariableAny byte values (00 to FF)
Example:
?
1
2
3
4
5
6
7
8
9
10
11
12
REPORT YR_SEP_12.
DATA text_line TYPE C LENGTH 40.
text_line = 'A Chapter on Data Types'.
Write text_line.
DATA text_string TYPE STRING.
text_string = 'A Program in ABAP'.
Write / text_string.
DATA d_date TYPE D.
d_date = SY-DATUM.
Write / d_date.

In this example, we have a character string type C with a predetermined length of 40. STRING is a data type that can be used for character strings of variable length (text strings). The STRING data object type in general must be used for content such as characters whose length is still not important.
?
1
2
3
4
A Chapter on Data Types
A Program in ABAP
(tanggal pada saat kode dibuat ”DDMMYYYY”)<span style="font-family: "times new roman";"><span style="white-space: normal;">
</span></span>
Complex and Reference Types

complex types are classified into Structure types and Table types. In structure types, basic types and structures (ie structures embedded in structures) are grouped together.

  • Line or row type - Internal table rows can be basic, complex or reference types.
  • Key - Specifies a field or group of fields as internal table keys that identify table rows
  • Access method - Explains how the ABAP program accesses individual table entries.
Blogger
Disqus

No comments