Вы находитесь на странице: 1из 10

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

1. Tables - Transparent Table, Pooled Table, Clustered Table


2. Views - Database View, Projection View, Maintenance View, Help View
3. Data Types -Data Elements, Data Structures,Table Types
4. Type Groups
5. Domains
6. Search Helps
7. Lock Objects
8. Matchcodes

back to top

What types of tables can be created in the ABAP Dictionary?


• Transparent Tables: Exist with the same structure both in dictionary and in database exactly with the same data
and fields.
• Pooled Tables: These are logical tables that must be assigned to a table pool when they are defined. Pooled tables
are used to store control data. Several pooled tables can be combined in a table pool. The data of these pooled
tables is then sorted in a common table in the database. The basic idea of the table pool is the storage of data
records from the tables defined in ABAP dictionary that are not dependent on one another. Intersection of key
fields of the tables which are combined is empty. Example - RFCDOC
• Cluster Tables: Cluster tables are logical tables that must be assigned to a table cluster when they are defined.
Cluster tables can be used to store control data. They can also be used to store temporary data or texts, such as
documentation. The idea of cluster tables is that you store functionally dependent data which is divided among
different tables in one database table. Accordingly, the intersection of the key fields of the cluster tables is formed
by the key of the table cluster(cluster key). Exaple - CDPOS

Check this link for more info:-


http://help.sap.com/saphelp_nw70/helpdata/EN/4f/991f82446d11d189700000e8322d00/frameset.htm

back to top

Which field differentiates a table from client-dependent and client-independent?

Client-dependent tables contains a column of type CLNT as the first key field. This field is often named MANDT
(and less often CLIENT). Client-independent tables do not have this field. These last can be accessed from any
client unlike client-dependent tables.
Full Size

When open SQL ABAP statements apply to a client-dependent table, SAP automatically adds the client selection in
the WHERE clause. For example SELECT * FROM mara WHERE matnr LIKE '1%' will be automatically translated
into SELECT * FROM mara WHERE mandt = sy-mandt AND matnr LIKE '1%' (where sy-mandt is the
client where the program runs). If you try to do client selection yourself, it is ignored, except if you add the CLIENT
SPECIFIED keyword.

back to top

What is the difference between pooled tables and cluster tables?

Cluster tables and Pooled tables have many to one relationship with the underlying database.
A table pool or table cluster should ideally be used for storing control information such as screen number
sequences, small program data and documentation. Data used for business transactions should be stored in
transparent tables

A table pool corresponds to a table in the database in which all records from the pooled tables assigned to it are
stored.
Several logical data records from different cluster tables can be stored together in one physical record in a table
cluster.

• A pooled table cannot have the name having more than 10 characters.
• All the key fields of the pooled table must be of character data type.
• In pooled tables, the maximum length of the key field/data fields should not exceed the length of varkey/vardata
of the pool respectively.
• Pooled tables have 2 key fields tabname(Holds the name of pooled table, its CHAR of length 10) and
varkey(Contains all key fields of the corresponding table ,its CHAR max length 110). Tabname and varkey are used
to retrieve data.
• They also have Dataln(Contains length of the content in the field,its INT2 type) and Vardata (This is where actual
data of a field is stored)
• In cluster table the records having the same key are stored in a single key in the cluster.
• If there is an overflow of the data records a continuation record is created with the same table key.
Detailed information on pooled and cluster table can be found at
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm
Full Size

A cluster table has the following structure:

Field Data type Meaning


CLKEY1 * First key field

CLKEY2 * Second key field

... ... ...

CLKEYn * nth key field

Pageno INT2(5) Number of the continuation record

Timestam CHAR(14) Time stamps


p

Pagelg INT2(5) Length of the string in Vardata

Vardata RAW Contains the entries from the data fields of the assigned cluster tables as a string, max.
length n depends on the database system used

back to top

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.

back to top

What are the different 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.

Check this link for more info:-


http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm

back to top

Can I use all the views in the ABAP program ?

No. You can use only projection view or database view in your ABAP program.

back to top

