You are on page 1of 14

Data dictionary questions

Q. Whats the full form of ECC?


Ans: Enterprice Central Component.
Q. Whats the full form of IDES?
Ans: Internet Demonstration and Evaluation System.
Q. Whats the diff. between sap 4.7e and ecc6.0 in ABAP point of view?
Ans: The WS_* function modules used in 4.6c has become obsolete from 4.7C. All the WS_* FMs have been
replaced by GUI_* FMs.
(ii) Concept of Unicode is introduced.
(iii) Few tables have been modified in ECC6.0.
Tables TVARV & TTREX have been replaced by TVARVC & TTREXN respectively.

upto 4.7 we have not maintain unicode ..


after ecc 5.o maintain unicode programming standard.
ABAP Development under Unicode
Prior to Unicode the length of a character was exactly one byte, allowing implicit typecasts or memory-layout oriented
programming. With Unicode this situation has changed: One character is no longer one byte, so that additional
specifications have to be added to define the unit of measure for implicit or explicit references to (the length of)
characters.
Character-like data in ABAP are always represented with the UTF-16 - standard (also used in Java or other
development tools like Microsoft's Visual Basic); but this format is not related to the encoding of the underlying
database.
A Unicode-enabled ABAP program (UP) is a program in which all Unicode checks are effective. Such a program
returns the same results in a non-Unicode system (NUS) as in a Unicode system (US). In order to perform the
relevant syntax checks, you must activate the Unicode flag in the screens of the program and class attributes.
In a US, you can only execute programs for which the Unicode flag is set. In future, the Unicode flag must be set for
all SAP programs to enable them to run on a US. If the Unicode flag is set for a program, the syntax is checked and

the program executed according to the rules described in this document, regardless of whether the system is a US or
a NUS. From now on, the Unicode flag must be set for all new programs and classes that are created.
If the Unicode flag is not set, a program can only be executed in an NUS. The syntactical and semantic changes
described below do not apply to such programs. However, you can use all language extensions that have been
introduced in the process of the conversion to Unicode.
As a result of the modifications and restrictions associated with the Unicode flag, programs are executed in both
Unicode and non-Unicode systems with the same semantics to a large degree. In rare cases, however, differences
may occur. Programs that are designed to run on both systems therefore need to be tested on both platforms.
Other Changes
1.

Bit Statements

2.

Adding Field Sequences

3.

Loops with VARY and VARYING

4.

Creating Subroutines

5.

Saving Programs

6.

Assigning Types for GET/SET PARAMETER

7.

Unreachable Statements

8.

Function Modules with Incorrect Parameter Names

1. Bit Statements
Previously, the system checked for the bit statements SET BIT i OF f [TO g] and GET BIT i OF f [INTO g]whether the
field f is character-type; X fields, X strings, and flat structures are usually regarded as character-type. For Unicode
programs this is no longer useful, because the types X and XSTRING no longer count as character-type and the bit
by bit access to character-type fields or structures is no longer platform-independent. Therefore, with these
operations in Unicode programs, the field f must be type X or XSTRING.
For the bit mask operations f O x, f Z x, and f M x you could previously use all number-type and hence all charactertype types for the left operand f. In Unicode programs, the f operand must now be type X or XSTRING.
2. Adding Field Sequences
When adding field sequences, restrictions apply to the following statements in Unicode:

ADD n1 THEN n2 UNTIL nz [ ACCORDING TO sel ] GIVING m ...


ADD n1 THEN n2 UNTIL nz TO m [ RANGE str ].
1.

The operands n1, n2, and nz must be type-compatible with one another.

2.

The distance between nz and n1 must be an integral multiple of the distance between n2 and n1.

3.

A syntax or runtime error occurs if the fields n1, n2, and nz are not in a structure. This structure must be

recognizable statically or its valid area must be marked explicitly using the RANGE addition.
4.

At runtime, the system ensures that the RANGE area is not left.

ADD n1 FROM i1 GIVING m [ RANGE str ].


1.

Field n1 must be within the structure. The structure must be explicitly defined using the RANGE addition if it is

not recognizable statically.


2.

For this variant, the system also checks at runtime whether n1 and the addressed values are within the

structure.
3. Loops
Loops with the VARY or VARYING addition are also problematic in Unicode, since a type-a access to memory
contents cannot be ensured and memory can be overwritten inadvertently.
DO ... VARYING f FROM f1 NEXT f2.
For this statement, the fields f, f1, and f2 must be type-compatible with each other. To prevent memory contents being
overwritten, a RANGE for valid accesses is introduced implicitly or explicitly for the following statements:
DO ... TIMES VARYING f FROM f1 NEXT f2 [ RANGE f3 ].
WHILE ... VARY f FROM f1 NEXT f2

[ RANGE f3 ].

A syntax or runtime error is caused if f1 or f2 are not included in f3. If the RANGE addition is missing, it is defined
implicitly from FROM f1 NEXT f2 as follows:
1.

If both f1 and f2 are statically recognizable components of the same structure, the valid RANGE area is defined

from the smallest structure that comprises f1 and f2.


2.

A syntax error is triggered if it is recognizable statically that f1 and f2 are not part of the same structure.

3.

A valid area must be defined explicitly using the RANGE addition if the connection between f1 and f2 is not

recognizable statically.
If you specify a deep structure as the RANGE addition, the system checks for every loop pass that there are no field
references, object references, tables, or strings in the area read.
4. Creating Subroutines
When automatically generating subroutines using the statement GENERATE SUBROUTINE POOL itab NAME name,
the generated program inherits the content of the Unicode flag of the generating program.
5. Saving Programs
When automatically generating programs using the statement INSERT REPORT prog FROM itab, default values are
set for the TRDIR entry as before. Amongst other things, this statement has the new addition UNICODE ENABLING
uc, with which the Unicode flag of the inserted report receives the value of uc. If this addition is missing, the following
applies:
1.

A Unicode program creates a Unicode program.

2.

A non-Unicode program in turn creates a non-Unicode program.

3.

A non-Unicode program becomes a Unicode program if it is overwritten by a Unicode program.

4.

A Unicode program remains a Unicode program if it is overwritten by a non-Unicode program.

6. Assigning Types for GET/SET PARAMETER


For the statements GET PARAMETER ID pid FIELD f and GET PARAMETER ID pid FIELD f, f must be charactertype. You can use the EXPORT and IMPORT statements for storing non-character-type fields and structures.
7. Unreachable Statements
In Unicode programs, unreachable statements cause a syntax error. In non-Unicode programs, there was previously
only a syntax warning.
8. Function Modules with Incorrect Parameter Names
In Unicode programs, calling a function module, whose parameter names are specified statically as a literal or
constant, causes an exception that can be handled if an incorrect parameter name was specified. This only applies to
function modules that are not called via Remote Function Call. In non-Unicode programs, an incorrect name was
previously ignored.

Q. Whats ABAP dictionary and its role in SAP?


Ans: ABAP dictionary is the central information base for the developers. This manages all
definitions(metadata) required for different applications in SAP. ABAP dictionary is completely
integrated into ABAP development workbench. All other component of ABAP development
workbench can access the data definitions(meta data) stored in the data dictionary.
Role: ABAP data dictionary supports

definition of user-defined types (data elements, structures, table types).

structure of database objects (tables, indexes and views) can also be defined.
These user-defined types/objects are then automatically created in the underlying
relational database using the above data definitions.

The ABAP dictionary also provides tools for editing screen fields (e.g., for assigning a
field an input help i.e. F4 help).

Data dictionary ensures data integrity, consistency and security.

Q. What are the main object types of ABAP dictionary?


Ans: The object types of ABAP dictionary can be of following type:

Tables: Tables are defined in the ABAP Dictionary independently of the database.
A table having the same structure is then created from this table definition in the
underlying database.

Views: are logical views on more than one table. The structure of the view is defined in
the ABAP Dictionary. A view on the database can then be created from this structure.

Types (elements, structures, table types): Types are created in ABAP programs. The
structure of a type can be defined globally in ABAP programs. Changes to a type
automatically take effect in all the programs using the type.

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.

Domains: Different fields having the same technical type can be combined in domains.
Domain defines the value range of all table fields and structure components that refer to
this domain.

Data element: The ABAP Dictionary also contains the information displayed with the F1
and F4 help for a field in an input template. The documentation about the field is created
for a data element.

Input help: The list of possible input values that appears for the input help is created by
a foreign key or a search help.

Q. Note on SAP tables(defining through ABAP dictionary).


Ans: Tables are defined independently of the database in ABAP dictionary. The fields of the table
are defined with their (Database-independent) data types and lengths. Using the table definitions
stored in the ABAP dictionary, a table is automatically created in the physical database(when the
table is activated).
Q. What are the components of a table definition.
Ans:

Table fields: For table fields, field names and data types are defined.

Foreign keys: Relationship between the table and the other tables are defined.

Technical settings: Data class and size category defines that what type of table
to be created and how much space required.

Indexes: Secondary indexes are created for a table for faster data selection.

Again following are defined for a table fields:

Field name can be of maximum 16 characters in a table and must start with a letter.

Key flag determines if a field should be the table key.

Field type depicts the data type of the field in the ABAP dictionary.

Field length denotes the number of valid places in the field.

Decimal places Number of places after decimal point for float type value.

Short text describes the business meaning of the field.

Also fields from other structures can be added to the table definition as include.
Q. How data Type, field Length and short Text of any field is assigned?
Ans: i. Data type, field length (and if necessary decimal places) short text can be directly
assigned to a field in the table definition.
ii. Data element can be assigned to a field so that data type, field length (and decimal places) are
automatically determined from the domain of the data element. The short description of the data
element is then assigned to the field as a short text.
Q. What are the assignment options to the field?
Ans: i. Direct assignment of data types, field length, short text to a field.
ii. Data element assignment to a field.
iii. An input check(check table) for a field can be defined with a foreign key.
iv. A search help can be assigned to a field.
v. Reference field or reference table must be specified for a table field that holds currency or
quantity type value.
Q. Whats reference table and reference field?
Ans: Reference table is specified for fields containing quantities(data type QUAN) or
currency(Data type CURR). This reference table must contain a field with the format for the
currency key (data type CUKY) or unit of measure (data type UNIT). This field is called the
reference field of the output field. The reference field can also reside in the table itself.
E.g.: TAB1 contains the field PRICE which holds price values. Field UNIT contains currency
key for PRICE.
So,TAB1 is the reference table for field PRICE and UNIT is the reference field for field PRICE.
Q. Whats table include?
Ans: In addition to listing the individual fields in a table or structure, fields from another
structure can be included as includes.
Q. Whats named include?
Ans: If an include is added to define a database table or database structure, a name can be
assigned to that included (included substructure). The group of fields of that include can be
addressed as a whole in ABAP application programs with a group name which is called as named
include.

E.g.:We can access field of a table/ structure in the ABAP application program in the following
manner:
1. <TABLE / STRUCTURE NAME > - < FIELD NAME>
2. <TABLE / STRUCTURE NAME > - <GROUP NAME>-<FIELD NAME>
3. <TABLE / STRUCTURE NAME > - <GROUP NAME>
Q. Give an example of nested include.
Ans: Structure S1 may include structure S2 and again S2 may include S3.
Q.Whats the maximum depth of nested includes in a table?
Ans: Maximum depth is 9 i.e. maximum 9 structures can be included in a table/structure.
Q. Whats the number of characters limit for field name?
Ans: A field name may not have more than 16 characters in a table, but in a structure maximum
30 characters are allowed for a field name.
Q. What are foreign keys?
Ans: Relationships between tables are defined in the ABAP dictionary by creating foreign keys.
Q. Whare are the uses of foreign keys in SAP?
Ans:

Using foreign keys(as main table-field is linked with check table), input value check for
any input field can be done.

Foreign keys can also be used to link several tables.Explaination on foreign keys:
Suppose, tab1(Foreign key table or dependent table) contains the following fields:
fld1(primary key), fld2, fld3, fld4, fld5 and Tab2(Referenced table) contains the
following fields: fld6(primary key), fld7(primary key), fld8, fld9 and tab1-fld2 is
connected to tab2-fld5, tab1-fld4 is connected to tab2-fld6Therefore, fld2 and fld4 fields
of the table tab1 are called as foreign key fields to the table tab2 and tab2 is called as
check table or referenced table.

Q. What are foreign key fields?


Ans: One field of the foreign key table corresponds to each key field of the check table. That
field of the is called as foreign key field.
Uses: A foreign key permits assigning data records in the foreign key table and check table. One
record of the foreign key table uniquely identifies a record of the check table (using the value
entries in the foreign key fields of the foreign key table).

Q. Whats check table?


Ans: Check table is maintained at field level for data validation.
Q. Whats check field?
Ans: One of the foreign key field is marked as the check field. This depicts that the foreign key
relationship is maintained for that field. When a value is entered for that check field in the table,
input validation checking is done i.e. a checking is done that whether the inserted value exists in
the check table or not. If doesnt exist then system rejects the entry else input validation check
for that field is successful.
Q. Whats generic and constant foreign keys?
Q. Whats cardinality?
Q. What are the types of foreign key fields?
Q. What are text table?
Q. What is technical settings of a table?What are the important parameters to be
mentioned within it?
Q. Whats data class?
Ans: Data class is that which allows the table to get automatically assigned under specific
tablespace/dbspace during table creation in the SAP database i.e. dataclass determines that under
which table space/dbspace the table will be stored.
Q. How many types of data classes are there in SAP?
Data classes are mainly of three types(for application tables):
i.Choose APPL0(master data) for data that is frequently accessed but rarely updated/changed.
ii.Choose APPL1(transaction data) for data that is frequently changed.
iii.Choose APPL2(organizational data) for customizing data that is defined/entered
during system installation and rarely changed.
The other two types of data classes are:USR and USR1(for customers own development
purpose).
Q. Whats size category?
Ans: The Size category is used to defined the space requirement for the table in the database.
Q. How many types of size category are there in SAP?

Ans: There are five size categories. Size category from 0 to 4 can be choosen for the tables. A
certain fixed memory size is assigned to each category in the SAP database.
Q. Whats the utility of size category?
Ans: During table creation, the SAP system reserves an initial space i.e. an initial extent) in the
database.If in any case more space is needed, then additional memory is added according to the
mentioned size category for that table. correct size category prevents the creation of a large
number of small extents for a table i.e. prevents memory wastage.
Q. Whats buffering?
Q. How buffers are filled up?
Q. What are the different buffering types?
Q. What are the different buffering permissions?
Q. How database tables are buffered?
Q. Whats logging?
Q. How many tables are there in SAP?
Ans: i. Transparent tables, ii. Pool tables, iii. Cluster tables.
Q. What is transparent table?
Ans: The tables which create 1-to-1 correspondence between the table definition in the ABAP
data dictionary and the table definition in the physical database are called as transparent tables in
SAP.
Q. Give examples of transparent table.
Ans: VBAK, VBAP, KNA1 etc.
Q. What is table pool?
Ans: Table pool is a table in the SAP database in which many pool tables are assigned.
Q. What are pool tables?
Ans: Tables assigned to a table pool are called as pool tables.
Q. What are table clusters?

