Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 17

SAP ABAP Dictionary

SAP ABAP DICTIONARY

Contents Page
Introduction…………………………....………………………………………………..2
Object types in the ABAP Dictionary…………………………………..………..…2
Tables……………………………………………………………………………………...3
Commonly used SAP standard tables…………………………………………..….5
Difference between Standard tables, Pooled tables and Cluster Tables……6
Views………………………………………………………………………………………6
Types………………………………………………………………………..……………10
Lock Objects……………………………………………………………………………11
Domains…………………………………………………………………………………12
Search Help……………………………………………………………………..……..13
Difference between a check table and a value table ………………………….13
Naming notation………………………………………………………………………14
ABAP Dictionary FAQ…………………………….………………………………….15

Created by: Ranjit K Page 1 12/9/2023


SAP ABAP Dictionary

Introduction:
Data definitions (metadata) are created and managed in the ABAP Dictionary. The ABAP Dictionary
permits a central description of all the data used in the system without redundancies. New or modified
information is automatically provided for all the system components. This ensures data integrity, data
consistency and data security.
The ABAP Dictionary supports the definition of user-defined types (data elements, structures and table
types). You can also define the structure of database objects (tables, indexes and views) in the ABAP
Dictionary. These objects can then be automatically created in the database with this definition. The
ABAP Dictionary also provides tools for editing screen fields, for example for assigning a field an input
help (F4 help).
The ABAP Dictionary also provides standard functions for editing fields on the screen, for example for
assigning a screen field an input help. Information Stored in the ABAP Dictionary.

The most important object types in the ABAP


Dictionary:
Tables
Views
Types
Domains
Search helps
Lock objects.
Search Help

Created by: Ranjit K Page 2 12/9/2023


SAP ABAP Dictionary

Tables
Tables are defined in the ABAP Dictionary independently of the database. A table having the same
structure is then created from this table definition in the underlying database. Transparent table, Pool
table and cluster table are data dictionary table objects sorted table, indexed table and hash table are
internal tables.
Transparent Table: Exists with the same structure both in dictionary as well as in database exactly
with the same data and fields.

Pooled Table: Pooled tables are logical tables that must be assigned to a table pool when they are
defined. Pooled tables are used to store control data. Several pooled tables can be combined in a table
pool. The data of these pooled tables are then sorted in a common table in the database.

Cluster Table: Cluster tables are logical tables that must be assigned to a table cluster when they are
defined. Cluster tables can be used to store control data. They can also be used to store temporary data
or texts, such as documentation.

Created by: Ranjit K Page 3 12/9/2023


SAP ABAP Dictionary

There are five types of Internal Tables: Standard Tables, Sorted Table, Index Table,
Hashed Table, Any Table (Generic type, rarely used).

Pooled Table:
Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data
from several different tables can be stored together in a table pool or table cluster. Tables assigned to a
table pool or table cluster are referred to as pooled tables or cluster tables. A table in the database in
which all records from the pooled tables assigned to the table pool are stored corresponds to a table
pool. The definition of a pool consists essentially of two key fields (Tabname and Varkey) and a long
argument field (Vardata). Table Clusters Several logical data records from different cluster tables can be
stored together in one physical record in a table cluster. A cluster key consists of a series of freely
definable key fields and a field (Pageno) for distinguishing continuation records. A cluster also contains a
long field (Vardata) that contains the contents of the data fields of the cluster tables for this key. If the
data does not fit into the long field, continuation records are created. Control information on the structure
of the data string is still written at the beginning of the Vardata field.

Hashed tables:
This is the most appropriate type for any table where the main operation is key access. You cannot
access a hashed table using its index. The response time for key access remains constant, regardless of
the number of table entries. Like database tables, hashed tables always have a unique key. Hashed
tables are useful if you want to construct and use an internal table which resembles a database table or
for processing large amounts of data.

Created by: Ranjit K Page 4 12/9/2023


SAP ABAP Dictionary

Commonly used SAP standard tables

Sales orders Classification


