Wednesday, 5 August 2015

DATA DICTIONARY cont....


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.



  1. Select the radio button data base table.
  2. Provide the table name which must start with 'z' after that Click on create. 
  3. Provide short description name. 
  4. Provide delivery class as ‘A’. Select the display / maintenance allowed
  5. Click on fields tag. Click on predefined type button. 
  6. 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.


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: -


  1. Execute SE11. 
  2. Select the radio button domain. 
  3. Provide the domain name which must be start with 'y' or 'z' by click on create. 
  4. Provide short description. 
  5. Provide the data type & length. Save the domain. 
  6. Check the domain. Activate the domain. Repeat the same steps for all domains.

Steps to create the data element: -

  1. Execute the SE11
  2. Select the radio button Data type
  3. Provide the data element name which must be start with 'y' or 'z'  Click on create. 
  4. select the radio button Data element Click on enter. Provide short description. 
  5. Provide domain which is already created. Save the data element.
  6.  Check the data element. Activate the data element. 
  7. Repeat the same steps for all the data elements.

Steps to create the table by using data element type (bottom up approach): - 

  1. Execute SE11. 
  2. Select the radio button database table. 
  3. Provide the table name. Click on create. Provide short description. 
  4. Provide delivery class is ‘A’.  Select Display / Maintenance allowed
  5. 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: -

  1. The domain of the both fields in both the tables must be the same.
  2. The check table field must be the primary.
è Establish the foreign key relation between employee & salary tables.



Steps to establish the foreign key relation: -



  1. Execute SE11. Select the radio button Data base Table
  2. Provide the foreign key table name. Click on change
  3. Select the fields for which field we want establish the foreign key relation. 
  4. Click on foreign key icon under fields tab(the key symbol which is highlighted in above picture.
  5.  Provide the check table name.
  6.  Click on generate proposal
  7. Then the system automatically provides the relation between these two tables. Enter. Save, check, activate the table.



  

No comments:

Post a Comment