Ans: Table cluster is a table in the SAP database in which many cluster tables are stored.
Q. What are clustered tables?
Ans: Tables assigned to a Table cluster are called as clustered tables.
Q. Uses of table pool or table cluster.
Ans: Table pool or table cluster is used to store SAPs internal control information (screen
sequences, program parameters, temporary data, continuous texts such as documentation).
Q. Example of table cluster and cluster tables.
Ans: i. The table cluster RFBLG holds data for five transparent tables i.e. BSEC, BSED, BSEG,
BSES and BSET.
ii. Other examples of table clusters are CDCLS, CDHDR, RFBLG, DOKCLU, DOKTL .
Q. What are the differences between transparent and cluster/pool tables?
Ans: i. A transparent table has 1-to-1 cardinality between the table definition in the data
dictionary and in the table definition of sap database whereas cluster/pool tables have many-to-1
cardinality between the table definition in the data dictionary and in the table definition of sap
database.
ii. Transparent tables are accessible both by Open and native SQL statements whereas table
pool/cluster tables are accessible only by open SQL but never by native SQL.
iii. Transparent tables can store table relevant data whereas table pool or cluster tables can store
only system data/ application data based on the transparent tables.
Q. What are tabs under the maintenance screen of the ABAP data dictionary screen?
Ans: There are five tabs under ABAP dictionary.
i.Attributes,
ii.Delivery & maintenance,
iii. Fields,
iv. Entry help/check,
v. Currency/Quantity fields.
Q. What is delivery class?
Ans: We need to insert an delivery class value while creating customized table in SAP through
the transaction code SE11. Delivery class is that which regulates the transport of the tables data
records (during SAP installations, SAP software upgrade, client copies, and data transport to
other SAP system). SAP and its customers have different write types depending on the variety of