Name Description Name Description
LIKP Shipped Lines header KSSK Material number to class
LIPS Shipped Lines detail KLAS Class description
VBAK Order header KSML Characteristic name
Characteristic name
VBAP Table fields CABN/CABNT description
VBBE Open sales order line items CAWN/CAWNT Characteristic name
VBEP Schedule line item AUSP Numeric values
VBFA Document flow CAUFV Service order header
VBUK Order status AFPO Service order line
VBUP Line item detail status RESB SM Reservations
VBFK Invoicing header Customer Data
VBFP Invoicing detail KNA1 Customer Master
Material Management KNVV Sales information
Name Description KNVP Partners (ship-to, etc)
MARA Inventory Master System tables
MARC Plant Data Name Description
MARD Current Inventory DD02T Table texts
MAKT Descriptions DD03L Table fields
MBEW Material Valuation DD04T Data element texts
T179 Product Hierarchy USR02 Valid user names
MVKE Sales data (materials) Config tables (normally begin with "T")
MKPF Material document Name Description
Purchasing T001 Client table
Name Description T002 Languages
EINA Purchasing info record T005 Region (Country)
Purchasing info record
EINE detail TCURR Currency and exchange rates
EKPO Purchase orders TVAK Order type
EKET Scheduled lines TVSB Shipping condition
EKES Vendor confirmed lines TVAGT Rejected reason for order line
Forecasting Other tables
Name Description Name Description
MAPR STXH Text header
PROP STXL Text detail
PROW

Created by: Ranjit K Page 5 12/9/2023


SAP ABAP Dictionary

Difference between Standard tables, Pooled tables


and Cluster Tables
A transparent table is a table that stores data directly. You can read these tables directly on the
database from outside SAP with for instance an SQL statement. Transparent table is a one to one
relation table i.e. when you create one transparent table then exactly same table will create in data
base and if is basically used to store transaction data.
A clustered and a pooled table cannot be read from outside SAP because certain data are clustered
and pooled in one field. One of the possible reasons is for instance that their content can be
variable in length and build up. Database manipulations in ABAP are limited as well.
But pool and cluster table is a many to one relationship table. This means many pool table stores in
a database table which is known as table pool. All the pool table stored table in table pool does not
need to have any foreign key relationship but in the case of cluster table it is must. And pool and
cluster table is basically used to store application data.
Table pool can contain 10 to 1000 small pool table which has 10 to 100 records.
But cluster table can contain very big but few (1 to 10) cluster table.
For pool and cluster table you can create secondary index and you can use select distinct, group for
pool and cluster table. You can use native SQL statement for pool and cluster table.

Views:
Data for an application object is often distributed on several database tables. A database system
therefore provides a way of defining application-specific views on data in several tables. These are called
views. Data from several tables can be combined in a meaningful way using a view (join). Information can
be kept hide that is of no interest to projection or only display those data records that satisfy certain
conditions (selection).The data of a view can be displayed exactly like the data of a table in the extended
table maintenance.
Given two tables TABA and TABB. Table TABA contains 2 entries and table TABB 4 entries. The tables
are first appended to one another. This results in the cross-product of the two tables, in which each
record of TABA is combined with each record of TABB.

Created by: Ranjit K Page 6 12/9/2023


SAP ABAP Dictionary

Usually the entire cross-product is not a meaningful selection. You should therefore limit the cross-
product with a join condition. The join condition describes how the records of the two tables are related.
In our example, Field 3 of TABB identifies Field 1 of TABA. The join condition is then: TABA - Field 1 =
TABB - Field 3With this join condition, all the records whose entry in Field 1 is not identical to the entry in
Field 3 are removed from the cross product. The column for Field 3 in the view is therefore unnecessary.

Structure of a VIEW:

Often some of the fields of the tables involved in a view are of no interest. You can explicitly define the
set of fields to be included in the view (projection). The set of records that can be displayed with the view
can be further restricted with a selection condition. In our example, only those records with value 'A' in
Field 4 should be displayed with the view. A selection condition therefore can also be formulated with a
field that is not contained in the view. The join conditions can also be derived from the existing foreign
key relationships. Copying the join conditions from the existing foreign keys is supported in the
maintenance transaction. The field names of the underlying table fields are normally used as field names
in the view. However, you can also choose a different field name. This is necessary for instances if two
fields with the same name are to be copied to the view from different tables. In this case you must
choose a different name for one of the two fields in the view. Selection with a database view, however, is
usually more efficient than selection with a nested SELECT statement. A view has type character and
can be accessed in programs like all other types and can be used to define data objects.

