Steps to create the table by using direct method: -
SE11 is a sap TCODE for DATA DICTIONARY.
Execute SE11 in command prompt. it will display like below image.
- Select the radio button data base table.
- Provide the table name which must start with 'z' after that Click on create.
- Provide short description name.
- Provide delivery class as ‘A’. Select the display / maintenance allowed.
- Click on fields tag. Click on predefined type button.
- Provide the field names, data types, lengths and short description.
Field Key Data
type Length Short Description
Eid CHAR 10 Employee ID
Ename CHAR 25 Name of the employee
Eadd CHAR 35 Address of employee
Save the table
(CTRL + S). Check the table (CTRL + F2). Click on technical settings. Select
the data class as APPL 0 & size
category as zero. Save the technical
settings. Click on back. Then activate table (CTRL + F3).
Steps to provide the data to the table directly: -
In the menu
bar click on utilities à table contents à provide the data.
Click on save. Repeat same steps for all employees.
Steps to display the data from table: -
In the menu bar click on utilities à
Table contents display. Click on execute.
Domain: - Domain is the collection of data types & lengths.
Data Element: - Data element is the collection of domain with short description.
Note: - If you select the display maintenance not allowed then display & create integer not possible.
Note: - In the
real time, we never create the data base table by using direct method or
predefined
type. Because, if you want to establish the relation between any two
tables, then you must maintain
the same domain name in both the tables. In
direct method there is no domain concept. So we go
for Data element method.
Domain: - Domain is the collection of data types & lengths.
Data Element: - Data element is the collection of domain with short description.
Steps to create the table by using Data element method: -
Create the employee table by using data element type bottom up approach.
Steps to create the domain: -
- Execute SE11.
- Select the radio button domain.
- Provide the domain name which must be start with 'y' or 'z' by click on create.
- Provide short description.
- Provide the data type & length. Save the domain.
- Check the domain. Activate the domain. Repeat the same steps for all domains.
Steps to create the data element: -
- Execute the SE11.
- Select the radio button Data type.
- Provide the data element name which must be start with 'y' or 'z' Click on create.
- select the radio button Data element Click on enter. Provide short description.
- Provide domain which is already created. Save the data element.
- Check the data element. Activate the data element.
- Repeat the same steps for all the data elements.
Steps to create the table by using data element type (bottom up
approach): -
- Execute SE11.
- Select the radio button database table.
- Provide the table name. Click on create. Provide short description.
- Provide delivery class is ‘A’. Select Display / Maintenance allowed.
- Click on filed tab. Provide the field name, data elements.
Note: - If you get the warning message enhancement category for
table missing then in menu bar click on extras à enhancement category à enter à select the radio
button can be enhancement (char type or numeric) à enter.
Note: - If you want to provide the data directly to the table
then you must select the display maintenance allowed.
Note: - If you select the display maintenance allow with
restrictions, then display only possible. Create records not possible.
Note: - If you select the display maintenance not allowed then display & create integer not possible.
Foreign key: -
DEFINITION : Foreign key is a field
in one table. This is connected to another table via foreign key relationship.
The purpose is to validate the data being entered in one table (foreign key
table) by checking against list of possible values in another table.
EX : If we are maintaining the employee attendance details and employee salary details in two different
tables then the employee id is the primary key for the both the tables. employee attendance table is
the primary table and salary table is Foreign Key table if we need to validate the data which is enter
in salary table by using foreign key with employee attendance table.
Technical requirement to establish the foreign key relationship: -
- The domain of the both fields in both the
tables must be the same.
- The check table field must be the primary.
è Establish the foreign key relation between
employee & salary tables.
Steps to establish the foreign key relation: -
- Execute SE11. Select the radio button Data base Table.
- Provide the foreign key table name. Click on change.
- Select the fields for which field we want establish the foreign key relation.
- Click on foreign key icon under fields tab(the key symbol which is highlighted in above picture.
- Provide the check table name.
- Click on generate proposal.
- Then the system automatically provides the relation between these two tables. Enter. Save, check, activate the table.
No comments:
Post a Comment