Module 2 - Data Types in the ABAP Dictionary
Module 2 - Data Types in the ABAP Dictionary
(Basics to Advanced)
Data Types in the ABAP Dictionary
www.zarantech.com
• This presentation, including examples, images, and references are provided for
informational purposes only.
• Complying with all applicable copyrights laws is the responsibility of the user.
• Without limiting the rights under copyright, no part of this document may be
reproduced, stored or introduced into a retrieval system, or transmitted in any
form or by any means.
• Credits shall be given to the images taken from the open-source and cannot be
used for promotional activities.
Objectives
4
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
5
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
6
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
• Format - In the format specifications, you find the data type and the number of characters that
can be entered in the dependent data object. If the format is numeric, you can also specify the
number of decimal places.
• The data type must be chosen from a built-in list of data types.
• The following are the most frequently used data types:
• CHAR (Character string) - Fields of this type can have a maximum length of 255 characters in
tables.
7
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
• To use longer Character strings in tables, you have to choose the LCHR data type. In structures,
there are no length restrictions regarding these fields.
• DATS (Date) - The length for this data type is set to eight characters.
• You can define the output template with the user profile.
• DEC (Decimal) - A DEC field can have a maximum of 31 characters.
• This field is the calculation or amount field with decimal point, +/- sign, and thousands
separators.
• NUMC (Numeric) - The length of NUMC field is restricted to a maximum of 255 characters.
This character string can only contain numbers. 8
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
Data Elements
9
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
• Documentation - You can create a text that describes the contents of the data element. This
text is displayed for the F1 help in all screen fields that refer to this data element.
• Search help - A search help (F4 key or input help) can be assigned to a data element. The
subject of search helps is discussed in greater detail later in this course.
• Search helps can be integrated at different levels.
• Set/Get Parameter - Assigning a SET/GET parameter to the data element saves the user from
entering the same value several times. A field can be filled with default values from SAP
memory.
10
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.1 Creating Domains and Data Elements
• Default component name - You can assign a default component name to the data element.
However, this is effective only if you use the data element as a component in Business
Application Programming Interface (BAPI) structures.
• Change document - The system logs changed field contents only if you set the Change
document indicator for the data element.
• Input history - The mechanism that the SAP GUI uses to handle the input history of a screen
input field is switched off.
• Bi-directional options
11
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.2 Creating Flat Structures
Objectives
12
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.2 Creating Flat Structures
Nested Structure
• You can include another structured object in the
structure and assign it to a component.
• The component refers to the structured object and
the new data object is described as a nested structure.
• When a structure is included as an include structure, it
can be assigned a name of a group. In ABAP programs,
the name of a group is an additional addressing option
for data objects declared with reference to the
structure.
15
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.3 Creating Table Types and Deep Structures
Objectives
16
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.3 Creating Table Types and Deep Structures
Table Types
• A dictionary structure containing one or more fields using a table type is called a deep
structure.
• You can define table types using an existing dictionary type.
• Database tables, structure definitions, views, data elements, direct type definitions, or
existing table types can be used as line type.
• During runtime, if the ABAP program is referencing any data object using table types,
the system will create a two-dimensional array in the main memory for each of these
objects.
17
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.3 Creating Table Types and Deep Structures
Table Types
18
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.3 Creating Table Types and Deep Structures
Tables Types
20
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.3 Creating Table Types and Deep Structures
Deep Structures
• A deep structure contains at least one field with a table
type.
• The component of this table has its own name with which
it can be addressed in the same way as a normal internal
table (LOOP AT..., INSERT... INTO TABLE, ...).
• An internal table, in turn, can have a deep structure as a
line type.
• In this way, you can create multidimensional data types,
since internal tables and structures can be inter-nested
21
several times.
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.4 Creating Type Groups
Objectives
22
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.4 Creating Type Groups
Type Groups
• Type groups can be used to define your own global-complex data types, global constants, and
macros.
• The name of the type group can contain a maximum of five characters. In the type group, you
can use the TYPES statement and the CONSTANTS statement, and you can also use the
predefined ABAP types or global dictionary types.
• A type group is defined as a piece of ABAP code that you maintain either in the ABAP Dictionary
(SE11) or in the ABAP Editor (SE38).
23
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 2.4 Creating Type Groups
Type Groups
24
© Copyright 2021, ZaranTech LLC. All rights reserved.
2
Q&A Session
25
© Copyright 2021, ZaranTech LLC. All rights reserved.
© Copyright 2021, ZaranTech LLC. All rights reserved.
Thank you
Subscribe to our Channel for more Informative Videos.
https://www.youtube.com/user/ZaranTech