Created by: Ranjit K Page 7 12/9/2023


SAP ABAP Dictionary

Database VIEWS:

A database view is defined in the ABAP Dictionary and automatically created on the database during
activation. Accesses to a database view are passed directly to the database from the database interface.
The database software performs the data selection. If the definition of a database view is changed in the
ABAP Dictionary, the view created on the database must be adjusted to this change. Since a view does
not contain any data, this adjustment is made by deleting the old view definition and creating the view
again in the ABAP Dictionary with its new definition. The maintenance status defines whether you can
only read with the view or whether you can also write with it. If a database view was defined with more
than one table, this view must be read only. The data read with a database view can be buffered. View
data is buffered analogously to tables. The technical settings of a database view control whether the view
data may be buffered and how this should be done. The same settings (buffering types) can be used
here as for table buffering. The buffered view data is invalidated when the data in one of the base tables
of the view changes.

INCLUDES in database VIEWS:

You can include entire tables in database views. In this case all the fields of the included table become
fields of the view (whereby you can explicitly exclude certain fields). If new fields are included in the table

Created by: Ranjit K Page 8 12/9/2023


SAP ABAP Dictionary

or existing fields are deleted, the view is automatically adjusted to this change. A new or deleted field is
therefore automatically included in the view or deleted from it. If an append structure is added to a table
included in a view, the fields added with the append structure are automatically included in the view. To
include a table in a view, you must enter the character '*' in field View field in the view maintenance, the
name of the table to be included in the field Table and the character '*' again in the field Field name. If
you do not want to insert a field of the included table in the view, you must enter a '-' in field View field,
the name of the included table in field Table and the name of the field to be excluded in field Field name.
Fields of the base tables of a database view can be included in the view without modifications using an
append view. This is analogous to enhancing a table using an append structure. An append view is
assigned to exactly one database view. But more than one append view can be created for a database
view.

Maintenance VIEWS:

Data that is distributed on more than one table often forms a logical unit, called an application object. You
should be able to display, change and create the data of such an application object together. Users
usually are not interested in the technical implementation of the application object, such as the
distribution of the data on several tables. You can maintain complex application objects in a simple way
using a maintenance view. The data is automatically distributed on the underlying database tables. All
the tables used in a maintenance view must be linked with a foreign key. This means that the join
conditions are always derived from the foreign key in the maintenance view. You cannot enter the join
conditions directly as in a database view. A maintenance interface with which the data of the view can be
displayed, changed and created must be generated from the definition of a maintenance view in the
ABAP Dictionary. When the maintenance interface is created, function modules that distribute the data
maintained with the view on the underlying tables are automatically generated. The maintenance
interface is generated with the Transaction Generate Table View (Transaction SE54) or from the view
maintenance screen with Utilities -> Tab.maint.generator.

Created by: Ranjit K Page 9 12/9/2023


SAP ABAP Dictionary

