ABAP Technical Training DDIC

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 134

COURSE OBJECTIVES

 Introduction
 Basic Data types
 Tables in the ABAP Dictionary
 Performance When Accessing Tables
 Consistency through Input Checks
 Views
 Search Help
 Lock Objects
 Demonstration
 Exercises

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Introduction to the Dictionary

1. ABAP dictionary is the central repository for creation and management


of definitions used in ABAP.

2. ABAP dictionary is integrated in ABAP workbench and therefore all tools


of the workbench like Programs, Screens, function modules can actively
access objects defined in data dictionary.

3. ABAP workbench is an integrated tool for creating an ABAP


application.

Copyright© 2017 Capgemini. All rights reserved.


Introduction to the Dictionary
Function of the ABAP Dictionary

1.Type Definitions

2.DB Objects

3.Services

Copyright© 2017 Capgemini. All rights reserved.


Introduction to the Dictionary
Type Definitions in the ABAP Dictionary:-

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.

Copyright© 2017 Capgemini. All rights reserved.


Introduction to the Dictionary
Database objects in the ABAP Dictionary

1.Tables and database views can be defined in the ABAP Dictionary.

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.

3.Indexes can be defined in the ABAP Dictionary to speed up access to data in a


table. These indexes are also created in the database.

Copyright© 2017 Capgemini. All rights reserved.


Introduction to the Dictionary
Services of the ABAP Dictionary

1.The ABAP Dictionary supports program development with a number of services:

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.

F1-> Documentation for the data element


F4-> Input help for screen fields

Copyright© 2017 Capgemini. All rights reserved.


Introduction to the Dictionary
Linking to the development and runtime environment

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.

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Basic Data Types
After completing this lesson, you will be able to:

1.Create domains and use them in data elements


2.Define data elements and use them as the basis for defining data objects in
ABAP programs
3.Define structures and use them as the basis for defining data objects in ABAP
programs
4.Define internal tables and use them as the basis for defining data objects in
ABAP programs
5.Define complex (nested / deep) structures and use them as the basis for defining
data objects in ABAP programs
6.Define global constants with the help of a type pool and use them in ABAP
programs

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Data Dictionary Initial Screen (SE11):

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Domain

1.A domain is assigned to a data element.


2.It’s defines the technical attribute of a field, example ( its data type, size and a
value range )
3.Fields or components that refer to the same domain (with the assigned data
elements) are also changed when the domain is changed.

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Data Element

1.Date element describes the business semantics of a field


2.Search, Field labels and documentation (F1 Help) can be assigned to a data
element.
3.Information about the meaning of a table field or structure component and
information about editing the corresponding screen field can be assigned to a data
element. This information is automatically available to all screen fields that refer to
the data element.

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Structures

1.Flat Structure

2.Nested Structure

3.Deep Structure

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Flat Structures

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Nested Structures

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Deep Structures

Copyright© 2017 Capgemini. All rights reserved.


Basic Data Types
Table Type

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Tables in the ABAP Dictionary
After completing this lesson, you will be able to:

1.Create Tables
2.Use the two-level domain concept
3.Define the technical settings of a table
4.Create and use include structures

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Tables and Fields

1.A table consists of columns (fields) and rows (entries).

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.

4.The values of these key fields uniquely identify a table entry.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Database table and its components

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

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Tables and Structures

In SAP R/3 tables are defined as


1.Transparent Tables
2.Pooled Tables
3.Cluster Tables

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Transparent Tables and Structures

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Include Structure

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Technical settings Includes:-
1.Data Class
2.Size Category
3.Buffering Type
4.Logging

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Data Class
1.The data class logically defines the physical area of the database (for ORACLE
the table space) in which your table should be created. If you choose the data
class correctly, the table will automatically be created in the appropriate area on
the database when it is activated in the ABAP Dictionary.

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.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Data Size
1.The size category describes the expected storage requirements for the table on
the database.
2.An initial extent is reserved when a table is created on the database. The size of
the initial extent is identical for all size categories. If the table needs more space
for data at a later time, extents are added. These additional extents have a fixed
size that is determined by the size category specified in the ABAP Dictionary.
3.You can choose a size category from 0 to 4. A fixed extent size, which depends
on the database system used, is assigned to each category.
4.Correctly assigning a size category therefore ensures that you do not create a
large number of small extents. It also prevents storage space from being wasted
when creating extents that are too large.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Logging
1.Modifications to the entries of a table can be recorded and stored using logging.
2.To activate logging, the corresponding field must be selected in the technical
settings. Logging, however, only will take place if the R/3 System was started with
a profile containing parameter 'REC/CLIENT'. Only selecting the flag in the ABAP
Dictionary is not sufficient to trigger logging.
3.The data modifications are logged independently of the update. The logs can be
displayed with the Transaction Table History (SCU3).
Parameter 'REC/CLIENT' can have the following settings:
REC/CLIENT = ALL All clients should be logged.
REC/CLIENT = 000[...] Only the specified clients should be logged.
REC/CLIENT = OFF Logging is not enabled on this system.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Table Enhancement

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

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Append Structures

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.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Append Structures