What is Table Maintenance Generator?

The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in
the database table.A database table can be manipulated by a program or manually.
In SE11 under delivery and maintenance if 'Table maintenance allowed' is selected . We can manually enter
entries using SE16 or table maintenance generator screen.
This can be accessed using transaction SE54 or SM30 (Maintain Table Views Initial screen) in SE11 using the
menu Utilities->Table Maintenance Generator.

back to top

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.

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.

back to top

How do you activate the database table after making changes to it?

After making changes to the table, in order to reflect the changes go to transaction SE14 and Choose Edit and
then choose Activate and Adjust Database.

OR

You can directly activate it from the SE11. Goto Utilities-> Database Object -> Database Utility -> Activate and
Adjust Database.

back to top

In which table are the programs stored in?

The programs are stored in the table TADIR and the development class packages in TDEVC.

back to top

I have recently added a few fields to a custom table. But I don't get these fields in the table
maintenance program?

You have to delete and recreate your own existing table maintenance program to see your new fields.

I had faced similar problem, I re-generated the view maintenance and I could see newly added fields in the
maintenance program.

back to top

What is the difference between INSERT and MODIFY?

Whenever you need to create new records in the database table use INSERT. Whenever using INSERT be sure that
a duplicate entry having the same values for the primary key fields are not present. Else it may throw a dump.

When you use MODIFY it makes a check for the matching key field values. If present it modifies the matching
record, else it creates a new record in the database table.

Possible syntaxes for INSERT:

• INSERT INTO dbtab VALUES wa


• INSERT dbtab FROM wa
• INSERT dbtab FROM TABLE itab
Possible syntaxes for MODIFY:
• MODIFY dbtab FROM wa
• MODIFY dbtab FROM TABLE itab

back to top

What is the difference between Modify and Update?

Update will update the existing records in the table. Whereas Modify will modify/update the existing records and if
the record is not found then the record will be inserted.
Possible syntaxes for UPDATE:

• UPDATE dbtab SET column1 = field1 [column2 = field2, etc.] WHERE logexp
• UPDATE dbtab FROM wa
• UPDATE dbtab FROM TABLE itab

back to top

How do I create index on a database table?

Go to transaction SE11, open your database table. Choose the menu, Goto->Indexes to create index. Give your
index name and choose the fields of the table. Be careful, an additional index may vanish with the next upgrade
or hotpackage.

back to top

What is the difference between Check Table and Value Table?

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.

If you use a check table to check values, only data that is stored in database tables is used in the check. If the
allowed values are restricted due to inheritance or dependencies while you are classifying an object, these
restrictions are not checked.

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.

When you define a domain that all the table fields or structure components referring to this domain should be
checked against a certain table. This information can be stored in the domain by entering a value table.

The basic difference between value table and check table is check table can be used as a input help for a field on
which check table is assigned. Value table contents are never used for input help.

back to top

When Value table becomes check table?

While establishing foreign key relation between check table and foreign key table if at the domain level value
table is provided then the system will propose that value table as check table if you accept this proposal then
value table will becomes check table.

back to top

What is the difference between Domain and Data Elements?

The Domain specifies the Technical attributes of the field such as the data type, length and the value range.

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 .
A Reference Type defines the types of reference variables in ABAP programs.back to top

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.

back to top

What is the need of reference table and reference field in Currency/Quantity fields?

The reference table and reference field are the fields which specify the currency key or Unit of Measure. Suppose
if the user specifies a currency amount say 1000$, the currency amount field would indicate the amount 1000 and
the currency key indicates that the currency specified is in Dollars.

back to top

Where to find the table of tables?

DD02L is the table which stores all the table names

How to add new fields in standard table ?

Create Z-Structure with the fields needed and append the structure to the standard table by using the option
append structure within table display.

We can enhance the standard tables by using Append structures and customizing includes.

Append structures allow you to attach fields to a table without actually having to modify the table itself. Table
enhancements using append structures therefore do not have to be planned by SAP developers. An append
structure can only belong to exactly one table.