Types:
Types are used in ABAP programs. The structure of a type can be defined globally in ABAP programs.
Changes to a type automatically take effect in all the programs using the type.
You can define any user-defined types in the ABAP Dictionary. These can be used in the ABAP program
to define data objects and types analogously to types that are predefined in the ABAP program (such as
C or I) or types that are defined locally in ABAP programs. The following type categories can be defined
in the ABAP Dictionary:
Data elements (elementary types): Elementary types have no structure. They describe the data type
attributes (such as given Dictionary data type, number of places) and information that is relevant for the
screen (such as title) of unstructured data objects (variables/fields).
Structures (structured types): Structured types describe the structure and functions of any structured data
objects that is of data structures with components of any type. A component can be a field with an
elementary type or can itself be a structure. A table can also be used as a component in a structure. A
database table always has a structure and is therefore implicitly a structured type. However, the fields of
a database table can only have an elementary type.
Table types: Table types describe the structure and functions of internal tables in the ABAP program.
Their rows can have any row type. Table types with elementary row type therefore can be defined just the
same as multi-dimensional table types (table types with a table type as row type) or table types using
structures with table-like components.
The options for creating types with structured types and table types can be combined as required. In this
way you can define any complex types globally in the ABAP Dictionary and use them in ABAP programs.
The runtime object of the Dictionary type (nametab) is the interface for their use in ABAP programs. The
runtime object permits very efficient access to the relevant information for the type in compressed form.
The central definition of types that are used more than once in the ABAP Dictionary allows them to be
changed centrally. These changes are made at all the relevant locations by the active ABAP Dictionary.
For example, ABAP programs adjust to the changed type definitions when they are recreated. When a
type is changed, all the objects (e.g. types or tables) that use this type are automatically adjusted to the
change at activation. All Dictionary types lie in a common namespace. A data element, for example,
therefore may not have the same name as a structure. However, a type defined in an ABAP program and
a Dictionary type may have the same name. The following shadowing rule is valid when using types in
ABAP programs: If the names are identical, the local types shadow the types of the type groups and the
types defined globally in the Dictionary.

Created by: Ranjit K Page 10 12/9/2023


SAP ABAP Dictionary

Lock Objects:
Lock Objects are used to synchronize access to the same data by more than one user. Function modules
that can be used in application programs are generated from the definition of a lock object in the ABAP
Dictionary.
Structure of Lock Object:

To set locks, you must perform the following steps:


1. You must define a lock object in the ABAP Dictionary. The name of the lock object should begin with
E.
2. The function modules for requesting and releasing locks which are created automatically when the lock
object is activated must be linked to the programming of the relevant online transactions

Lock objects are use in SAP to avoid the inconsistency at the time of data is being insert/change into
database. SAP Provide three types of Lock objects.
Read Lock (Shared Locked): Protects read access to an object. The read lock allows other transactions
read access but not write access to the locked area of the table.
Write Lock (exclusive lock): Protects write access to an object. The write lock allows other transactions
neither read nor write access to the locked area of the table.
Enhanced write lock (exclusive lock without cumulating): Works like a write lock except that the enhanced
write lock also protects from further accesses from the same transaction.

Created by: Ranjit K Page 11 12/9/2023


SAP ABAP Dictionary

You can create a lock on a object of SAP through transaction SE11 and enter any meaningful name start
with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not
allow to any other user to open the same object in change mode. Example: in HR when we are enter a
personal number in master data maintenance screen SAP can't allow to any other user to use same
personal number for changes.
When you create a lock object System automatically create two function module.
1. ENQUEUE_<Lockobject name>. To insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

Domains:
Different fields having the same technical type can be combined in domains. A domain defines the value
range of all table fields and structure components that refer to this domain. A domain defines a value
range. A domain is assigned to a data element. All table fields or structure components that use this data
element then have the value range defined by the domain. The relationship between the field or
component and the domain is thus defined by the data element of the field or component. Fields or
components that refer to the same domain (with the assigned data elements) are also changed when the
domain is changed. This ensures that the value ranges of these fields or components are consistent.
Fields or components that are technically the same can thus are combined with a reference to the same
domain.

The value range of a domain is defined by specifying a data type and length (and number of decimal
places for numeric data types). A personnel number is defined by the data format NUMC and by
specifying the number of places for this personnel number.
The value range of a domain can be restricted by defining fixed values. If all the fields or components that
refer to the domain should be checked against a certain table, this table can be defined as the value table
of the domain. Output attributes can also be defined for all the fields or components that refer to the
domain. A conversion routine can be assigned to a domain. This conversion routine converts values from
display format to internal format for the fields or components that refer to this domain.

Created by: Ranjit K Page 12 12/9/2023


SAP ABAP Dictionary

Search Help:
The input help (F4 help) is a standard function of the R/3 System. The user can display the list of all possible input values
for a screen field with the input help. The possible input values can be enhanced with further information. This is
meaningful especially when the field requires the input of a formal key. A user calls an input help with the following steps
(some steps can be omitted, depending on the definition of the input help):
The user starts the input help to display the possible input values for a field (search field) in a screen template.

