SAP Tutorials Blog

 

Elementary Data Types

Elementary data types are single fields. These types are by default in the system kernel. They are categories into two parts:


  • Predefined types
  • User defined types.
  • Predefined types

There are different predefined types that are by default available in the SAP system kernel.

C : C refers to characters whenever we have to process characters characters we use C data types. By default its size is 1 character but you can additionally specify the length using ‘LENGTH’ keyword.

N : N refers to numeric character, if we want to store numbers we use N data types. You can additionally specify the length using ‘LENGTH’ keyword. You can’t perform arithmetic operation on this type of data object.

I : I refers to integer, it is used in storing I integer value. It’s size is fixed and can not specify extra length. It’s size is also fixed and you can perform arithmetic operation on this type data object.

D : This data type is use when we have to declare date. It’s size is fixed and when we declare D the system will create a data object whose size is of 8 characters.

T : This data type is for Time. It’s size is fixed and system will create a data object whose size is of 6 character.

F : F stands for floating point. This data type is use when we have to store very large number. It’s size is also fixed and you can perform arithmetic operation on this type data object.

P : P stands for Packed decimal . It is use to store integer with up to n decimal points. You can specify length of P.

Decfloat16 : It is decimal floating point of size 8 bytes that can store up to 16 digits it is combination of both integer and floating point.

Decfloat34 : This is the another version of decimal floating point of size 16 bytes that can store up to 34 digits.

X : This is used for hexadecimal values and for storing binary data.

STRING : This data type can store alphanumeric character, it is of dynamic length that means memory allocation done at run time. This helps in memory optimization.

XSTRING : It’s purpose is same as of X data type both is used for hexadecimal values but XSTRING is of dynamic length. It is commonly used for handling binary files such as images.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com