Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com
ABAP

Data Types

 

 

Any programming language, data type is one of the most important programming Element.  It represents the type of data that is being created in the program.

In SAP there are pre-defined data types and custom defined data types.

Let’s take a look at some of these data types.

 

Data Type

How it is represented in ABAP

Length

Memory

Comments

Integer

I

fixed

4 bytes of memory

It is a predefined data type which is used to create the integer values. The variable declared as integers cannot contain decimal values.

Packed

P

User defined

8 bytes of memory

Packed variable is used to store whole values as well as decimal values. Unlike integers these variables do not have fixed length. User has to define the length of the variable and the number of decimal points allowed. If no of decimal point is not mentioned the system by default it takes as 2 decimal point.

Float

F

fixed

8 bytes of memory

Float is used for obtaining the accurate value of the data to ‘n’ of decimal points. Rounding off doesn’t happen unlike packed numbers.

Characters

C

User defined

1 byte per character

This variable is used to define the characters. Can contain alphabets and special characters. The length of the character is to be specified by the user at the design time. If the character is declared with length 8 then it can hold only 8 letters.

Numeric

N

User defined

1 byte per character

Numeric is also a character variable which can be a combination of the Numbers and Characters. Length is similar to that of characters.

String

STRING

Dynamic length

1 byte per character

Strings are nothing but a set of characters. Unlike characters the length here is not fixed. The length is adjusted dynamically at run time depending upon number of character filled in the variable.

Date

D

fixed(8)

8 bytes of memory

Date is a character data type that is used to represent the date. 

The format of the data is stored internally as

YYYYMMDD

Time

T

fixed(6)

6 bytes of memory

Time is a character data type that is used to represent the time.

The format of the time is stored internally as

HHMMSS

 

 

 

The data types which we saw in this tutorial are predefined data types. Apart from this there are other ways of declaring the data as well through data element , structure and internal table. We will see about those data types when we use them.

About Arun

0 Comments:

Post a Comment

Powered by Blogger.