The system offers the user a number of possible search paths.

The user selects one of these search paths.

Each search path offers a number of restrictions to limit the number of possible input values.

These values are offered in a Dialog box for value restriction when the search path is selected.

The user enters restrictions if required and then starts the search.

The system determines the values that satisfy the entered restrictions (hits) and displays them as a list (hit list).

The user selects the most suitable line from the hit list by double-clicking.

The value of the search field is returned to the screen template (possibly together with other values).

Difference between a check table and a value table


Value Table: This is maintained at Domain Level. When ever you create a domain, you can enter
allowed values. For example you go to Domain SHKZG - Debit/credit indicator. Here only
allowed values are H or S. When ever you use this Domain, the system will force you to enter
only these values. This is a sort of master check. To be maintained as a customization object.
This means that if you want to enter values to this table you have to create a development
request & transport the same.

Check table: For example you have Employee master table & Employee Transaction table. When
ever an employee Transacts we need to check whether that employee exists, so we can refer to
the employee master table. This is nothing but a Parent & Child relationship. Here data can be
maintained at client level, no development involved. As per DBMS what we call foreign key table,
is called as check table in SAP.
There is 1 more important Difference in Value Table and Check Table is that:
The contents of the check will be used as an input help (F4 Help) for a particular field on which a
check table is assigned. But the contents of Value Table are never used in Input Help.

The Hierarchy which decides from where to use the Input Help is:
1. Input help defined explicitly in ABAP Program or Dialog Module.
2. Input Help Attached to the referenced Database Table field.
3. Using the contents of Check Table as an input helps if neither (1) or (2) help are there.
4. Input help from fixed value or Value range given in Domain.

Created by: Ranjit K Page 13 12/9/2023


SAP ABAP Dictionary

Naming notation
ABAP has a large number of naming conventions for different language elements. Below is a list.
ALV_* Advance list viewer
AS_* Methods that perform type conversions
CHECK_* Check Methods
CH_* Changing Parameters
CL_* Class name
CO_*/C_* Constants
DR_* Data reference
G_* Global variables/data objects
GT_* Global table
GX_* Global Boolean field (X or space)
IF_* Interface
INT_*/IT_ Internal Table
IS_* Methods that return a Boolean value
L_* Indicates the data object is local. Often, before underscore, put a 'type letter' in case of simple type (LC_,LF
etc.)
LC_* Local Constant
LR_* Local Range
LT_* Local Table
LVC_* List Viewer Control
ON_* Event handler
PA_* Parameters
PE_*/EX_* Export parameter
PI_*/IM_* Input parameter
RA_* Ranges/Type Range Of
RE_* Result
RF_* Reference Variable
SET_* Accessors Methods
SO_* Select-Options
ST_* Structure
TA_* Internal Standard Table
TC_* Table Control
TH_* Internal Hashed Table
TP_* Other Variables
TS_* Internal Sorted Table
TT_* Table type
TY_* Types
T_* Variable is a table (T_MY_TABLE_VARIABLE)
X* Source/first data object (e.g. XVBAK)
Y* Destination/second data object (e.g. YVBAK)
WA_* Working Area

ABAP Dictionary FAQ


Created by: Ranjit K Page 14 12/9/2023
SAP ABAP Dictionary

Q: What types of objects can be created in the ABAP Dictionary?


Answer: Tables, Views, Data Elements, Structures, Table Types, Type Groups, Domains, Search Helps,
Lock Objects.

Q: What types of tables can be created in the ABAP Dictionary?


Answer: Transparent Tables, Pooled and Clustered Tables.

Q: Which field differentiates a table from client-dependent and client-independent?


Answer: The MANDT field of the table specifies whether the table is client independent or not.

Q: What is the difference between Pooled tables and Cluster tables?


