Teknologi

LightBlog

Breaking

LightBlog

Tuesday, 28 August 2012

Data Type


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


  1. Integer Data Type occupies 4 bytes of memory and we can store upto 10 digits in an integer.
  2. Float data type stores 8 bytes of memory. This stores decimal data also. It is defined with 16 decimal places by default.
  3. 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.
  4. Character data type can accept all ASCII characters and it occupy 1 byte of memory.
  5. Number accepts only numbers but treats them as characters. i.e., string operations can be executed
  6. Date data type is of 8 bytes long and stores date in YYYYMMDD format.
  7. Time data type is of 6 bytes long and stores time in HHMMSS format.
  8. String data type has variable size and it adjusts based on the data in the string. It can read only .txt files
  9. Xstring is the hexadecimal formatted and similar to String type. i.e., it can read all files like .doc, .ppt, .xcs, .jpg, .bmp etc.
  10. 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

Note: only a member of this blog may post a comment.

Adbox