Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

ABAP DICTIONARY

• ABAP Dictionary, also known as Data Dictionary or DDIC.


• It is a central repository in the SAP system where all the metadata related to
the database objects are stored.
• The DDIC is used to manage and maintain the definitions of the database
objects such as tables, views, structures, data elements, domains, and search.
• Transaction code(T- code) for Data Dictionary is SE11.
• ABAP Dictionary Objects are mentioned below :-

1. Database Table
2. Views
3. Data Type : Data Element/Structure/Table Type
4. Type Group
5. Domain
6. Search Help
7. Lock Object
- Below image shows how the SE11 t-code initial screen looks.
Domain :
o Domain describes the technical attributes of a field/column.
o Technical attributes means data type and length.
o Domains are linked to fields in the table via data elements.
o There are 2 approaches which we can create domain that are :
- Top-down approach : First create domain then data elements followed by
creation of fields in the table by assigning data elements.

Domain

Data
Element

Fields in
the table

- Botton to Top approach : First creating fields in the table by assigning the
data elements which in turn creates domain and data elements by routing
to the data element and domain screen.

Fields in the
table

Data
Element

Domain

o Naming conventions for Domain is DO i.e., ZDO followed by name


where Z and Y are custom namespace.
o Below steps shows Domain creation :
- Click on Domain radio button then give name to the domain and click on
create button.

- Provide short description, data type and no. of characters. Save, Check
and Activate it.

- If you have any fixed value like Credit – C, Debit – D or Net Banking –
N, then mention that in the Value Range.
Data Element :
o Data Element describes the appearance of a field/column to end user.
o It is used to provide a meaningful description like short/medium/long
description to a field.
o Naming conventions for data element is DE i.e., ZDE followed by name.
o Steps to create data element shows below :
- Click on data type radio button, give name and click on create.

- Now it will ask for data element/structure/table type, click on data


element. Click on continue.
- Provide the short description, give the domain name which you have
created, move to field label.

- In field label give short/medium/long description. Save, Check and


Activate it.
Table :
o Table is a collection of rows and columns.
o Tables are the containers which stores data in the form of record.
o Table must have a primary key which is used to identify a record uniquely.
o Naming convention for creating table is ‘ZT’ followed by name.
o Steps to follow for creating a table :
- Click on the database table and provide the name then click on create button.

- Give the short description for the table.


- There are 5 tabs – Attributes, Delivery and Maintenance, Fields, Input Help/Check
and Currency/Quantity fields.
- By default, when you click on create it will open in the Delivery and Maintenance
tab.
- In that tab we have 2 options Delivery class and Maintenance.

- When you click on the f4 help you get to see so many options but
➢ A – Application table
➢ C – Customizing table
➢ L – Table for storing temporary data
- Click on A – Application table( master and transaction data )

- In Data Browser/Table View Editing, there are 3 option and those are :
➢ Display/Maintenance Allowed with Restrictions
➢ Display/Maintenance Allowed
➢ Display/Maintenance Not Allowed
- Click on Display/Maintenance Allowed because after creation of table if any changes
is required then you can change. If you select allowed with restriction then some
restrictions will be there and if you select not allowed then you cannot do any
changes.
- Go to Fields tab, give MANDT for field and data element then name as field and
created data element as the data element and click on enter.
- Tables having MANDT field are called client dependent or client specific tables.
- Tables without MANDT field are called as client independent tables.
- MANDT represents the client number of SAP system.

- Primary-Foreign key relationship is also called as parent-child relationship.


- Primary key of one table acts as a foreign key into another table.
- For primary-foreign key relationship tables must have a common field/column.
- The purpose of primary-foreign key relationship is to achieve the data consistency.
- While maintaining the primary-foreign key relationship, we need to pass the
cardinality.
- Number of records in one table corresponds to number of records in second table for
a particular entry is called as cardinality.
- After that click on Technical Settings and provide Data Class and Size Category.
- Data Class is the part of technical settings of a table.
- Data Class determines in which portion of the database the table data is stored.
- In the data class, widely used data class are as follows :
➢ APPL0 – Master data
➢ APPL1 – Transaction data
➢ APPL2 – Configuration data
- If the table is related to master data, then select APPL0, if it is transaction then select
APPL1.

