ABAP/Data Dictionary We Never Compromise in Quality. Would You ? ____________________________________________________________ ____________ 1.What is DDIC or ABAP Dictionary ? The ABAP Dictionary centrally describes and manages all the data definitions used in the system. The ABAP Dictionary is completely integrated in the ABAP Workbench. I.e All the other components of the Workbench can actively access the definitions stored in the ABAP Dictionary. The ABAP Dictionary supports the definition of user-defined types (data elements, structures and table types). You can also define the structure of database objects (tables, indexes and views) in the ABAP Dictionary. These objects can be automatically created in the database with this definition. 2.Explain the Domain,Data element and the Advantages ? Domain:- It is used to define the Technical Attributes (Data Type and Length) and the Value Ranges (Fixed Values and Intervals). A domain is assigned to a data element. All table fields or structure components that use this data element then have the value range defined by the domain. Data Element:- A Data Element describes either an elementary type or a reference type. An elementary type is defined by the built-in data type, length and possibly the number of decimal places. These type attributes can either be defined directly in the Data Element or copied from a domain. Advanages : 1.Reusability of Data type,length,description. Page 1 of 30 Prepared By : Ganapati Adimulam eMAX Technologies,AmeerPet,Hyderabad Ph : +91 40 65976727. Table 3
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
1.What is DDIC or ABAP Dictionary ?
The ABAP Dictionary centrally describes and manages all the data definitions used in the system. The ABAP Dictionary is completely integrated in the ABAP Workbench. I.e All the other components of the Workbench can actively access the definitions stored in the ABAP Dictionary.
The ABAP Dictionary supports the definition of user-defined types (data elements, structures and table types). You can also define the structure of database objects (tables, indexes and views) in the ABAP Dictionary. These objects can be automatically created in the database with this definition.
2.Explain the Domain,Data element and the Advantages ?
Domain:- It is used to define the Technical Attributes (Data Type and Length) and the Value Ranges (Fixed Values and Intervals). A domain is assigned to a data element. All table fields or structure components that use this data element then have the value range defined by the domain.
Data Element:- A Data Element describes either an elementary type or a reference type. An elementary type is defined by the built-in data type, length and possibly the number of decimal places. These type attributes can either be defined directly in the Data Element or copied from a domain.
Advanages :1.Reusability of Data type,length,description.
Table1 Table2
Page 1 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
DomainCHAR, 10
Date Ele1Customer No No
Data Ele2Vendor No
Customer Master Data
Customer Invoice
Table 3
Table 4
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
2.To maintain the relationship between the tables. The related fields from each table should have the common domain.
3.What is Primary Key and the Rules regarding the Primary Key in table creation ? Primary key is One or than One Field Combination to Identify the record from the Corresponding Database Table Uniquely.
Rules : Each Table Should have Primary Key.It Should be Data Type CHAR.It Shoul appear as the First Field(at the Beginning of the Table).
4.Can we have more than One primary key in the Same Database table ?
No . But We Can Have More that One Field Combination as Promary Key but not More than One Promary Key.
5.Diffrence between INCLUDE and APPEND structures ?INCLUDE APPENDInclude Structure is used to include the structure to a custom Table.
APPEND Structure is used to Append to the Standard Table.
The Same Structure Can be INCLUDed in any no of Custom Tables
The Same APPEND Structure Cannot be APPENDed in more than One Standard Database Table.
To INCLUDE it in Custom TableProvide .INCLUDE as Field name and Structure name as Field type.
We Need to Create the APPEND Structure By Opening the Table in Display Mode and Click On
APPENDStructure.
6.Can we use the same APPEND Structure in More than One Database Table? No.
7.Why and How to Handle the Currency and Quantity Fields Differently in table Creation ?Working with Currency(Amount) and Quantity fields:
When we are working with international customers and Vendors if you provide only the Amount figure i.e. 1000, but is not enough as it is not clear whether it is 1000 INR,1000
Page 2 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
USD,1000 EUR, 1000 MYR etc. So you have to always provide the currency key(INR,USD etc),when we are working with Amounts.
Similarly when we are working with Quantity we have to provide Units of the quantity.
Note : When the Amount Fields are created by using Data type CURR and the Quantity Fields by Using QUAN. Then only the system expects Currency Key(CUKY) as reference for Amount and Units key(UNIT) as reference for Quantity. This is must to create a table with Currency and Quantity fields
Field Name Data Type
Reference Data type
AMOUNT CURR CUKYQUANTITY QUAN UNIT
Note : CURR and CUKY Fields Should be Linked in the Database and Similarly,QUAN and UNIT Fields.
Now click on the tab .
Page 3 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
Provide the same table as Reference table and Ref.Field as UNITS for QUANTITY and CURRENCY for AMOUNT.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
8.Expain the Forign Key , Importance Of Foreign Key , Rules to Define the Foreign Key ?
Definition : It is a field in one table(Foreing key table) that is connected to another table(Check table) via Foreign key relationship and is to validate the data being entered in one table(Foreing key table) with a valid set of values from another table(Check table).
Technical Requirements to create a Foreign Key:-
a. The Domain names of the field in the Foreign Key table and for the field in the Check table should be same.
b. The field in the check table should be Primary Key.
9.Explain the INDEX in DDIC ?
INDEX : We can search a table for data records that satisfy certain search criteria faster using an index.
An delete can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.
The primary index is distinguished from the secondary indexs of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table.
The primary index is created automatically when the table is created in the database.
Secondary INDEX :
Page 4 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
Secondary INDEXes are the Custom(Futher) INDEXs on a table in the ABAP Dictionary.
This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access.
Note :All the counters of carriers at a certain airport are often searched for flight bookings. The airport ID is used to search for counters for such an access. Sorting the primary index is of no use in speeding up this access. Since table SCOUNTER has a large number of entries, a secondary index on the field AIRPORT (ID of the airport) must be created to support access using the airport ID.
Page 5 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
To Create the Secondary INDEX,
Execute SE11 ,Enter the database table name and press Display -> Indexes -> Create Enter index name. Choose Maintain logon language. Enter short description and index fields.Save , Check and Activate .
10.Can we INCLUDE the Nested Structures in the Custom Table ?
NO
11.What is Table Maintenance Generator ?Ans: The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE30 or SE54 or in SE11 using the menu Utilities->Table Maintenance Generator.
12.What is One step, two step in Table Maintenance Generator?
This specifies the screens to be created in the Table Maintenance Program.
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Page 6 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
13.What are the Master Tables and the Primary Key Fields for?
a. Currency Codesb. Countriesc. Unit Of Measurementsd. Purchasing Organizationse. Customer Masterf. Vendor Masterg. Plant Master Datah. Company codesi. Sales Organizationsj. Profit Center Masterk. Cost Centerl. Purchasing inforecord
and also the Transaction Codes to Create the same whereever it is Applicable ?
Meaning Transaction Code
Table Primary Key(s)
Description
Cost Center KS01 CSKS KOKRS CONTROLLING AREA
KOSTL COST CENTRE
DATBI VALID TO
ProfitCenter KE51 CEPC KOKRS Controlling AreaPRCTR Profit CenterDATBI Valid To
Sales Organizations
TVKO VKORG Sales Organization
Company Codes T001 BUKRS Company CodeCountries T005 LAND1 Country CodeUnit Of Measurement
T006 MSEHI Unit Of Measurement
Customer Master
XD01 KNA1 KUNNR Customer Account Number
Vendor Master MK01 LFA1 LIFNR Vendor Account No
Page 7 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
Purchasing Org T024E EKORG Purchasing OrgPurchasing Info Record
ME11 Purchasing Info Record
Currency Codes TCURU WAERS Currency Code
14.What is Type Group ?
We can define data types in a type group in the ABAP/4 Dictionary instead of defining them within an ABAP/4 program.
The type group name in the ABAP/4 Dictionary has a maximum of 5 characters. The Data Type names within type group <typepool> must begin with <typepool> followed by an underscore.
Note : Up to 4.7 EE Version , We Can Create the TYPE Group SE80->Data Dictionary But not from SE11. Where as from ECC 5.0 Version we Can Still Create it through SE11 itself.
Ex : SLIS is Created by SAP to work with all the Datatypes required to Work with ALV.
The types in a type group must be declared in ABAP/4 programs with the TYPE-POOLS command to access the Data types from the TYPE-GROUP.
15.What is Search Help and types Of Search Helps?
Elementary search help is for f4 help and collectice search help is the collection of elementary search helps.
Elementary search helps : defines a search path where we will define the table from which the data has to be read and the selection criteria. Through import and export parameters. Used when we gets the data from a single table. Collective search helps:- Combination of elementary search Helps. When we need to fetch data based on multiple selection criteria’s from More than one tables.
Ex : Search the Customer BY General Data, BY Company Code, BY City etc..
Each One is Elementary Search Help and the Combination is Collective Search Help.
16.Explain the below Termsa) Table Maintenanceb) Data ClassPage 8 of 20 Prepared By : Ganapati Adimulam
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
c) Delivery Classd) Size Category
Table Maintenance : It allows the user to maintain the data manually.
Data Class : The Data class determines in which tablespace (Physical area) the table is stored when it is created in the database.
Size Category : The Size category describes the probable space requirement of the table in the database.
Delivery Class:It Defines the type of the data that is going to be stored and also it defines the owner of the Table and also the delivery class controls the transport of table data for installation, upgrade, client copy and when transporting between customer systems.
17.Explain the Buffering and types Of Buffering ?
Buffering a table improves the performance when accessing the data records contained in the table.
The table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
Only transparent tables and pooled tables can be buffered. Cluster tables cannot be buffered.
The following two points speak against table buffering:
The data read by the application must always be up-to-date. The table data is frequently modified.
Note : The table containing currency exchange rates is updated only once a day, but it is read frequently. Buffering is recommended in this case.
Note : The contents of buffered tables are not always up-to-date in a distributed system. You can bypass the buffer and read the data directly from the database table with the ABAP command "SELECT SINGLE ... BYPASSING BUFFER.
Buffer Types:
Page 9 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
1. Single Record Buffering2. Generic Area Buffering3. Fully Bufferring
Single-record buffering should be selected when :
o For large tables where there are frequent single-record accesses (using SELECT SINGLE
In Single-record buffering Only the records of a table that are really accessed are loaded into the buffer.
Single-record buffering should be used particularly for large tables where only a few records are accessed with SELECT SINGLE. The size of the records being accessed should be between 100 and 200 KB.
Generic Buffering :With generic buffering, all the records in the buffer whose generic key fields match this record are loaded when one record of the table is accessed. The generic key is a part of the primary key of the table that is left-justified.
Page 10 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
In this example, the record highlighted in red is read by a program from table SCOUNTER. If the table is generically buffered, all the records read whose generic key fields (MANDT and CARRID) agree are loaded into the buffer.
Full Buffering :With full buffering, buffering either the entire table is in the buffe or the table is not in the buffe at all. All the records of the table are loaded into the buffe when one record of the table is read.
In this example, a program reads the record highlighted in red from table SCOUNTER. If the table is fully buffered, all the records of the table are loaded into the buffe.
Page 11 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
Note : Tables best suited to full buffering are small, read frequently, and rarely written.
18.What is View and Explain the types of views?
A view is a logical view on one or more tables. A view on one or more tables i.e, the data from a view is not actually physically stored instead being derived from one or more tables. A view can be used to summarize data which is distributed among several tables Types Of Views : Projection view - Just retrieves some fields from a single table. Help View - This is used for search help. Database View - This is inner join view of one or more tables Maintenance View - Helps in creating maintaining data of the application object. The
data can be distributed among several tables.
Page 12 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
19.What are the Different Types Of Data Dictioanary Tables ?
Transparent Table:-
It is used to store application data such as Master and Transactional Data. We always create Transparent tables only.
There is a One to One relationship i.e. for the table in DDIC another table with the same structure and the same name and the same fields will be created in the original Data base.
Pooled Tables and Table Pools :
It should be used exclusively for storing internal control information (screen sequences, program parameters, temporary data, continuous texts such as documentation).
The data from several different pooled tables can be stored together in a table pool.
This is Many to One relationship i.e. for many pooled tables in DDIC only one Data base table will be created in the Data Base.
Cluster Table and Table Cluster :-
It should be used exclusively for storing internal control information (screen sequences, program parameters, temporary data, continuous texts such as documentation).The data from several different cluster tables can be stored together in a table clusters.
Page 13 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
Transparent Pooled Cluster
PT1
PT5
PT2
PT3 PT4
Table Pool One Table will be created for the Table Pool Not for each Pooled Table.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
This is Many to One relationship i.e. for many cluster tables in DDIC only one Data base table will be created in the Data Base.
Note:- All the Tables in the Cluster Tables should have a common Primary Key.
In order to create a custom(userdefined) database table there are TWO types of approaches.
20.What is the max. no. of structures that can be included in a table or structure? Maximum. But not 9, where all the other Materials and Some Websites Says it is 9. (Try yourself Including the Structures in the Custom Table).
21.What are two methods of modifying SAP standard tables?
Append Structures and Customizing Includes.
Append Structure : It is to be Created for the Table for which the additional Fields should be added.
Custom INCLUDE : SAP itself ADD the CI Include In the Table , Which Can be Created by Simply Double Click on it. We Can add the Additional Fields to the Standard Table , Only When SAP Provides CI Include in the Custom Table.
Note : CI Includes are available in most of HR Tables.Table PA0021
Page 14 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
CT1
CT3
CT2
CT5CT4
One Table will be created for the Table cluster Not for each Cluster Table.
Table Cluster
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
22.If a table that is to be extended contains a long field, we cannot use append structures why?
Note : Long fields in a table must always be located in the end.
If a table has an append structure, if it has a Long Field , Make Sure that the Long Field is Last Field in the APPEND Structure . So that we can APPEND the Structure.
Note : When another APPEND structed is Created, it shoud be APPENDed after the previous APPEND, i.e we are going to add new fields after the Long Field, where we are violating the rule that the Long Field should be at the end of the Table.
23.What are the two ways for restricting the value range for a domain?
By specifying fixed values.
By stipulating a value table.
Page 15 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
Double Click on it to add the New Fields.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
24.What are conversion routines?
Non-standard conversions from display format to sap internal format and vice-versa are implemented with so called conversion routines.Ex : ALPHACONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
25.What is Locking,Lock Objects and FMs?
Lock Objects are used to synchronize access to the same data by more than one user. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary
Note1 : Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
Note2 : The Lock Object name Should start with ‘E’.
Page 16 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
Value Table
Fixed Values &
Intervals
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
26.What types of objects can be created in the ABAP Dictionary?
The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown in the input help for the referenced field.
The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the Input Help.
Note : Value table is the Default Check Table.
28.Which field differentiates a table from client-dependent and client-independent?
The MANDT field of the table specifies whether the table is client independent or not.
29.What is the difference between Database tables and Views?
The Table has a physical storage of data whereas views do not have physical storage of data.
The view is derived from one or more tables which is created only with the required fields from the database table(s). It can also be created with table inner joins and specifying conditions for data retrieval.
30.Can I use all the views in the ABAP program ?
No. You can use only projection view or database view in your ABAP program.) How do you activate the database table after making changes to it?
After making changes to the table in DDIC, inorder to reflect the changes in the actual Database, Go to transaction SE14 and Choose Edit and then choose Activate and Adjust Database. (OR)
You can directly activate it from the SE11 -> Utilities ->Database Utility->Activate and Adjust Database.
Page 17 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
31.In which table are the programs,Tables,Development Classess are stored in?
The programs are stored in the table TADIR and the development class packages in TDEVC, Database Tables in DD02L and DD02T(Short Texts).
32.When I create new entries in the table the field values are always in Uppercase. How do I get the data with mixed case?
The reason for this is that the Domain for the field in the table might have Lowercase checkbox unchecked. Check the Lowercase checkbox to preserve the case of your data.
33.What are the Important Tables to store the Definitions of DDIC ?
Page 18 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
Table Short textDD02L SAP Tables
DD02T SAP Table TextsDD01L DomainsDD01T Domain texts
DD03L Table FieldsDD03T Texts for fields (language
dependent)DD04L Data elementsDD04T Data element texts
DD05S Foreign key fields
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
EXERCISE
1.Create database table with the following requirements: (Using Direct Data Type )
Field Description Data type LengthVendor Number Char 10Bank Country Key Char 3Bank Key Char 06Bank Acc. No Char 12Name of the holder
Char 35
2.Create the above table using data element and domains.3.Create a database tables using the following fields, make use of
Page 19 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary We Never Compromise in Quality. Would You ?________________________________________________________________________
Note: LIFNR as the Primary Key.
6. Create the below table to Maintain the Purchase Order Details of the Vendors:
Fields Data Element DescriptionLIFNR CHAR,10 Vendor NoEBELN CHAR,10 Purchase Order NoNETWR CURR,13 Total PriceWAERS CUKY,5 Currency KeyMENGE QUAN,13 QuantityMEINS UNIT,3 Unit Of Measurement
Note: LIFNR and EBELN Combination is the Primary Key.
Note: Maintain the foreign key relationship between the above two tables Based on the Vendor No.
7.Create a projection view for the database table T001.8.Create a database view for the database tables KNA1, KNB1.
Page 20 of 20 Prepared By : Ganapati AdimulameMAX Technologies,AmeerPet,Hyderabad