delivery class. If Delivery class is A, it depicts that the application table for master and
transaction data changes only rarely.
Q. How many types of delivery classes are there in SAP?
Ans: There are following delivery classes:
i. A: Application table (master and transaction data) is maintained by the customers
using application transaction.
ii. C: Customer table. Data is maintained only by the customer.
iii. L: Table for storing temporary data.
iv. G: Customer table, new data records can be inserted but may not overwrite or delete existing
ones.
v. E: System table with its own namespaces for customer entries.
vi. S: System table, data changes have the status of program changes i.e. System table
for programs nature. Maintained only by SAP. E.g.: Codes for SAP transactions.
vii. W: System table for system operation and maintenance. Table contents are maintained by
maintenance transactions. E.g.: function module table.
Q. What are the differences between domain and data element?
Ans: i.Domain depicts the technical attributes of a field (its data type, field length, no. of decimal
places, appreance on the sreen) of a SAP database table. Whereas data element denotes the
semantic attributes(short description, label names) for a field.
ii.Data elements are directly attaced to the fields of SAP database tables and each data element
has an underlying domain within it. Whereas domains are not directly attached to the fields and a
single domain can be under many data elements.
iii.Within domain value range of a field can be described. Whereas within the data element
parameter id and search help for a particular field can be assigned.
Q. Whats value table?
Ans: Value table is maintained at domain level in SAP. During domain creation, value range of
the domain is defined by specifying value table. Suppose for a particular domain, its value table
holds the values A, B, Z. So whenever the domain will be used, system will allow to use
these values only.

LOCK OBJECTS IN SAP ABAP DICTIONARY

OVERVIEW
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being
insert/change into database.
SAP Provide three type of Lock objects.

Read Lock(Shared Locked)

protects read access to an object. The read lock allows other transactions read
access but not write access to the locked area of the table

Write Lock(exclusive lock)

protects write access to an object. The write lock allows other transactions neither
read nor write access to the locked area of the table.

Enhanced write lock (exclusive lock without cumulating)

works like a write lock except that the enhanced write lock also protects from
further accesses from the same transaction.
You can create a lock on a object of SAP thorugh transaction SE11 and enter any
meaningful name start with EZ Example EZTEST_LOCK.
Use:
you can see in almost all transaction when you are open an object in Change mode
SAP could not allow to any other user to open the same object in change mode.
Example:
in HR when we are enter a personal number in master data maintainance screen
SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_. to insert the object in a queue.
2. DEQUEUE_. To remove the object is being queued through above FM.

You have to use these function module in your program.

You might also like