In contrast, includes allow you to use the same structure in multiple tables. The include statement must already
exist in the SAP table or structure. Table enhancements using includes do, however, have to be planned by SAP
developers.

back to top

How to create the Table Maintenance Generator?

After creating the table in the menu click on Utilities -> TMG (or transaction code ). There Enter the authorization
group like &NC&. Enter one existing function group. Give package name. Select the radio button One step if you
want to display entries in one screen or Two step if you want to display entries in two screens. Click on Find screen
numbers button in application tool bar.Select the radio button propose or some thing to assign one screen to your
new TMG. Click on create.

back to top

In which table can we find the Report Source Code?

Table REPOSRC contains the Report Source Code, but it can be correctly read only by READ REPORT abap
statement.

What is the difference between Transparent tables and Pooled tables?

Transparent tables :

• It has a one- to- one relationship with a table in the database.


• Transparent tables are used to hold application data. Application data is the master data or transaction data used
by an application.
• Example of Master data : Material master (MARA)
• Example of transaction data : Purchase orders
• Transparent tables are probably the only type of table we will ever create.
Pooled tables :
• It has many-to-one relationship with a table in the database.
• Used to hold system data, such as System configuration information, or historical and statistical data.
• It is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It
can only hold pooled tables.
• Pooled tables are primarily used by SAP to hold customizing data.
• During initial implementation of the system the data in the customizing tables is set up by a functional analyst.
• A table in the database in which all records from the pooled tables assigned to the table pool are stored
corresponds to a table pool.

A pool has the following structure:

Field Data type Meaning

Tabname CHAR(10) Name of pooled table

Varkey CHAR ( n ) Contains the entries from all key fields of the pooled table record as a string, max. length for n
is 110

Dataln INT2(5) Length of the string in Vardata

Vardata RAW ( n ) Contains the entries from all data fields of the pooled table record as a string, max. length n
depends on the database system used

Ø If a pooled table record is saved, it is stored in the table pool assigned. The name of the pooled table is
written to the field Tabname. The contents of all key fields of the pooled table are written as a string to field
Varkey and the contents of all data fields as a string to field Vardata. The length of the string stored in Vardata is
entered in field Dataln by the database interface.

What is a Data Element?

This defines Field label name and Field Label length.

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.

A reference type defines the types of reference variables in ABAP programs.

What is a Matchcode?

This is just another kind of search help provided by the ABAP Workbench via ABAP Dictionary. It is defined in ABAP
Dictionary. This was replaced by search help from 4.0 above.

Before 4.0 input helps were defined by creating matchcodes and help views, these objects are converted to
search helps with the same name.

An elementary search help can be created by using a matchcode ID. And collective search help is created by
using a matchcode object. When Matchcodes are attached to input fields these attachments are converted to the
collective search helps to the corresponding screen fields.
back to top

What tables contain DDIC objects?

1. TADIR - Directory of Repository Objects


2. DD01L - Domain
3. DD02L - Tables
4. DD03L - Table Fields
5. DD04L - Data Elements
6. DD06L - Pool/Cluster structures
7. DD07L - Fixed values for Domains
8. DD08L - Relationship definitions
9. DD09L - Technical Settings of tables
10. DD12L - Secondary Indexes
11. DD23L - Matchcode Objects
12. DD25L - Aggregate Header (Views, MC Objects, Lock Objects)
13. DD30L - Search Helps
14. DD40L - Table types (internal tables defined in DD)

back to top

What are Lock Objects?


• A R/3 system allows multiple users to access the same object at a given point of time by lock mechanism. When
one person is editing the program/transaction these locks are set and released accordingly by function modules.
These function modules are generated automatically by the Lock Object definition in ABAP dictionary.
• For more info refer to this
link: http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

back to top

What is significance of table maintenance attribute?

This attribute of table maintenance decide about whether table records can be created or not using table
maintenance generator or whether the entries can be viewed only.This attribute donot have effect on
program.Programmatically one can create entries in table having any value for this attribute
back to top

Where to find the relationships between different database tables ?

Database Tables like DD08L provide the information about the relationships between different database tables.