Sei sulla pagina 1di 21

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.

Table 3

Table1 Table2

Customer Customer Invoice Table 4


Master Data

Date Ele1 Data Ele2


Customer No Vendor No
No

Domain
CHAR, 10
Page 1 of 21 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
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 APPEND
Include Structure is used to include the APPEND Structure is used to
structure to a custom Table. Append to the Standard Table.
The Same Structure Can be INCLUDed in The Same APPEND Structure
any no of Custom Tables Cannot be APPENDed in more
than One Standard Database
Table.
To INCLUDE it in Custom Table We Need to Create the APPEND
Provide .INCLUDE as Field name and Structure By Opening the Table
Structure name as Field type. 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 21 Prepared By : Ganapati Adimulam


eMAX 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 Reference Data type


Type
AMOUNT CURR CUKY
QUANTITY QUAN UNIT

Note : CURR and CUKY Fields Should be Linked in the Database and Similarly,
QUAN and UNIT Fields.
Now click on the tab .

Provide the same table as Reference


table and Ref.Field as UNITS for
QUANTITY and CURRENCY for
AMOUNT.

Page 3 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
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.

Page 4 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Secondary INDEX :

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 21 Prepared By : Ganapati Adimulam


eMAX 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 21 Prepared By : Ganapati Adimulam


eMAX 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 Codes
b. Countries
c. Unit Of Measurements
d. Purchasing Organizations
e. Customer Master
f. Vendor Master
g. Plant Master Data
h. Company codes
i. Sales Organizations
j. Profit Center Master
k. Cost Center
l. Purchasing inforecord

and also the Transaction Codes to Create the same whereever it is Applicable ?

Meaning Transaction Table Primary Description


Code Key(s)
Cost Center KS01 CSKS KOKRS CONTROLLING
AREA
KOSTL COST CENTRE

DATBI VALID TO

ProfitCenter KE51 CEPC KOKRS Controlling Area


PRCTR Profit Center
DATBI Valid To
Sales TVKO VKORG Sales
Organizations Organization
Company Codes T001 BUKRS Company Code
Countries T005 LAND1 Country Code
Unit Of T006 MSEHI Unit Of
Measurement Measurement

Customer XD01 KNA1 KUNNR Customer


Master Account Number
Vendor Master MK01 LFA1 LIFNR Vendor Account
Page 7 of 21 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

No
Purchasing Org T024E EKORG Purchasing Org
Purchasing Info ME11 Purchasing Info
Record 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.

Page 8 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

16.Explain the below Terms


a) Table Maintenance
b) Data Class
c) Delivery Class
d) 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.

Page 9 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

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:

1. Single Record Buffering


2. Generic Area Buffering
3. 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.

Page 10 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

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.

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 21 Prepared By : Ganapati Adimulam


eMAX 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 21 Prepared By : Ganapati Adimulam


eMAX 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 Pooled Cluster

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.

PT1
PT2
Table Pool One Table will be
created for the Table
PT5
Pool Not for each
PT3 Pooled Table.
PT4

Cluster Table and Table Cluster :-

Page 13 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

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.

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.

CT1
CT2

Table Cluster One Table will be


CT3
created for the Table
cluster Not for each
CT5 Cluster Table.
CT4

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.

Page 14 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Note : CI Includes are available in most of HR Tables.


Table PA0021

Double Click on it to add the


New Fields.

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.

Page 15 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

By stipulating a value table.

Fixed Values
&
Intervals

Value
Table

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 : ALPHA
CONVERSION_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.

Page 16 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Note2 : The Lock Object name Should start with ‘E’.

26.What types of objects can be created in the ABAP Dictionary?


Tables
Views
Data Elements
Structures
Table Types
Type Groups
Domains
Search Helps
Lock Objects

27.What are the check tables and value tables?

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)

Page 17 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

You can directly activate it from the SE11 -> Utilities ->Database Utility->Activate
and Adjust Database.
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 ?

Table Short text


DD02L SAP Tables

DD02T SAP Table Texts


DD01L Domains
DD01T Domain texts

DD03L Table Fields


DD03T Texts for fields (language
dependent)
DD04L Data elements
DD04T Data element texts

DD05S Foreign key fields

Page 18 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
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 Length


Vendor Number Char 10
Bank Country Key Char 3
Bank Key Char 06
Bank Acc. No Char 12
Name of the Char 35
holder

2.Create the above table using data element and domains.


3.Create a database tables using the following fields, make use of
INCLUDE structure for the common fields.

Table 1 Table 2 Table 3


LIFNR KUNNR BUKRS CHAR,10
(Vendor No) (Customer No) (Company Code)
NAME1(Name) NAME1(Name) NAME1-Name CHAR,35
ORT01(City) ORT01(City) ORT01-City CHAR,35
ORT02(District) ORT02(District) ORT02-District CHAR,35
STRAS(Street) STRAS(Street) STRAS-Street CHAR,40
LAND1-Country LAND1-Country LAND1-Country CHAR,3

4.Add the below fields to the standard database table T001 by appending the
following fields,

Fields Data Element Description


Website CHAR,30 Website for the company
CEO CHAR,50 CEO of the company

5.Create the table to maintain the Vendor Master Details :

Fields Domain Details Description


LIFNR CHAR,10 Vendor Number
Page 19 of 21 Prepared By : Ganapati Adimulam
eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

NAME1 CHAR,35 Vendor Name


ORT01 CHAR,35 Vendor City
ORT02 CHAR ,30 District
STRAS CHAR,30 Street

Note: LIFNR as the Primary Key.

6. Create the below table to Maintain the Purchase Order Details of the Vendors:

Fields Data Element Description


LIFNR CHAR,10 Vendor No
EBELN CHAR,10 Purchase Order No
NETWR CURR,13 Total Price
WAERS CUKY,5 Currency Key
MENGE QUAN,13 Quantity
MEINS 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 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.
ABAP/Data Dictionary
We Never Compromise in Quality. Would You ?
_______________________________________________________________________
_

Page 21 of 21 Prepared By : Ganapati Adimulam


eMAX Technologies,AmeerPet,Hyderabad
Ph : +91 40 65976727.

Potrebbero piacerti anche