SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development PDF Download

While programming in ABAP, we need to use a variety of variables to store various information. Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. You may like to store information of various data types like character, integer, floating point, etc. Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory.

Elementary Data Types

ABAP offers the programmer a rich assortment of fixed length as well as variable length data types. Following table lists down ABAP elementary data types −

SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development

Some of the fields and numbers can be modified using one or more names as the following −

  • byte
  • numeric
  • character-like

The following table shows the data type, how much memory it takes to store the value in memory, and the minimum and maximum value that could be stored in such type of variables.
SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development


Example

REPORT YR_SEP_12. 

DATA text_line TYPE C LENGTH 40. 

text_line = 'A Chapter on Data Types'. 

Write text_line. 

DATA text_string TYPE STRING. 

text_string = 'A Program in ABAP'. 

Write / text_string. 

DATA d_date TYPE D. 

d_date = SY-DATUM. 

Write / d_date.

In this example, we have a character string of type C with a predefined length 40. STRING is a data type that can be used for any character string of variable length (text strings). Type STRING data objects should generally be used for character-like content where fixed length is not important.

The above code produces the following output −

A Chapter on Data Types 

A Program in ABAP 

12092015 

The DATE type is used for the storage of date information and can store eight digits as shown above.

Complex and Reference Types

The complex types are classified into Structure types and Table types. In the structure types, elementary types and structures (i.e. structure embedded in a structure) are grouped together. You may consider only the grouping of elementary types. But you must be aware of the availability of nesting of structures.

When the elementary types are grouped together, the data item can be accessed as a grouped data item or the individual elementary type data items (structure fields) can be accessed. The table types are better known as arrays in other programming languages. Arrays can be simple or structure arrays. In ABAP, arrays are called internal tables and they can be declared and operated upon in many ways when compared to other programming languages. The following table shows the parameters according to which internal tables are characterized.
SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development

Reference types are used to refer to instances of classes, interfaces, and run-time data items. The ABAP OOP run-time type services (RTTS) enables declaration of data items at run-time.

The document SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development is a part of the Software Development Course Learn and Master SAP ABAP.
All you need of Software Development at this link: Software Development
73 videos|68 docs

Top Courses for Software Development

FAQs on SAP ABAP - Data Types - Learn and Master SAP ABAP - Software Development

1. What are elementary data types in SAP ABAP?
Ans. Elementary data types in SAP ABAP are basic data types that represent single values, such as numbers, characters, and dates.
2. What are complex data types in SAP ABAP?
Ans. Complex data types in SAP ABAP are data types that can hold multiple values or structures, such as tables, structures, and references.
3. What are reference types in SAP ABAP?
Ans. Reference types in SAP ABAP are data types that store memory addresses of other data objects, allowing for indirect access to the data.
4. How are data types used in software development in SAP ABAP?
Ans. Data types in SAP ABAP are used to define the structure and behavior of data objects, ensuring consistency and efficiency in programming.
5. Why is understanding data types important in SAP ABAP development?
Ans. Understanding data types in SAP ABAP is crucial for efficient coding, data manipulation, and ensuring data integrity in software development projects.
73 videos|68 docs
Download as PDF
Explore Courses for Software Development exam

Top Courses for Software Development

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Summary

,

ppt

,

Sample Paper

,

past year papers

,

SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development

,

Viva Questions

,

Semester Notes

,

SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development

,

practice quizzes

,

MCQs

,

Important questions

,

Free

,

Objective type Questions

,

study material

,

Extra Questions

,

Previous Year Questions with Solutions

,

SAP ABAP - Data Types | Learn and Master SAP ABAP - Software Development

,

pdf

,

video lectures

,

Exam

,

shortcuts and tricks

,

mock tests for examination

;