Click on the append structure


tab and opt to create new
structure.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary

Pay attention to the following points when using append


structures:

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.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Append Structures at
Upgrade

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.

Copyright© 2017 Capgemini. All rights reserved.


Tables in the ABAP Dictionary
Customizing
Includes

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.

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Performance during table access
After completing this lesson, you will be able to:

1.Judge when table accesses can be speeded up by using indexes


2.Create indexes in the ABAP Dictionary
3.Explain the different buffering types
4.Judge when it makes sense to buffer a table and which buffering type you
should choose
5.Buffer a table using the technical settings

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Index: Technical key of a database table.

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.

2.Secondary index: Additional indexes could be created considering the most


frequently accessed dimensions of the table.

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Structure of an Index

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Access with Indexes

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.

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Data Access using the Buffer

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.

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Full Buffering

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.

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Generic Buffering

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Single Record Buffering

1.Single-record buffering is recommended particularly for large tables in which only


a few records are accessed repeatedly with SELECT SINGLE.
2.All the accesses to the table that do not use SELECT SINGLE bypass the buffer
and directly access the database.
3.If you access a record that was not yet buffered using SELECT SINGLE, there is
a database access to load the record. If the table does not contain a record with
the specified key, this record is recorded in the buffer as non-existent. This
prevents a further database access if you make another access with the same key

Copyright© 2017 Capgemini. All rights reserved.


Performance during table access
Decision Tree for Buffering

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Consistency through input checks
After completing this lesson, you will be able to:

1.Create and use fixed values


2.Define what a foreign key is
3.Apply the conditions for the field assignment of the foreign key
4.Know the difference between the value table and the check table
5.Create foreign key

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Fixed Values

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.

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Value Table

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.

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Value Table - Inserting a Data Record

Violation of the Foreign Key Check


Copyright© 2017 Capgemini. All rights reserved.
Consistency through input checks
Foreign key fields / Check fields

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.

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Data Consistency through Foreign Keys

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Foreign Key Definitions in the Check Field

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Check Table not Equal to Value Table

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Semantic Attributes

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Text table

Copyright© 2017 Capgemini. All rights reserved.


Consistency through input checks
Text table

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.

5.The foreign key relationship is defined from SMEALT to SMEAL.

6.Only one text table can be created for a table.

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Views
After completing this lesson, you will be able to:

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

Copyright© 2017 Capgemini. All rights reserved.


Views
Why do you need views?

1.Data for an application object is often distributed on several database tables.


Database systems therefore provide you with a way of defining application-specific
views on the data contained in several tables. These are called 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).

Copyright© 2017 Capgemini. All rights reserved.


Views
View Types

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

1.Database views are implemented with an equivalent view on the database.

2.Projection views are used to hide fields of a table (only projection).

3.Help views can be used as selection method in Search help.

4.Maintenance views permit you to maintain the data distributed on several tables
for one application object at one time.

Copyright© 2017 Capgemini. All rights reserved.


Views
Structure of a View - Starting Situation

Copyright© 2017 Capgemini. All rights reserved.


Views
Structure of a View - Join Condition

Copyright© 2017 Capgemini. All rights reserved.


Views
Structure of a View - Field Selection (Projection)

Copyright© 2017 Capgemini. All rights reserved.


Views
Structure of a View - Selection Condition

Copyright© 2017 Capgemini. All rights reserved.


Views
How are Tables (basis tables) linked to Views?

Copyright© 2017 Capgemini. All rights reserved.


Views
Structure of the View

Copyright© 2017 Capgemini. All rights reserved.


Views
Data Selection with Views

Copyright© 2017 Capgemini. All rights reserved.


Views
Inner and Outer Join

Copyright© 2017 Capgemini. All rights reserved.


Views
Database View