Answer: Cluster tables and Pooled tables have many to one relationship with the underlying database. A
table pool corresponds to a table in the database in which all records from the pooled tables assigned to
it are stored. Several logical data records from different cluster tables can be stored together in one
physical record in a table cluster. A pooled table cannot have the name having more than 10 characters.
All the key fields of the pooled table must be of character data type. In pooled tables, the maximum
length of the key field/data fields should not exceed the length of varkey/vardata of the pool respectively.
In cluster table the records having the same key are stored in a single key in the cluster. If there is an
overflow of the data records a continuation record is created with the same table key.

Q: What is the difference between Database tables and Views?


Answer: The Table has a physical storage of data whereas views do not have physical storage of data.
The view is derived from one or more tables which are created only with the required fields from the
database table(s). It can also be created with table inner joins and specifying conditions for data retrieval.

Q: What are the different types of Views?


Answer: Projection view - Just retrieves some fields from a single table.
Help View - This is used for search help.
Database View - This is inner join view of one or more tables
Maintenance View - Helps in creating maintaining data of the application object. The data can be
distributed among several tables.

Q: All the views can be used in the ABAP program?


Answer: No. Only projection view or database view can be used in ABAP program.

Created by: Ranjit K Page 15 12/9/2023


SAP ABAP Dictionary

Q: What is Table Maintenance Generator?


Answer: The Table Maintenance Generator is used to create table maintenance program to add, modify
or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using
the menu Utilities->Table Maintenance Generator.

Q: What is one step, two steps in Table Maintenance Generator?


Answer: This specifies the screens to be created in the Table Maintenance Program.
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one
screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the
key fields in the first screen and can further go on to edit further details.

Q: How database tables are activated after making changes to it?


Answer: After making changes to the tables, in order to reflect the changes go to transaction SE14 and
Choose Edit and then choose Activate and Adjust Database.
OR
It can be activated from the SE11 also.

Q: In which table are the programs stored in?


Answer: The programs are stored in the table TADIR and the development class packages in TDEVC.

Q: What is the difference between INSERT and MODIFY?


Answer: Whenever you need to create new records in the database table use INSERT. Whenever using
INSERT be sure that a duplicate entry having the same values for the primary key fields are not present.
Else it may throw a dump. When you use MODIFY it makes a check for the matching key field values. If
present it modifies the matching record, else it creates a new record in the database table.

Q: How index is created on a database table?


Answer: Go to transaction SE11, open your database table. Choose the menu, Go to->Indexes to create
index. Give your index name and choose the fields of the table. Be careful, an additional index may
vanish with the next upgrade or hot package.

Q: What is the difference between Check Table and Value Table?


Answer: The Check Table is the dependent table to which the relationship is defined using foreign keys.
The contents of the check table field are shown in the input help for the referenced field.
The Value table is the table attached to a field at the domain level, where the entry to the field can be
only from the value table. They are not used in the Input Help.

Created by: Ranjit K Page 16 12/9/2023


SAP ABAP Dictionary

Q: When Value table becomes check table?


Answer: while establishing foreign key relation between check table and foreign key table if at the domain
level value table is provided then the system will propose that value table as check table if you accept
this proposal then value table will becomes check table.

Q: What is the difference between Domain and Data Elements?


Answer: The Domain specifies the Technical attributes of the field such as the data type, length and the
value range. The data element is an elementary type defining the description/text for the field when
displaying on the screen and Parameter ID.

Q: What is the need of reference table and reference field in Currency/Quantity fields?
Answer: The reference table and reference field are the fields which specify the currency key or Unit of
Measure. Suppose if the user specifies a currency amount say 1000$, the currency amount field would
indicate the amount 1000 and the currency key indicates that the currency specified is in Dollars.

Q: How to add new fields in standard table?


Answer: Create Z-Structure with the fields needed and append the structure to the standard table by
using the option append structure within table display. We can enhance the standard tables by using
Append structures and customizing includes. Append structures allows to attach fields to a table without
actually having to modify the table itself. Table enhancements using append structures therefore do not
have to be planned by SAP developers. An append structure can only belong to exactly one table.
In contrast, CI_includes allows using the same structure in multiple tables. The include statement must
already exist in the SAP table or structure. Table enhancements using CI_includes do, however, have to
be planned by SAP developers.

Created by: Ranjit K Page 17 12/9/2023

You might also like