- Data Types are the key words which specify the type of memory and size of memory.
ABAP Data Types can be classified into 2 types.1) Predefined Data Types
2) User defined Data Types
- Integer Data Type occupies 4 bytes of memory and we can store upto 10 digits in an integer.
- Float data type stores 8 bytes of memory. This stores decimal data also. It is defined with 16 decimal places by default.
- Packed data type is same as Float data type except that by default, there are no decimal places and ABAPER has to specify the required no. of decimal places.
- Character data type can accept all ASCII characters and it occupy 1 byte of memory.
- Number accepts only numbers but treats them as characters. i.e., string operations can be executed
- Date data type is of 8 bytes long and stores date in YYYYMMDD format.
- Time data type is of 6 bytes long and stores time in HHMMSS format.
- String data type has variable size and it adjusts based on the data in the string. It can read only .txt files
- Xstring is the hexadecimal formatted and similar to String type. i.e., it can read all files like .doc, .ppt, .xcs, .jpg, .bmp etc.
- We can also create our own Data Types using "Types" or by creating custom objects like Structures, Classes, Interfaces etc.
Differences between Float and Packed data types:
- FLOAT has default decimal places of 16 & PACKED data type has 0.
- FLOAT decimal places are fixed whereas can be decided by the ABAPer for PACKED.
- PARAMETER, which creates GUI for data type is not supported by FLOAT while it is supported by PACKED type.
No comments:
Post a Comment