Copyright© 2017 Capgemini. All rights reserved.


Views
Collecting data with generated maintenance masks

Copyright© 2017 Capgemini. All rights reserved.


Views
Maintenance view from a maintenance view

Copyright© 2017 Capgemini. All rights reserved.


Views
Define maintenance view 1

Copyright© 2017 Capgemini. All rights reserved.


Views
Define maintenance view 3

Copyright© 2017 Capgemini. All rights reserved.


Views
Advantages and disadvantages of a maintenance view

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Search Helps
After completing this lesson, you will be able to:

1.Define an input help process with a search help


2.Define a search help with several alternative search paths
3.Use the different mechanisms for the search help attachment to assign a search
help to a screen field
4.Determine whether a screen field has an input help and determine its form
5.Enhance a collective search help using an append search help without
modifications
6.Program a search help exit

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
SAP Standard Function: Input Help

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.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
TYPES OF SEARCH HELPS

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).

2.Collective search help - Combine several elementary search helps. A collective


search help thus can offer several alternative search paths.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Input Help Requirements

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
ABAP Dictionary Object Search Help

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Selection Method of a 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.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Description of the Dialog Behavior

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.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Dialog Type

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.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Interface of a Search Help

1.Search help interface determines how the exchange of values between the
screen template and the selection method is implemented.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
How do you Use Search Helps?

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Search Help Attachment in the ABAP Dictionary

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Overview: Mechanisms for the Input Help

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Performance of the Input Help

1.We must ensure that the hit list is displayed in minimum time with minimum load
on the system.

2.This can be done by restricting the hit list

3.Restricting conditions entered by the user in a dialog.

4.Performance of the input help could be greatly improved by creating an index on


the fields used to formulate the restrictions.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Attaching a search help to a field

1.Choose the field name, click on search help tab and provide the name of the
search help.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Attaching a search help to a table field

1.Attach the search help to the table field

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Attaching a search help to a data element

1.Provide the search help name and the parameter name under the further
characteristics tab of the data element.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Attaching a search help to a Screen Field

A search help can be directly assigned to a screen field in two ways

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.

However, input help is only available for this particular screen.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Collective Search Helps and Elementary Search Helps

1.A Collective search help provides alternative search Paths by combining


elementary search helps.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Collective Search Help

1.A collective search help also has interface parameters like an elementary search
help.

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Collective Search Help

1.Parameter assignment needs to be done for each of the Included search helps

Copyright© 2017 Capgemini. All rights reserved.


Search Helps
Collective Search Help

1.User may choose the tab and thus the elementary search method.

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Lock Objects
1. Data dictionary provides you with a locking mechanism to synchronize
simultaneous data access by different users.

2. Lock objects are created in SE11.

3. Customer lock objects must begin with EY or EZ .

4. Three possible lock modes exist for lock objects.

Copyright© 2017 Capgemini. All rights reserved.


Lock Objects
1. Lock mode E: This sets a lock for changing data for single user. This
lock can be accumulated.

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).

Lock Mode Meaning

E (Extensible) Lock for data change (accumulative exclusive lock)

X (Exclusive) Lock for data change (exclusive write lock)

S (Shared) Lock for protected data display (shared lock)

Copyright© 2017 Capgemini. All rights reserved.


Lock Objects
Creating a Lock Object

1. Enter lock object name beginning with EY or EZ and hit create.


2. Enter table names containing data records that should be locked and the
lock mode.
3. The primary keys of the specified tables are automatically selected as lock
parameters.
Copyright© 2017 Capgemini. All rights reserved.
Lock Objects
Creating a Lock Object

1.To set a lock in the application program call a function module


ENQUEUE_<LOCK_OBJECT>. For our example, it would be
ENQUEUE_EZMARA.

2.To release the lock in the application program call a function module
DEQUEUE_<LOCK_OBJECT>. For our example, it would be
DEQUEUE_EZMARA.

3.Refer the code executed by user (say abap1) for matnr =


’000000000000000012’.

Copyright© 2017 Capgemini. All rights reserved.


Lock Objects
Creating a Lock Object

If another user (say abap2) tries to access


the same data i.e. matnr =
‘000000000000000012’,via a program or a
transaction it would deny him read or write
access

Copyright© 2017 Capgemini. All rights reserved.


Lock Objects
Parameters in Enqueue Module

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Demonstration

1. Steps to create a Transparent Table

2. Steps to create a Data Element.

3. Steps to create a Domain

