SE11-Data Dictionary is a central source for data in data base management system. Its main function is to support the creation and
management of data definitions.
Following are the objects in the data dictionary:
3. Data type (Data Element, Structure, Table Type)
5. Type group
6. Search Help
7. Lock Objects
Data base tables are 3 types.
1. Transparent Tables
2. Pooled Tables
3. Clustered Tables.
1. Transparent Tables
Transparent table has the same name and same no of fields in the Database as well as in the Data dictionary.
For each transparent table in the dictionary there is one associated table in the database.
It has one to one relationship with the table in the Data base.
2. Cluster tables
Cluster table has Many to One relation ship with the data base table. It is nothing but group of fields
from different transparent tables and all are combined base on Primary Key. It follows Binary Search.
3. Pooled tables
Pooled table has Many to one relation ship with the data base table. It is similar to the cluster table ,
the only difference is it cannot maintain the Primary key. It follows Linear Search.
Types of data in DB Tables:
1. Configuration data – It never changed it is permanent. Tables start with ‘T’.
2. Master data. – Has little chance to change data. ex.. MARA,KNA1,LFA1….
3. Transaction data – very frequently change data. ex.. EKKO,EKPO,VBAK,VBAP….
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.
A table definition in the ABAP dictionary contains the following components:
Table fields – define the field names and datatypes of the fields contained in the table
Foreign Keys – Define the relationships between the tables
Technical Settings – Control how the table should be created in the database.
Technical settings will have Local Storage Parameters and Buffering.Local storage parameters consists of Dataclass and size category. Data class is the physical area or table space where the tables has to be stored in database. Size category defines the expected space required for the table in the database.
APPL0 Master data, Transparent tables
APPL1 Transaction data, Transparent tables
APPL2 Organization and customizing data
USER Customer data class
Size Category No of data records of table expected
0 0 to 2,600
1 2,600 to 10,000
2 10,000 to 42,000
3 42,000 to 1,70,000
4 1,70,000 to 13,00,000
While creating database table in dictionary we have to fill delivery class,table maintenance and technical settings(explained above).
Delivery class: It defines the type of data that is going to be stored and also it defines the owner of the table and also delivery class controls the transport of table data for installation,upgrade,client copy and when transporting between customer systems.
Table maintenance allowed should be given.
Domain: It is used to define technical attributes(datatype and length) and the value ranges(fixed values and intervals).
Dataelement: Information about the meaning(description) of a table field or structure is defined here.
Most used Data types are CHAR(character string),CLNT(client),CUKY(currency key),CURR(currency field),DATS(Date field),INT1(1 byte integer),INT2(2 bytes integer),INT4(4 bytes),LANG(Language key),NUMC(character string with only digits),QUAN(Quantity field),UNIT(unit key for QUAN),TIMS(time field),VARC(Long character string),STRING(character string of variable length)
Hope you understood what is data dictionary and what it contains..now just create a transparent table in DDIC.
Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
The data of a view is derived from one or more tables, but not stored physically. The simplest form of deriving data is to mask out one or more fields from a base table (projection) or to include only certain entries of a base table in the view (selection). More complicated views can comprise several base tables, the individual tables being linked with a relational join operation.
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.
Database views are implemented with an equivalent view on the database.
Projection views are used to hide fields of a table (only projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data distributed on several tables for one application object at one time.
Data about an application object is often distributed on several database tables
A database view is automatically created in the underlying database when it is activated.
Application programs can access the data of a database view using the database interface. You can access the data in ABAP programs with both OPEN SQL and NATIVE SQL. However, the data is actually selected in the database. Since the join operation is executed in the database in this case, you can minimize the number of database accesses in this way. Database views implement an inner join (see Inner and Outer Join).
Projection views are used to hide fields of a table.
A projection view contains exactly one table. There is no corresponding object in the database for a projection view. Access to a projection view is mapped by the SAP System onto the corresponding access to its base table. It is also possible to access pooled tables or cluster tables with a projection view.
You have to create a help view if a view with outer join is needed as selection method of a search help.
The selection method of a search help is either a table or a view. If you have to select data from several tables for the search help, you should generally use a database view as selection method. However, a database view always implements an inner join. If you need a view with outer join for the data selection, you have to use a help view as selection method.
All the tables included in a help view must be linked with foreign keys. Only foreign keys that have certain attributes can be used here (see Restrictions for Maintenance and Help Views). The first table to be inserted in the help view is called the primary table of the help view. The tables added to this primary table with foreign keys are called secondary tables.
Maintenance views offer easy ways to maintain complex application objects.
Data distributed on several tables often forms a logical unit, for example an application object, for the user. You want to be able to display, modify and create the data of such an application object together. Normally the user is not interested in the technical implementation of the application object, that is in the distribution of the data on several tables.
A maintenance view permits you to maintain the data of an application object together. The data is automatically distributed in the underlying database tables. The maintenance status determines which accesses to the data of the underlying tables are possible with the maintenance view.
All the tables in a maintenance view must be linked with foreign keys, that is the join conditions for maintenance views are always derived from the foreign key. You cannot directly enter the join conditions as for database views.
There are some restrictions for the attributes of the foreign keys with which the tables in a maintenance view can be linked.
A standardized table maintenance transaction is provided (SM30), permitting you to maintain the data from the base tables of a maintenance view together.
Maintenance mechanisms, like screens and processing programs, must be created from the view definition with the transaction Generate Table View (SE54). This makes it possible to create easy-to-use maintenance interfaces in a simple manner.
what are search helps and how to create it? clickhere
Structures in ABAP
Structure is a skeletal view of a table. It contains the definition of columns and don’t have any contents. Structure is generally a template based on which a table is created. The basic difference between structure and table is that the structure does not exist at the underlying database system level. Structure exists as definition in the dictionary.
Types of Structures
Append Structure:- It will add Fields to the table from last . we can’t use that structure in another table. An append structure is a structure assigned to just one table. When a table is activated, all append structures for the table are found and appended to the table.Append structures are used to add customer fields to SAP tables and Custom tables also.
Include Structure: Include structures can used by us to add fields into any ztables and SAP tables also. Because in a Ztable we can add fields where ever we want. Include structure can be used more than one time in a table. The same include structure can be included to any no of custom tables.
Difference between structure(table type) and table?
A transparent table equates to a database table, you can use SE11 or SE16 to
view the contents of the table.
A structure is just a grouping of data elements (fields). Structures are not database tables so you can’t view the contents of a structure. You
would use structures within an ABAP program to group data elements of an object. Structures defined like a table and can then be addressed from ABAP programs.Structures contain data only during the runtime of a program.
How to create a structure?