Professional Documents
Culture Documents
Abap Dictionary is a central repository where we define and maintain the objects which are
related to database.
Define means creation of objects
Maintenance means changing and deleting the objects.
Database table:
It is an object which stores data in the form of rows and columns.
Each row is called as record, and each column is called as field.
So, to define a table we have to define the fields first.
So, to define a field, we have to specify the below things.
Field = DataElement+Domain
Domain:
It is an object which specifies technical information such as data type and length for a field.
It also specifies sign, lower case, conversion routine, fixed values, and value table.
Data element:
It is an object which specifies semantic information such as field description, field labels
(short, medium, long and heading) for a field.
Advantages of data element and domain:
Reusability: The same data element and domain can be reused by multiple table fields,
instead of creating again and again.
These are also used in creating foreign key relationship, search help, ale-idoc’s.
Key field: A field which is used to identify the record uniquely is called a key field. In a table there
should be at least one key field. We can create ____ number of key fields.
2. Select Domain
4. Click on Create
7. Press enter
1. Go to SE11
2. Select data type
3. Give a name, ex – ‘zcno’
4. Create -> select data element
5. Provide short description
6. Provide domain name as ‘zcno’
7. Press enter
8. Click on field label tab, specify short, medium, long and heading labels
9. Save, check and activate
1. Go to SE11
3. Click on create
4. Provide description
9.
12. Provide the details as data class -> APPL0, size category -> 0
Note: Sometimes we may get unpredictable errors in a table, due to adding or deleting the fields in
a table. To solve the error follow the below steps.
• Go to SE14Provide the table name
Components of a TABLE :
Delivery class:
It specifies the type of the data that stored in a table.
The data can be business data or system data.
Business data means application data (master and transaction data).
The delivery class controls the transport of table data when installing or upgrading, in a client
copy and when transporting between customer systems.
The delivery class is also used in the extended table maintenance.
The following options are available.
Delivery Class ShortText
A Application Table(Master& Transaction Data)
C Customizing Table, Maintenance only Customer, not by SAP
L Table for storing temporary data, delivery report
G,E,S,W System Data
Display maintenance:
It specifies whether the data should only be displayed or it can also be maintained.
Data maintenance means creation, deletion, and changing.
There are 3 options available.
• Display maintenance allowed: Data is displayed and maintained
• Display maintenance not allowed: Data is not displayed and not maintained
• Display maintenance allowed with restrictions: Data is displayed, but maintenance is given only for
some users based on restrictions.
Data class: It specifies the physical area of a table inside the database
Master data: The data which never changes or which changes very rarely is called master data.
Ex: cno, cname, city etc.
Transaction data: The day to day business data or the data which changes every day is called
transaction data.
Ex: customer bank transaction data
Organization data: The data which is related to organization or company like how many
company codes, plants, sales organization etc, is called organization data.
Size category: It specifies the max. number of records that can be stored in a table.
The possible options are available as below.
In the real time we always set size category as ‘0’ OR ‘1’, because we have to use small amount of
memory.
Suppose if the memory is not sufficient the system will automatically assign the same memory area as
per the size category mentioned above.
Buffer/cache memory: It is a temporary memory to store the data. It is mainly used to increase
the system performance.
The functionality of buffer is defined as below.
• The system will check whether the data is available in cache/buffer memory
• If it is available the data will be immediately given back to the table, thereby increasing the system
performance
• Suppose if the data is not available, the request will be sent to database, and the response will be
given back to buffer or cache memory to store a copy for future references
• After the copy is stored then the data will be given back to the table
Buffering options:
• Buffering not allowed: Data is not stored in buffer
• Generic Area: The key field’s data is called generic area. Only generic area data i.e. key fields data
will be stored in the buffer
Log Data Changes: This Checkbox would define whether changes to the data records of the table
are to be logged/recorded or not.
If checkbox is selected, then every change (Update/Delete) to an existing data record is recorded in
the Standard Database Log table DBTABLOG.
CLIENT NUMBER
It is a unique number which is used to provide security to the data at the database level.
In the real time, Based on the client no only, usernames will be created and the access will be
given.
In the real time, normally we use the client number (100,120), (200,220), (300,320).
The field name, data element, and domain for client number is ‘MANDT’.
Include Append
1. This option can be used with both 1.This option is used only by
custom tables and standard. SAP Tables.
2.These Include structure are reusable by 2. These are not reusable.
Multiple tables.
3. Just give Field name as .Include and 3.Click on 'Append Structure' Button
Data Element as Structure Name. To create Structure for add a field.
Ex on include structure:
Step 1: Create a structure by name ‘zaddr’ with fields city, country, postal code
1. Go to SE11Select data typeprovide a name ‘zaddr’
2. Click on create
2. Provide the field name as ‘.include’, data element as structure name zaddr(which is created above)
3. Enter
• So, for every currency and quantity field we have to specify the corresponding units like INR or USD
or EURO etc or KGS or EA or PC etc .
• CURR: It is the data type which is used to store the currency amount or price fields.
• CUKY: It is the data type which is used to store the corresponding units(INR or USD or EURO ) for the
currency fields.
• QUAN: It is the data type which is used to specify the quantity for a material or stock.
• UNIT: It is the data type which is used to specify the units(KGS or EA or PC) for the quantity fields.
Ex on currency/quantity fields:
1. Open any table which is already created.
3. Click on Currency/Quantity fields tab and specify Ref Tab Name and Ref Field Name.
Check table:
A table which stores master data is called a check table.
Foreign Key Table :
A table which is linked with check table for validating its own data is called foreign key table.
Foreign key relation :
A relation between two or more tables for validating the data is called foreign key relation.
Step 1: Create a table by name ‘zcustomers’ with field’s customer number and customer name, also
create some records.
Step 2: Create another table by name zcustomers_bank with fields cno, bankid and bankname.
Step 3: Create the foreign key relation as below
1. Open the table zcustomer_bank
• If, suppose we enter a wrong value for a field which refers this domain, then the system will check
your value with fixed values. If the value is not available, then the system will raise the error message
• This option is only used whenever the number of values are less than 10 or 15
• If the values are more than 15, we go for foreign key relation
2. Add an extra field by name ‘gender’ with data element and domain as ‘zgender’
7. Go to unit testing
VALUE TABLE:
A table name defined at the domain level so that all the table fields will be referring to the domain
will be checked or validated with a single table called as value table.
The main advantage of value table is to automate the system for foreign key relation i.e. the system
will automatically display check table name to generate foreign key proposal.
We should just click on YES button, so that value table is converted as check table.
STEP1 : Create a table zzcustomer with field cno and cname, also create some records
STEP2 : Define the check table name at domain level as below. Now check table is called as value table
1. Go to the domain zcno
2. Click on value range tab
• A pop-up displayed as below with value table to be proposed for check table
Domain properties:
• SIGN: It is used to store the sign of a number, whether it is positive sign or negative sign
• Lower Case: This option is used to store a value in the combination of capital and small letters
• If we don’t want to convert all letters into capital letters, please select lower case option
• Conversion Routine: It is a sub-program or function module which is used to convert a value from
internal format to external format and vice versa
Conversion routine function modules:
• Go to any domain, ex: MATNR
Activating TMG:
• Go to SE80
Unit testing:
• Go to SM30
• Enter customer number, name and country for a single record or bulk amount of records.
Events in TMG:
• Open the table
• Provide the routine name for above event in the second column and press enter
5. Select the event ‘05’ (creating a new record) and provide sub-routine name (sub-program name)
6. Click on Editor.
Assignment
Create a table by name ‘zlfa1’ with vendor number, name, date and user name. Create
TMG and validate the TMG so that date and username automatically saved.