4. Steps to create a Database View

5. Steps to create an Elementary Search Help

6. Steps to create a Collective Search Help

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

1. Go to transaction SE11. Enter name of table you want to create


(beginning with Y or Z) and click on create pushbutton

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

2. Enter the delivery class and the table maintenance criteria

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

3. To create a data element simply double click on it. Alternately


create a data element by simply choosing the data type radio
button on SE11 initial screen.
4. The system prompts you to create a new data element. Choose
the Yes pushbutton.
Copyright© 2017 Capgemini. All rights reserved.
Create transparent table

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.

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

7. Give the technical characteristics under the definition tab. Value


range allows you value restriction at domain level.

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

8. A field containing currency amounts (data type CURR) must be


assigned a reference field including the currency key (data type
CUKY).

Copyright© 2017 Capgemini. All rights reserved.


Create transparent table

9. Maintain the technical settings of the table by clicking on the tab

Copyright© 2017 Capgemini. All rights reserved.


Create Database View

1. Enter the name of the view on in the initial screen and say
‘create’.
2. Choose database view as the view type.

Copyright© 2017 Capgemini. All rights reserved.


Create Database View

3. Enter the table names and the join conditions for the database
view.

Copyright© 2017 Capgemini. All rights reserved.


Create 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.

Copyright© 2017 Capgemini. All rights reserved.


Create Database View

5. The system allows you to enter data restricting conditions under


the tab Selection conditions.

Copyright© 2017 Capgemini. All rights reserved.


Create Database View

6. Enter the Maintenance Status

Copyright© 2017 Capgemini. All rights reserved.


Elementary Search Help

1. Enter the search help name and click on create.


2. Choose elementary search help radio button option as the
search help type.

Copyright© 2017 Capgemini. All rights reserved.


Elementary Search Help

3. Enter the search help parameters, the selection method and


activate the search help

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

1. Enter the search help name and click on create.


2. Choose Collective search help radio button option as the search
help type

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

3. Enter the search help parameters.


4. Note that there is no selection method to be entered for a
collective search help.

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

5. Instead of the selection method, we enter the included search


helps for the collective search help.

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

6. We need to assign parameters for each of the included search


helps.

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

7. Complete the parameter assignment by clicking on the push


button

Copyright© 2017 Capgemini. All rights reserved.


Collective Search Help

8. Collective search help offers the user to obtain F4 help using


any of the included search helps.

Copyright© 2017 Capgemini. All rights reserved.


Copyright© 2017 Capgemini. All rights reserved.
Exercise 1: Create data elements, domains and
tables
1. Create the following tables:

Employee Department Emp_Dept


MANDT MANDT MANDT MANDT MANDT MANDT
EMPID CHAR10 DEPTID CHAR10 EMPID CHAR10
DEPTNAME CHAR40
EMPNAME CHAR40 DEPTID CHAR10
AGE INT1 HOD(Emp ID) CHAR10
ISDEPHEAD CHAR01

2. Create all necessary data elements and domains.

Hint: Check if common domain can be used for different data elements.

Copyright© 2017 Capgemini. All rights reserved.


Exercise 2 Create Foreign key relations

1. Foreign Key Relationship between Employee and Department


table.

2. Between Emp_Dept and Employee

3. Between Emp_Dept and Department

Copyright© 2017 Capgemini. All rights reserved.


Exercise 3 Text Table

1. Create text Table for Department Table with for Department


Description

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

Copyright© 2017 Capgemini. All rights reserved.


Exercise 4 Input help

1. Maintain fixed values to domain of the field “IsDepHead”

2. Create search help for employee and assign to Department –


Employee relationship table

Copyright© 2017 Capgemini. All rights reserved.


Exercise 5 Maintenance & Database view

1. Create Maintenance view of all the 3 tables and maintain the


data

2. Create Database View Using the 3 tables with the following


fields:

EmpID
EMPNAME
DEPTID
DEPTNAME

Copyright© 2017 Capgemini. All rights reserved.


Some useful transactions

1. Dictionary maintenance (SE11)


2. Dictionary display (SE12)
3. R/3 Repository Information System (SE84)
4. Repository Information System ABAP Dictionary (SE15)
5. Data display/maintenance (Data Browser) (SE16)
6. Technical settings (SE13)
7. Database utility (SE14)
8. Table view generation (SE54)
9. Extended table maintenance (SM30)

Copyright© 2017 Capgemini. All rights reserved.

You might also like