Objects of DDIC

To see the Objects of Data Dictionary go to Tcode : SE11.

Objects of Data Dictionary
  • Domain
  • Data Element
  • Structure
  • Table type
  • Database Table
  • Type group
  • View
  • Search Help
  • Lock Object
Domain

Domain defines A Data type and it's size.Domain = datatype + size.Ex : 'zdomain' is of  'C' Data type and size of '8'.

                   (Click here - How to Create a Domain.)

Data Element
  • By using Data Element we can Provide Fieldlabel for the Specific Field. Field label is nothing but Text Description of  that Field which we can see on the Output screen.
  • Data Element is Combination of Domain and Field Label.
                          (Click here - How to Create a Data Element) 


Structure

Structure is like a skeleton of  Table. Structure cannot store/contain any type of data. a table can be a Structure but Structure cannot be a Table. 

                      (Click here - How to Create a Structure)

Table type

A 'Table type' describes the structure and functional attributes of an Internal table in ABAP.

A Table type is defined by:
  • Its line type - that defines the structure and data type attributes of a line of the internal table the options for managing and accessing the data (access mode) in the internal table.
  • The row type - is defined by directly entering the data type, length and number of decimal places or by referencing a Data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type. 
                             (Click here - How to Create a 'Table Type').


Database Table

Table is a combination of ROWS and COLUMNS in which DATA resides.
Table is combination of Structure and Data.
Table = Structure + Data.
Depending on the type of Data it can hold Tables are classified into 3 parts.
  •         Transparent tables
  •         Pooled Tables
  •         Cluster Tables
In Real time we only Create Transparent Tables. Transparent Table is a Table which can hold Application Data. Application Data is Combination of Master Data and Transactional Data.
  
                       (Click here - How to Create a Database Table)                          (Click here - How to Create Entries to a Database Table)

Type Group

Type group is a fragment of ABAP code which you enter in the ABAP Editor.
Syntax :      Type-pool <name of type group>.
The first statement of the 'Type group' is always  'TYPE-POOL'.

Type groups are based on the 'Include' program technique, It allows you to store any type Definitions globally in the Dictionary by defining them using 'TYPES' statements.

After that, you define data types using the statement TYPES. It is also possible to define global constants using the CONSTANTS statement. All the names of these Data types and constants must begin with the 'Name of the Type group' and an 'underscore'. 

Syntax : (In Data Dictionary SE11.)  
(let us assume Type group name is 'TGRP').














Exampe for a Type Group: 'SLIS' is a Type Group which is used in 'ALV Reporting'

 In an ABAP program, you must declare a Type group with 'TYPE-POOLS'. This statement allows you to use all the data types and constants defined in the Type group in your program. You can use several type groups in the same program.

Syntax :   (In Abap editor - Se38)








       


View

A 'View' is like a Virtual table which contains fields of One or Several Database Tables. A View can be  Created in the Repository browser or in the logical Database builder in the ABAP workbench. A View cannot hold any data Physically, instead of that it provides an application oriented view of one or more tables.

ABAP views can be used by all  programs.In View tables are joined based on Inner-Join Concept.

There are 4 types of Views    
                    
                   1. Database View
                   2. Projection View 
                   3. Maintenance View
                   4. Help View 

 Database View

This is Inner-join of One or More Database tables.

About Data Base View
  • At Least One Relationship(Common field) is Required between tables.
  • No modifications can be Done to the Viewing Data(Read Only Data).
  • Implements on Inner-join logic.

 Projection View

Projection View is used hide unwanted fields of a table while viewing.

About Projection View
  • Used for only One table.
  • Cannot define selection conditions for projection view.
  • Data can be modified(Create, Edit, Insert and Update).
  • We can also access Pooled and Cluster tables with a Projection View.

 Maintenance View

 Maintenance View allows you to maintain the data of an application and Object Data together. All the table in the Maintenance View must be linked with foreign key. Maintenance views are always derived by using foreign key.

About Projection View
  • 'N' number of relations can support.
  • Modifications can be Done.
  • Implements on Outer-Join Logic.

 Help View 

Help view can be used in the Search help as in the 'Selection Method'. we can also provide Database table or database view name there. but suppose if we want to get data as outer join then help view is provided. It uses left Outer join to select the data while database view uses inner join, Means Suppose you have two tables A and B. In help View all the contents of Primary Table will be Displayed.


                      (Click here - How to Create a 'Help View')                   


Search help

Search help is a 'Field help' provided to the user whenever he press a Search help button(F4) in executing an ABAP program. It is a input Help which permits the user to display a list of possible values for a screen field through a popup window that contains all the data related to your Screen field.

There are two types of Search Help    
                    
                   1. Elementary Search Help
                   2. Collective Search Help 

Elementary Search Help   

      Elementary Search help is always Created based on a Single Table.

                 (Click here - How to Create 'Elementary Search Help')

Collective Search Help
         
      Collective Search help is always Created based on more than One Search help.

                  (Click here - How to Create 'Collective Search Help')            
   

Lock Object

Lock objects are used in SAP to avoid the inconsistency at the time of data is being Insert/change into database.

Create the lock object for the required table using SE11. When you create the lock object, two function modules will be created automatically. These two function modules named
ENQUEUE_ and DEQUEUE_  can be called to lock or unlock the table.

By Using 'SM12' we can check the Lock entries.

Types of Lock objects. 

Read Lock (or)Shared Locked (S) :
Protects Read access to an object. The read lock allows other Transactions to read the Table but it will not allow write access to the locked area of  the table.

Write Lock (or) Exclusive lock (E) :
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) (X) :
Works like a write lock except that the enhanced write lock also  protects from further accesses from the  same transaction.

Optimistic Lock (O) :
Behaves Like a Shared lock initially but it can be Converted into Exclusive Locks.
An optimistic lock (mode 0) is set, if the user displays data in change mode. Optimistic locks on the same object cannot collide. If the user wants to save the (changed) data, the optimistic lock has to be converted into an exclusive lock (mode E). (This does not work, if beforehand another user has set a non-optimistic lock on the object). This procedure deletes other optimistic locks on the object.


Example:
The user goes to VA02 to change a sales order, in this program, a lock is set.  You can see such locks in transaction SM12.  If a lock is set,  and another user accesses the same sales order, then they will get a message saying that the 'sales order is locked'.  The 'ENQUEUE 'function module is used to set the lock, the 'DEQUEUE' function module is to release the lock.










No comments: