Data Type describes the technical characteristics of a Variable of that type. Data type is just the blue print of a variable.
Predefined ABAP Types
Data Type | Description | Default Length | Default Value |
---|---|---|---|
C | Character | 1 | ‘ ‘ |
N | Numeric | 1 | 0 |
D | Date | 8 | 00000000 |
T | Time | 6 | 000000 |
X | Hexa Decimal | 1 | X’0′ |
I | Integer | 4 | 0 |
P | Packed | 8 | 0 |
F | Float | 8 | 0 |
User defined data types
Use TYPES keyword to define the data types.
TYPES: name(10) TYPE c, length TYPE p DECIMALS 2, counter TYPE i, id(5) TYPE n.
Structured data types
Structured data type is grouping of several simple data types under one name.
Use the keywords BEGIN OF and END OF to create a structured data type.
TYPES: BEGIN OF student, id(5) TYPE n, name(10) TYPE c, dob TYPE d, place(10) TYPE c, END OF student.
Constants
Constants are used to store a value under a name. We must specify the value when we declare a constant and the value cannot be changed later in the program.
Use CONSTANTS keyword to declare a constant.
CONSTANTS: pi TYPE p DECIMALS 2 VALUE '3.14', yes TYPE c VALUE 'X'.
Excellent post. It is seriously improve to us. Its offer us a great many interest and satisfaction. Its chance are so great and hitting style so speedy. Its really a great write-up. It offers me a lot of pleasure and interest.
Excellent, very easy to understand for non programmer too..
yes , but have to show detail and output as well
I just want to say I am just newbie to blogging and truly enjoyed your web site. Probably I’m likely to bookmark your site . You amazingly come with wonderful well written articles. Many thanks for revealing your blog site.
Hey, you used to write fantastic articles, but the last few posts have been kinda boring… I miss your tremendous posts. Past several posts are just a little bit out of track!
High quality blog post!
Hey There. I found your blog using msn. This is a very well written article. I’ll make sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll certainly comeback.
Simply desire to say your article is as amazing. The clearness in your post is just great and i could assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.
keep up this good work. Excellent post
I really enjoyed your information. Be sure to keep it up. Take Care .
Interesting post. Thanks for the great information and good luck to you!
I am often to blogging and i really respect your content. The article has actually peaks my interest. I am going to bookmark your site and hold checking for new information.
Many thanks.
its really easy to understand things from here for newbie Abaper but If the output of given user defined data types also shown here,it will be a great help as i am not able to understand the structured data type ,how it look like.
Good Posts..Keep posting..
Good post.
Its crystal clear about the concept just by using few simple words.
thanks to admin and content writer.
Its good to read and understand. Can you send this hole document to read
Too nice, for beginners it is good,
Good post..
Your blog is very nice. I have gone through the entire material. Really appreciating your effort. I would like to add one small point to this tutorial. While declaring constants it is not mandatory to specify the value and the value can be changed during our program. At any point of time it contains one value.
Please ignore the below comment. And delete if possible. It’s wrong concept.
how to create data dictionary in data type in table type
Thanks for your post
hi .. I am new to ABAP ,,,,
pls share examples of structures and type casting
X Hexa Decimal 1 X’0′
I checked in ABAP and found that a Hexadecimal variable was able to store 2 hex characters.
For example,
TYPES: HexValue type X.
DATA: value type HexValue.
value = ‘FF’.
WRITE value.
It is printing ‘FF’. So does that mean the length of a Hexadecimal variable is 2?
Additional Info :
Difference between float and packed.
packed – rounds the decimal value to the next whole integer.
89.88 becomes 90.
float – holds the exact value assigned to it.
89.88 remains 8.9879999999999995E+1
can u elaborate more aout user defined data types ,
coz as per java we array structures union as userdefined data types,
so in ABAP do we have similar data types