Professional Documents
Culture Documents
Sap Abap Dictionary
Sap Abap Dictionary
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
- 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.
- 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.
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.
- 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.
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.