- Size category is also the part of technical settings of a table.


- The Size category describes the space requirement of the table in the database.
- So select 0.
- Save it, check while checking you may get some warnings, to avoid go to Extras ->
Enhancement Category -> continue -> Can be enhanced( deep ) [ can select any
option ]. And activate it.
- If you are using amount/value field and if you try to activate it, it will not because
amount field requires currency/unit so give that field and table of that field in the
currency/quantity fields tab.
- Now, table is created need to insert data so go to Utilities -> Table contents -> Create
entry.
➢ Enter the data and save it.
- To see the contents which you have entered, you have 2 options in SE11 t-code.
➢ Go to Utilities - > Table contents -> Display.
➢ Click on Content button -> Execute.
- You can see the data in SE16( Data Browser )/SE16n( General Table Display ) where
you have option for creating entries/deleting/modifying also.
- Most importantly, end user/functional will not have any access to SE11/SE16/SE16n
in the production only developers are having, so we need to generate Table
Maintenance Generator( TMG ) where we can maintain CRUD operation in the table.
- To generate this TMG we need to go SE11 t-code -> table name -> Utilities -> Table
Maintenance Generator.
The various objects of TMG environment are as follows :
➢ Authorization Group
➢ Function Group
➢ Maintenance Type
➢ Maintenance Screen No.

Authorization Group : It is used to specify the users who are authorized to maintain
table or view contents. If a table is maintained by a group of people, an authorization
group is assigned else fill the option ‘&NC&’.
Function Group : Here, the name of the function group can be same as that of table/view.
Maintenance type : One step and two step. In case of one step only overview screen is
applicable. In case of two step, both overview screen and single screen are applicable.
Maintenance screen No - Overview screen and single screen. In case of one step, a
screen number is assigned only to overview screen. In case of two step, a screen number
is assigned to both overview screen and single screen.
To generate the TMG , data browser/table view maintenance options needs to be -
display/maintenance allowed.
Important point
Whenever we add new columns/fields to the table after generation of TMG, the newly
added fields do not appear automatically while maintaining data with the help of
SM30.We need to delete the TMG and generate it again.
Deleting the TMG never delete the table data. To delete the TMG, open the table in
change mode, otherwise delete button does not appear.

❖ SAP consists of 3 types of data.


▪ Master data
▪ Transaction data
▪ Configuration data

1. Master data - accessed very frequently but changed very rarely.


2. Transactional data - can change very often and are not constant.
3. Configuration data - is that data which we can customize. Customizing depends on the
business scenario and customer requirements.
Example :
Suppose there is a company ABC. The example of various types of data in the company ABC
are as follows:
1. Master data - Employee data of the company ABC is the example of master data.
2. Transaction data - Various transactions in the company like banking transactions,
revenue transactions are the examples of transaction data.
3. Configuration data - In company ABC, if the employee designation is senior consultant
the vehicle allowance is applicable, if the employee designation is other than senior
consultant then the vehicle allowance is not applicable. This is one of the examples of
configuration data.
Types of Database Tables
There are 3 types of database tables.

- Transparent table
- Pooled table
- Cluster table.
Transparent table :
In case of transparent table, there is 1:1 relationship between the ABAP dictionary and the
database.
Pooled Table :
In case of pooled table, there is N:1(many to one) relationship between the ABAP dictionary and
the database.
For pooled tables, primary-foreign key relationship is not required.
Cluster Table :
In case of cluster table, there is N:1(many to one) relationship between the ABAP dictionary and
the database.
For cluster tables, primary-foreign key relationship is mandatory.

Structure
o Structure is a collection of fields of same data types or different data types.
o There are 3 types of structures in SAP for custom table and 1 type for standard.
Custom table Standard table
- Include - Append
- Append
- Edit
Include Structure:
✓ It is a reusable structure.
✓ We can insert the include structure at any point.
✓ It is applicable to customer specific tables. It is not applicable to SAP specific tables.
✓ It holds one record and number of fields.
Append Structure:
✓ It is not a reusable structure.
✓ It always inserts at the last.
✓ It is applicable to both customer specific and SAP tables.

