Professional Documents
Culture Documents
ABAP Technical Training DDIC
ABAP Technical Training DDIC
ABAP Technical Training DDIC
Introduction
Basic Data types
Tables in the ABAP Dictionary
Performance When Accessing Tables
Consistency through Input Checks
Views
Search Help
Lock Objects
Demonstration
Exercises
1.Type Definitions
2.DB Objects
3.Services
Analogous to the predefined ABAP types such as C or I , one may define user-
defined types in the dictionary. The following user-defined types are allowed
1.Domain: Describe an elementary type by defining the data type, length and
possibly decimal places.
2.Data element: Describes the description of field.
3.Structures: Consist of components that can have any type.
4.Table types: Describe the structure of an internal table.
2.These objects are created in the underlying database with this definition.
Changes in the definition of a table or database view are also automatically made
in the database.
2. Input helps (F4 helps) for screen fields can be defined with search helps.
3.Screen fields can easily be assigned a field help (F1 help) by creating
documentation for the data element.
4.An input check that ensures that the values entered are consistent can easily be
defined for screen fields using foreign keys.
1.The ABAP dictionary contains the data definitions (metadata). It is the central
information repository for both the application data as well as the system data.
Structures in the dictionary are not only populated with the application( business)
data but also the contain system data pertaining to both development and runtime
environment.
1.Flat Structure
2.Nested Structure
3.Deep Structure
1.Create Tables
2.Use the two-level domain concept
3.Define the technical settings of a table
4.Create and use include structures
2.A field has a unique name and attributes; for example it can be a key field.
3.A table has one or more key fields, called the primary key.
Describes the
business
context of a field
Determines
technical
characteristics of a
field
Copyright© 2017 Capgemini. All rights reserved.
Tables in the ABAP Dictionary
Two Level Domain Concept
2.The most important data classes are master data, transaction data,
organizational data and system data.
3.Further data classes, called customer data classes (USER, USER1), are
provided for customers. These should be used for customer developments.
Special storage areas must be allocated in the database.
There are two ways that you can add extra fields to an SAP table
without a modification:
1.Append structure
Created in Customer Namespace
Customers can create an append structure for an SAP table (without SAP
preparation)
Multiple append structures can be used with a single SAP table
They can be used in the same way as normal structures in programs
2.Customizing include
Is already integrated into SAP tables by SAP
The customer fills it with the desired additional fields
May contain source code or screen exits provided by SAP for processing or
displaying the fields
1. Append structures allow you to attach fields to a table without the need to
modify the table itself.
1. If you copy a table that has an append structure attached to it, the fields in the
append structure become normal fields in the target table.
1.You cannot create append structures for pool and cluster tables.
2.If a long field (data type LCHR or LRAW) occurs in a table, it cannot be extended
with appends structures. This is because long fields must always be in the last
position of the field list, that is, they must be the last field of the table. No fields
from an append structure may be added after them.
3.If you use an append structure to expand an SAP table, the field names in your
append structure should be in the customer namespace, that is, they must begin
with either YY or ZZ. This prevents name collisions with new fields inserted in the
standard table by SAP.
1. You create append structures in the customer namespace. This protects them from
being overwritten at upgrade or during release upgrade.
2. New versions of standard tables are loaded during upgrades. The fields contained
in the active append structures are then appended to the new standard tables
when these new standard tables are activated for the first time.
3. From Release 3.0, the field sequence in the ABAP Dictionary can differ from the
field sequence in the database. As a result, no conversion of the database table is
required when adding an append structure or inserting fields into an existing one.
4. All the necessary structure adjustment is taken care of automatically when you
adjust the database catalog, ALTER TABLE.
1. Some of the tables and structures delivered with the R/3 standard contain special
include statements: These are known as Customizing includes.
2. Customizing includes are part of the customer namespace, and their names start
with “CI_”. This naming convention guarantees that nonexistent Customizing
includes do not lead to errors.
3. The Customizing include field names must lie in the customer namespace just like
field names in append structures. These names must all begin with either “YY” or
“ZZ”.
4. In contrast to append structures, Customizing includes can be inserted into more
than one table. This provides for data consistency throughout the tables and
structures affected whenever the include is altered.
1.Primary index: The primary index contains the key fields of the table and a
pointer to the non-key fields of the table. The primary index is created
automatically when the table is created in the database.
1.The database optimizer decides which index on the table should be used by the
database to access data records.
2.You must distinguish between the primary index and secondary indexes of a
table. The primary index contains the key fields of the table. The primary index is
automatically created in the database when the table is activated. If a large table is
frequently accessed such that it is not possible to apply primary index sorting, you
should create secondary indexes for the table.
1.Buffering allows you to access data quicker by letting you access it from the
application server instead of the database.
2.Entering $TAB in the command field resets the table buffers on the
corresponding application server. Only use this command if there are
inconsistencies in the buffer. In large systems, it can take several hours to fill the
buffers. The performance is considerably reduced during this time.
1.With full buffering, the table is either completely or not at all in the buffer. When a
record of the table is accessed, all the records of the table are loaded into the
buffer.
2.When you decide whether a table should be fully buffered, you must take the
table size, the number of read accesses and the number of write accesses into
consideration.
3.The smaller the table is, the more frequently it is read and the less frequently it is
written, the better it is to fully buffer the table.
1.The domain describes the value range of a field by specifying its data type and
field length. If only a limited set of values is allowed, they can be defined as fixed
values.
2.Specifying fixed values causes the value range of the domain to be restricted by
these values. Fixed values are immediately used as check values in screen
entries. There is also an F4 help.
3.Fixed values can either be listed individually or defined as an interval.
4.Fixed values are only checked in screens. No check is made when data records
are inserted in a table by an ABAP program.
5.Although S_CLASS is a domain of the type C, it would accept no other character
besides C/Y/F.
1.The value range of a field can also be defined by specifying a value table in the
domain.
2.In contrast to fixed values, however, simply specifying a value table does not
cause the input to be checked. There is no F4 help either.
3.If you enter a value table, the system can make a proposal for the foreign key
definition.
4.A value table only becomes a check table when a foreign key is defined.
5.If you refer to a domain with a value table in a field, but no foreign key was
defined at field level, there is no check.
1.A foreign key creates a link between two tables T1 and T2. Every primary key
field from T2 (check table) is assigned a field from table T1 (foreign key field). The
fields from T1 assigned to primary key fields are marked as foreign key fields.
2.The most important function of the foreign key is the support of data integrity.
The foreign key fields can only accept values which appear in the primary key of
the check table. During input the values of the foreign key fields can thus be
checked against the entries of the assigned key fields of the check table.
3.Foreign keys are used to ensure that the data is consistent. Data that has been
entered is checked against existing data to ensure that it is consistent.
1.Table SMEAL contains the meals served to the passengers during a flight. The
meal names are maintained in table SMEALT.
2.Table SMEALT is the text table for table SMEAL since the key of SMEALT
consists of the key of SMEAL and an additional language key field (field with data
type LANG).
3.Table SMEALT can contain explanatory text in several languages for each key
entry of SMEAL.
4.To link the key entries with the text, the text table SMEALT must be linked with
table SMEAL using a foreign key. Key fields of a text table must be chosen for the
type of the foreign key fields.
1.Judge how a view is created from tables with join, projection, and selection
2.Create database views
3.Set up a link between foreign keys and join conditions
4.Use views in programs for data selection
5.Judge when to use maintenance views
6.Recognize the difference between an inner join and an outer join
7.Create a maintenance view
8.Create simple maintenance views
9.Create complex maintenance views
2.Data from several tables can be combined in a meaningful way using a view
(join). You can also hide information that is of no interest to you (projection) or only
display those data records that satisfy certain conditions (selection).
Four different view types are supported. These differ in the way in which the view
is implemented and in the methods permitted for accessing the view data
4.Maintenance views permit you to maintain the data distributed on several tables
for one application object at one time.
1.The input help (F4 help) is a standard function of the R/3 System. It permits the
user to display a list of possible values for a screen field. A value can be directly
copied to an input field by list selection.
2.If the number of possible entries for a field is very large, you can limit the set of
displayed values by entering further restrictions.
1.Elementary search helps - Describe a search path. The elementary search help
must define where the data of the hit list should be read from (selection method),
how the exchange of values between the screen template and selection method is
implemented (interface of the search help) and how the online input help should be
defined (online behavior of the search help).
1.Selection method refers to the database object (database table or view) from
which data is selected and displayed in the hit list.
1.A hit list might contain plentiful number of entries. A dialog provides the user
with an option to restrict the entries displayed on the hit list.
1.The dialog type of an elementary search help defines how the hit list is displayed
when the input help is called. It defines the dialog steps executed for input help.
2.Immediate value display: The hit list is immediately displayed when the input
help is called. This is only meaningful if the hit list usually only contains a few
entries.
3.Complex dialog with value restriction: The dialog window for restricting values is
offered immediately. Choose this option if the list of possible entries is usually very
large. If the user limits the amount of data to be processed, the hit list will become
more comprehensible and the system load during value selection will be reduced.
4.Dialog depending on number of values: If the hit list contains less than 100
entries, it is displayed immediately. If the hit list contains more than 100 entries,
the dialog box for restricting values is displayed.
1.Search help interface determines how the exchange of values between the
screen template and the selection method is implemented.
1.We must ensure that the hit list is displayed in minimum time with minimum load
on the system.
1.Choose the field name, click on search help tab and provide the name of the
search help.
1.Provide the search help name and the parameter name under the further
characteristics tab of the data element.
1.The name of the search help must be entered in the Screen Painter in the
Attributes for the field in the field Search help.
2.The name of the search help can be defined for selection screens in ABAP
reports in the PARAMETERS or SELECT-OPTIONS statement directly following
the supplement MATCHCODE OBJECT.
1.A collective search help also has interface parameters like an elementary search
help.
1.Parameter assignment needs to be done for each of the Included search helps
1.User may choose the tab and thus the elementary search method.
2. Lock mode X: This mode is used like mode E for changing data. The
only technical difference from mode E is that the respective lock does
not allow accumulation.
3. Lock mode S: This mode ensures that data displayed in your program
cannot be changed by other users during the entire display time. Here
you do notLock
wantMode
to change the data yourself (allows read only access for
data).
2.To release the lock in the application program call a function module
DEQUEUE_<LOCK_OBJECT>. For our example, it would be
DEQUEUE_EZMARA.
5. Under the data type tab enter the domain name which
determines the technical characteristics of the field.
6. If the domain does not exist in the data dictionary the system
prompts you to create one.
1. Enter the name of the view on in the initial screen and say
‘create’.
2. Choose database view as the view type.
3. Enter the table names and the join conditions for the database
view.
4. Under the tab View Fields, specify the names of the fields from
either table whose data you want to access using the view.
Hint: Check if common domain can be used for different data elements.
2. Hint: Add language field as first key field and add other key
fields same as the table for which you are creating text table.
Add foreign key relations with first table Foreign key field type
as key fields of text table
EmpID
EMPNAME
DEPTID
DEPTNAME