Edit:
✓ Can use only for custom table not for SAP table.
✓ Can edit anywhere in the custom table.
o Structure does not contain any data i/e., it contains the data only on the run time.
o Structure can be created using any fields from same or different tables.
o We will create a structure by going to transaction SE11 -> clicking on Data Type radio
button -> providing name having naming convention ‘ZS’ followed by name ->
Create -.> Structure -> continue -> provide short description -> add fields which are
required, save, check and activate it.
Table Type:
o Using structure, we will create table type which holds more than one record/no. of
records.
o It will hold the data at the runtime.
o To create table type for a particular structure, go to transaction SE11 -> click on Data type
radio button -> give name( naming conventions are ‘ZTT’ followed by name) -> create -
> Table type -> give structure name, short description.
Views :
o A view is a virtual table – that does not store any data.
o It is a logical database- logical representation of data from one or more table.
o A view combines the data distributed in several tables.
o The difference between table and view is – table has data whereas view does not have any
data.
o Types of views :-
1. Database view
2. Projection view
3. Maintenance view
4. Help view.

1. Database view :
➢ Database view is a collection of one or more database tables.
➢ Database view always implements an inner join.
➢ Pre-requisite : Tables must have a relationship between them.
➢ Steps:
1) Go to SE11 transaction give a name to a View by selecting the radio button – click on create
– select Database view – provide short description – give some table name.

2) click on Relationships – show a table name which has relationship with select and click on
copy.
3) Here, it will show the primary key of both the tables which are in relation. Now, go to View
Fields – click on Table fields – select the 1st table – select the fields – click on copy.

4) Again, click on Table fields – select the 2nd table – fields – copy. Remove the mandt field.
5) Save, check and activate it. If you want to see the contents of the view then, click on the
contents in the view.

2. Projection View :
➢ Projection View is applicable for a single table.
➢ We take only those fields which are required. It means the data that is required is
exchanged when the database is accessed.
➢ Projection view is equal to database view, of the database view also contains
single table.
➢ Steps :
1) Go to SE11 transaction – give a name by selecting view radio button – create
– select projection view – provide short description – in the Basis Table – give
table name/ using search help select table name.
3. Maintenance view:
➢ Maintenance view is used to maintain the multiple tables collectively.
➢ Data is entered by the view and then distributed to the tables.
➢ We need to generate the TMG of the maintenance view.
➢ We can maintain the data through transaction code SM30.
➢ We can do CRUD operations here, but not possible in other views.
➢ Only custom tables can used in this maintenance view not standard tables.
➢ At single shot we can update 2 or more table using maintenance view.
➢ The various pre-requisites of maintenance view are as follows :
- Tables must have a relationship between them.
- Take MANDT field in the view.
- Not more than one record should flow to dependent/secondary table.
➢ Steps :
1) Create 2 custom tables.
2) To assign the foreign key relationship, click on the primary key field in the 2nd table –
click on the foreign key symbol - give table name – automatically filled fields appear –
give cardinality ratio b/w two tables – copy.

3) Create database view – short description – give table name – click on relationships –
select – copy.
4) Go to View Fields – Table fields – select fields from both the tables. Keep MANDT field.

5) Now to generate TMG, utilities – Table Maintenance Generator – authorization group :


&NC& - function group : table name/view name – maintenance type : one step – maint.
Screen no : 1. Save, check, and activate it.
6) To maintain the data, go to transaction SM30 – view name – maintain – new entries.

7) To see the contents in the 1st table, goto contents and execute.
8) To see the contents in the 2nd table, go to contents and execute.

4. Help View :
➢ It is used in search helps.
➢ In help view contents tab is disabled, but when we use help view in search help,
then it display the contents.
➢ The various pre-requisites of help view are as follows:
Tables must have a relationship b/w them.
Not more than one record should flow to dependent/secondary table.
➢ Steps :
1) Create a help view – select custom tables which has relationship.
2) Select fields in the View fields – Table fields. Save, check, and activate it.
3) Now, observe contents tab is disabled. So, whenever we use this help view in
the search help this view contents will be displayed.

You might also like