You are on page 1of 117

ABAP Dictionary

What is a Data Dictionary?


A data dictionary is a centralized storage
location for information about the data
that is stored in a database.

ABAP Dictionary is accessed via


transaction code SE11.
Data
Dictionary The ABAP Dictionary:
 Enforces data integrity
 Manages data definitions without
redundancy
 Is tightly integrated with the rest of
the ABAP Workbench
Data Integrity
Ensuring that data entered into the system is logical,
complete, and consistent.
The following are examples of data lacking integrity:
 A date field with a month value of 13
 An order assigned to a customer number that doesn’t exist

No Redundant Data Definitions


Managing data definitions without redundancy is
the process of linking similar information to the
same data definition.

For example, a legacy customer database is likely to contain


a customer’s ID number in several places. The ABAP
Dictionary provides the capability of defining the
characteristics of a customer ID number in only one place.
That central definition then can be used for each instance of
a customer ID number.
Integration with the ABAP Workbench
Automatic recognition of the names and characteristics of dictionary objects by
the ABAP programs
Easy navigation between development objects and dictionary definitions

 The ABAP Dictionary’s integration with the rest of the


development environment enables ABAP programs to
automatically recognize the names and characteristics of
dictionary objects.

 Additionally, the system provides easy navigation


between development objects and dictionary definitions.
For example, as a programmer, you can double-click on
Data
Dictiona
the name of a dictionary object in your program code,
ry and the system will take you directly to the definition of
that object in the ABAP Dictionary.

 When a dictionary object is changed, a program that


references the changed object will automatically
reference the new version the next time the program
runs. Because ABAP is interpreted, it is not necessary
to recompile programs that reference changed dictionary
objects.
Database Utility
The database utility provides the interface between the ABAP Dictionary and the
underlying database management system (DBMS) by automatically generating the Data
Definition Language (DDL) that the DBMS understands.

Database

Data
Dictionary

Database Utility

You can access the database utility using transaction code ‘SE14’.
Types of data stored in database
Following types of data is stored in database :
 Master Data: Large amounts of data which do not change often. It is often
read, but rarely updated. An example of master data is the data contained in
an address file, such as the name, address and telephone number. (APPL0)
 Transaction Data: Data with temporary lifecycle, not stored long. Frequently
updated. An example of transaction data is the goods in a warehouse, which
change
after each purchase order. (APPL1)
 Organization and Customizing Data: Specified when the system is
configured and then not often changed. An example is the table with
country codes. (APPL2)
 System Data: System data is the data used by the BASIS to store
 Two further data classes, USER and USER1, are provided for the customer.
These are used to define user developments.
Types of data stored in database
 SAP uses the term master data to refer to control
tables and the traditional files that are necessary to Master Transactional
run a business such as personnel files, general Data Data
ledger accounts, customer files, etc. There is a 1:1
correlation between the master data tables in the
Dictionary and the tables in the physical database.
For each master data table in the Dictionary, the
same master data table exists in the physical
database.
 Commercial data or transaction data is another
SAP term used to refer to data created as a result
of performing SAP business transactions such as
creating: invoices, orders, production schedules,
purchase requisitions, stock transfers, etc.
Data dictionary Objects
Basic Objects of the ABAP Dictionary
 The basic objects of the ABAP Dictionary are tables, data elements and domains.
 Tables store the information that is in the database
 Data elements and domains are used to describe the characteristics of fields.
Table A Table B Table C

Data Element 1 Data Element 2

Domain
Domain
Domains
Domains
 A domain specifies the technical characteristics and the allowed values of a
table field.
 The technical characteristics of a table field are the field’s type and length.
These are also referred to as the field’s format.
 The allowed values of a table field define what is acceptable input for that
field. These may be listed explicitly or may be specified by reference to a
value table. The concept of allowed values is explained more fully on later
pages.

Creating a domain
Steps for creating a domain :
 Go to transaction SE11.
 Enter a name for a domain.
 Click Create.
Creating Domain

Enter a description (short text)

Enter data type

Enter the number of characters


allowed for this domain
Creating Domain
Activate Icon

Assign Single Values

Assign Interval Values

Assign a Value Table


Allowed Values
Domain Domain

January
February Value Table
March
..
..
..
.
December
Allowed Values
Fixed Values :
Valid values for a domain can be explicitly listed. To create or maintain an explicit list of valid values,
use the menu path Goto  Fixed Values on the Change Domain screen in the ABAP Dictionary.

Explicit values are used when the list of valid values are not likely to change over time.

For example, if a domain was meant to contain the names of the months of the year, it would be
possible to explicitly list “JANUARY” through “DECEMBER” as the allowed values (note that this
would not work well in a multi-language environment)

Value table :
Valid values for a domain can also be specified by reference to a value table. When this is done, the
records in the value table specify the valid values for the domain. In order to specify a value table for a
domain, one of the key fields of that table must point to that domain. That field is the one that
determines the valid values for the domain.

A value table is used when the list of valid values may change over time.

For example, a car maker may want to use a value table to list the valid colors for certain car
models. As new colors are developed, the value table can be updated without changing the domain
itself.
Benefits of Using Allowed Values

By defining valid values for a domain, automatic validation is provided for any
fields that point to that domain

valid invalid
values values
Data Elements
Data Elements
 A data element provides a meaningful description for a field.
 SAP R/3 comes delivered with many pre-defined data elements
 A data element defines the semantic attributes of a field.
Create Data Element
Steps to create data elements:
 Go to transaction SE11.

 Enter the name of data element in front of

data type.
 Click Create.

 Select data elements and click OK.


Create Data Element

Enter a description (short text).

Enter domain name.


Create Data Element (contd.)

Maintain field labels or column headers in the Field Label tab


Data Element Documentation
In addition to providing field descriptions and headers, data elements can
provide detailed field documentation

This documentation is maintained at the


data element level and is available to a
user who hits F1 when the cursor is on
a field assigned to the data element.
To maintain this documentation,
navigate to the Change Data Element
screen within the ABAP Dictionary and
click the Documentation push-button.
Tables
Database Table Types
 Tables are the objects that actually hold the
information in a database.
 They consist of rows (records) and columns
(fields).
 There are 3 different table types in the SAP
ABAP Dictionary:
1. Transparent tables
2. Pool tables
3. Cluster tables
Transparent Tables
PROFILE

DB

 Transparent tables have a 1:1 correlation between the ABAP


Dictionary and the physical database.
 For each Transparent table in the Dictionary, the same table name exists in
the physical database.
 Transparent tables are created automatically in the database after you
specify the table’s technical settings and activate the table using the
Database Utility. The Database Utility gets invoked automatically when you
activate the table by clicking the activate icon.

Examples of transparent tables:


MARA, MARC
Pooled Tables
 Pooled tables can be used to
store control data (e.g. screen
Pool Table
sequences, program parameters
or temporary data).

 Several pooled tables can be


combined to form a table pool.

 The table pool corresponds to a


physical table in the database in
which all the records of the
allocated pooled tables are
Examples of pooled tables:
M_MTVMA, M_MTVMB, M_MTVMC, stored.
M_MTVMD
Cluster Tables
 Cluster tables may contain continuous text,
for example, documentation.
Cluster Table
 Several cluster tables can be combined to
form a table cluster.

 Several logical lines of different tables are


combined to form a physical record in this
table type. This permits object-by-object
storage or object-by-object access.

 In order to combine tables in clusters, at


least parts of the primary keys must agree.

 Table clusters are stored in one


corresponding table on the database.
Examples of cluster table :
BSEG, CDPOS
Add Fields to Table

Enter the Field Name

Currency / Quantity Fields

Enter Data Element

Check the Primary Key Checkbox


Key and Initial Checkbox
 When the key check box is checked, the table field is
defined as the key field.
 When the initial checkbox is checked, the table field will
necessarily hold the initial value of its data type.
 Key fields will not have initial values.
 The reference field (Currency / Quantity Fields) is used
for the output, the output/input format of a currency
field depends on the value of its reference field. (What
character is to be used for thousands separator and
decimals separator etc. ) would be decided for that
amount field.
Technical Settings

Data Class

Size Category

Buffering Type

Logging
Technical Settings
Technical settings allow you to optimize the storage requirements and
table access behavior of database tables.
 Data class - Designates the table to an area in the physical
database where similar tables are grouped according to type of
data (Master, Transaction, etc.).

 Size Category - Identifies the amount of disk space that will


be required to hold the data records for a table in the
database.

 Buffering - Determines whether table records will be


accessed directly from the database server or from global
memory.

 Logging - Creates before and after images of changes to the


table of contents. Logging must be activated by the profile
when the system is started.
Data Class
Organization and
Transaction data Customizing data

Master data User data

DB

 Data Class defines the type of data which would be stored in the table.

 Defining a data class has the effect of storing the table in a defined area
of the database when the table is created.
Size Categories
 A table’s size category identifies the amount of disk space on the database that
is allocated to the table.
Size Categories
 A table’s size category identifies the amount of
disk space on the database that is allocated to
the table.
 If the number of records in a table exceeds the
original size category, then more space will
automatically be allocated in the database.
 The storage space will be incremented by the
amount of the original size category.
Buffering Type
Single Record

KF1 KF2 KF3 F4 F5 KF1 KF2 KF3 F4 F5 F6

 Buffering is only recommended for tables with data that typically does
not change or get updated.
Full  Buffering types:
 Single record: Only a single record actually being processed is
moved into the buffer. This type of buffering preserves buffer space
but requires more database hits in order to load the table.
KF1 KF2 KF3 F4 F5 Recommended for large tables when only a few records need to be
accessed.
 Generic: A subset of the table records are loaded based on part of
the primary key. Recommended if only certain “generic” areas of the
table will be needed.
 Full: Results in either all of the table or none of it being loaded into
Generic the buffer. Recommended for a) tables up to 30 K in size, b) larger
tables where access is needed to many records, and c) tables
against which attempts to access data will frequently yield a “no
record found” result.
Logging
On the technical settings screen you can specify “Log data changes” to
automatically generate a log file of details on the structure of a table, a list of the
data changes made during a certain period, and statistics.
In addition to clicking the checkbox “Log data
changes” on the technical settings screen, you must
ensure that the System Administrator has also
specified the switch or entry to allow “Table Logging
On”.
Log files do not rely on successful database
updates to be completed before they are written.
The existing logs can be displayed with Transaction
code SCU3.
Index
 To improve performance, SAP automatically creates a primary index (id 0) for
transparent tables based on the primary key. You can also define your own secondary
indexes for transparent tables.
Indexes accelerate the reading of tables when the system looks for records satisfying
specific select criteria. The system determines the most efficient index by which to
select data for the specific request.
An index serves as a sorted copy of the table reduced to specific fields, with a pointer
to the remaining fields.
Database indexes are defined in ABAP Dictionary and stored in the physical database.
Creating Secondary Indexes
Creating Secondary Indexes
 From the ABAP table maintenance screen use the menu path GoTo  Indexes.
 A pop-up window appears. In pop up window press the create button and select
the entry ‘Create Index’ from the dropdown. Assign a 3-character id to your index.
 Provide a short text and select the field(s) by which the table needs to be indexed.

Note :
 Secondary index is used for the tables which are not frequently changed (Eg:
Master tables)
 Creating an index on an SAP table requires a repair, but it will not get overwritten
with an upgrade.
 In the cases where database accesses are necessary and appropriate, it is
imperative to perform those accesses as efficiently as possible. The single most
important method of optimizing a database access is by using an index.
Database Indexes
Employee Names Index Employees Table

Last
Last Name
Name First
First Name
Name Pointer
Pointer ID
ID Last
Last Name
Name First
First Name
Name Salary
Salary

Adams Anthony

Burrows Gerry

Furia Fred

Gregory Tim

Jones Jimmy

Peters Beth

Treske Carolin

Zelkova Zephyr

An index is a set of fields from a table that is sorted and then stored in a location separate from the
table itself. Each record in the index contains a pointer to matching record(s) in the actual database
table.
Primary Key And Foreign Key
Primary Key and Foreign Key
Certain fields in a table are specified as the
primary key of that table.
The primary key is that field or combination
of fields that uniquely identifies a row in
the table.
A foreign key is a field (or combination of
fields) that represents the primary
key of another table.
Prerequisites for Constructing Foreign Key
Relationships
The foreign key field and the primary key of the
check table must share the same domain.
Therefore, foreign keys provide an
additional data integrity check
beyond that which is provided by
the value table.
Foreign Keys: Key Terminology
 The table containing the set of
Value Table
allowed values attached to a domain

Check Table  The table that is referenced by a foreign


key

Foreign Key Table


 The table containing fields that are
the primary key of the other table

 Using Foreign Keys, you can


 Create value checks for input fields.
 Link several tables in a view or in a lock object.
 To see a full list of the allowed values for a screen field, place the cursor inside the field
and hit the F4 key.
Creating a Foreign Key Relationship

Foreign key push-button


Establishing a Foreign Key Relationship in the
ABAP Dictionary
During defining Foreign Key Relationship, system suggests a Foreign
Key Relationship for you.
To establish a Foreign Key in the ABAP Dictionary,
begin by navigating to the field definition of the
Foreign Key Table and entering change mode.
The Foreign Key can then be established by placing
the cursor on the Foreign Key Field, and then by
clicking the Foreign Key icon in the Application
Data Toolbar.
Dictionary Based on the Value Table for the domain of the
field you selected, the system will suggest a Foreign
Key Relationship for you.
Maintaining a Foreign Key Relationship’s
Attributes
Enter a description (short text).

Check table

Maintain foreign
key type

Maintain cardinality n : m
Foreign Key field types
The following types of foreign key field can be defined:
 No key fields/candidates : The foreign key fields are neither primary
key fields of the foreign key table nor do they uniquely identify a
record of the foreign key table (key candidates). For this reason, the
foreign key fields do not (partially) identify the foreign key table.
 Key fields/candidates : The foreign key fields are either primary key
fields of the foreign key table or they already uniquely identify a
record of the foreign key table (key candidates). The foreign key
fields therefore (partially) identify the foreign key table.
 Key fields of a text table : The foreign key table is a text table for the
check table, that is the key of the foreign key table only differs from
the key of the check table in that it has an additional language key
field. This is a special case of the type Key fields/candidates.
Text Tables
 You create text tables when you want to store explanatory text in several
languages.
 It is not advisable to store such texts in your primary table.
 You can make a text table that must comprise the key of the primary table.
 Every text table must also have an additional language key field (field of
data type LANG).
Cardinality
 When creating foreign key relationships, you should always specify the cardinality
of that relationship

n :m
1 1

C C

CN
Uses of Foreign Keys
 Foreign keys are used for:
 Maintaining data integrity
 Providing additional texts in the online help system

 Maintaining data integrity is probably the most


important reason to use foreign keys. With foreign
keys, it is possible to prevent values from being
entered into one table that do not already exist in
another table. For example, it becomes impossible to
enter orders that do not have valid customer numbers.
Table maintenance generator
What is Table Maintenance Generator ?
 A table can be manipulated by a program or
manually.
 When creating table, you will find a check box
‘Table maintenance allowed’. If we
check that option, we can manually enter
entries using SE16 or table maintenance
generator screen.
 SE16 is for data browser.
Table maintenance allowed in se11
Go to SE11, give the table name and click on
change. Then Go to utilities–> Table
maintenance generator.
Creating Table Maintenance Generator
Creating Table Maintenance Generator
 In the table maintenance generator screen, we should give Authorization
Group, Function Group name (Function Group name can be same as table
name), Maintenance type can be one step or two step, usually we will
create with one step. we should give maintenance screen number. After
clicking on create button, a table maintenance generator will be created.

 To check it go to SM30 . In SM30, we find display, Maintain options.

 We can view the table contents by choosing Display and we can create
table entries by choosing Maintain.
SM 30
Transaction code SM30 can be used to display and update table data.
The table maintenance screen is as shown below :
Creating transaction code for
Table Maintenance Generator
Creating transaction code for Table
Maintenance Generator
Step1 : Go to se93 and Provide transaction code Name and Click On Create
Creating transaction code for Table
Maintenance Generator
Step 2: Enter shot text and select Transaction with Parameters(Parameter Transaction)
Radio button and click on enter
Creating transaction code for Table
Maintenance Generator
Step 3 : Below screen is
displayed.
Enter the transaction text.
Creating transaction code for Table
Maintenance Generator
Step 4 : Enter Transaction as
"SM30" and select skip initial
screen check box.
Enter view name value as table
name and update will be ‘X’.
Click on Save button to create the
transaction.
You may access the table
maintenance generator using this
transaction set by you.
Table Maintenance Generator
Events
Creating Table Maintenance Generator Events
The table maintenance generator events are the events specified by SAP and
programmable as required while interacting with the table maintenance
generator.
To create events, go to the table from SE11,
Go to Menu bar Environment ------->Modification---->Events
Creating Table Maintenance Generator Events
Click On New Entries Click on F4. Following entries are displayed

Here you can observe that there are different types of TMG events available like before
saving the data, after saving the data, before deleting, after deleting , Creating a new entry
and others.
Creating Table Maintenance Generator Events
Click On the highlighted button to open editor for writing the code.
Creating Table Maintenance Generator Events

The code must be written between form and endform.

Write the code for the event and click On Save and Activate
Creating Table Maintenance Generator Events

When creating the entries the code written in the form and endform
for the CREATE_ENTRY event is executed.
e.g. : For the given example, the user name, date and Last changed
on are automatically filled-in as the entry is created in the table
maintenance generator.
Structures
Structures
 Structure - A group of internal fields that
logically belong together.
 A Structure consists of components (fields)
whose types are defined.
 A component can have an elementary type, a
structured type, a table type or a reference
type.
Creating Structures in ABAP dictionary

Go to SE11.
Beside Data
type enter
structure name
and click
Create.
Creating Structures in ABAP dictionary

A pop-up
screen appears
with 3 different
options. Select
the radio
button
structure.
Creating Structures in ABAP dictionary
Enter short description and fields and activate the structure.
Using Structures in Table Types
Go to SE11.
Beside Data
type enter
table type
name and click
Create.
Using Structures in Table Types
A pop-up
screen appears
with 3 different
options. Select
the radio
button
Table type.
Using Structures in Table Types
The structure can be described here as line type of the table type. This table type can be
used to store records.
Including Structures in Tables
 Groups of fields or individual fields can also be added to SAP delivered
tables using append structures, or customizing includes:
 Customizing includes are provided in SAP tables and structures to
allow you to add fields to these structures/tables without modifying
the tables themselves.
 Append structures allow you to add fields to SAP-provided structures
and transparent tables that were not provided for in the standard
version.
Creating Append Structure
Click on the Append Structure in database tables
or structures and provide the structure name to
be appended.
Creating Append Structure
 Append structures are intended for additions not provided for in the
standard version of SAP tables via customizing includes. They are to be
used with SAP transparent tables or structures, not with customer tables.
 An Append structure is a structure assigned to exactly one table.
However, a single table can have a number of append structures. It is
recommended to use only one append structure in a table.
 The fields of the append structure must always start with ZZ or YY.
 When an append structure is activated, its assigned table is also activated
with all of the append structure fields. When a table including an append
structure is activated, the append structure fields are found and added to
the table.
 Append structures cannot be deleted.
 Append structures cannot be used with tables containing fields of data
type VARC, LCHR, or LRAW because these data types must be the last field
in a table.
Summary
 Customizing includes are provided in SAP tables and structures to allow
you to add fields to these structures/tables without modifying the tables
themselves.

 Append structures allow you to add fields to SAP-provided structures and


transparent tables those were not provided for in the standard version.
Views
What is a View?
 Views are used to look into one or more tables.
 A view does not contain data.
In many cases, you reference a view in an ABAP program just as you would a table.
The Relational Operations
 We can use views to Join several tables, Project (or choose) certain fields
from one or more tables & Select (or choose) certain records from one or
more tables.
 Join, projection, and selection are called relational operations.
Projection Selection Join
Table 1 Table 2 Table 3 Table 4

View A View C

View B
Creating Views
• Go to SE11.
• Enter the view name in front of view and
click Create.
Creating Views
 Go to SE11.
 Enter the view name in front
of view and click Create.

Enter short description and select the view fields for the basis table(The table for
which the view is to be created).
Specifying Joined Fields
Indicate base tables that data will come from.

Join Conditions

Hit button to see related tables and


automatically generate join conditions.
Specifying Selection Criteria
Can include unprojected fields

1 2 3 4 5
Specifying Selection Criteria (contd.)
You specify selection criteria by building logical expressions that compare
specific fields of a table to hard-coded literal values.
(1 & 2) Specify the table and field on which the restricted selection
should take place. Any fields, including unprojected ones, can be
indicated.
(3) Specify the relational operator used to compare the field to the value.
You may use EQ, NE, LE, LT, GE, GT, LIKE, and NOT LIKE.
(4) Specify the comparison value. Comparison values must be text or
numeric literals. Text literals must be enclosed in single quotes.
(5) You can specify multiple selection criteria (one per line) and link them
using the logical operators AND and OR. Unlike elsewhere in SAP (and
most other systems), OR takes priority over AND. Also, OR operations
are only permitted between lines which refer to the same field.
Types of Views in the ABAP Dictionary
 Database View
 Projection View
 Help View
 Maintenance View
The Database View
 The database view is the only type of view in SAP that is physically created at
the database level.

In other words, the underlying database system also directly recognizes the
view, apart from SAP. Therefore, database views must be created over
transparent tables.

With the database view, all three of the relational operations (projection,
selection, and join) can be used.

Database views can be buffered just like transparent tables. In the technical
settings you can decide whether to have buffering off, or on with type single
record, generic, or full.
The Projection View
 The projection view is a logical view. In this context, the word “logical” means
that the view exists within the ABAP Dictionary but is not recognized by the
underlying database system.
 Projection views must be defined over a single transparent table.
 The only relational operation that is valid for a projection view is projection.

Projection View

View
C
Database vs. Projection Views
Projection View Database View

• Can be built over many tables


• Must be built over a single table • Data can be updated if the view is built
• Data can be updated over a single table
• Data updates must use open SQL • Data updates can use open or native SQL
• Updates are less efficient • Updates are more efficient
• Fields in the view must be named the same • Fields in the view can be named differently
as the fields in the underlying table from the fields in the underlying table
• Can’t be buffered • Can be buffered
Other Types of Views
 Help View :
Help views can be used as selection methods for Search Helps.It might be
necessary to create a Help View if you are trying to accomplish an outer
join.

 Maintenance View :
These views permit maintenance of base table data. Transactions SM30
and SE54 are provided for working with maintenance views.
Summary
 Views are used to look into one or more tables. A view does not contain
data of its own.
 The projection operation is used to narrow a view’s focus to certain fields
in a table.
 The Selection Operation is used to narrow a view’s focus to certain records
in a table.
 The Join Operation is used to combine information from multiple tables
into a single view.
 Types of Views in the ABAP Dictionary are Database View, Projection View,
Help View & Maintenance View.
 The syntax to reference a view in an ABAP program is the same syntax we
use to reference a table.
Type Groups
Type Groups

ABAP Editor

PROGRAM ABC.
ABAP Editor ABAP Editor

PROGRAM 123. TYPE-POOLS . . . PROGRAM XYZ.

TYPE-POOLS . . . TYPE-POOLS . . .
Data E
l
Docum ement
e n ta t i
on

TYPE GROUP

ABAP Dictionary
Type Groups
 Type groups are used for creating customer-defined data
types. These type groups are created in the ABAP Dictionary
and are available for use in all ABAP programs.

 The main purpose is efficiency of coding. If there is a certain


non-standard SAP type that the programmers find themselves
using often in code, it would save coding and maintenance
time to have them centrally defined. Reusability is another
reason for using these type groups
Type Group - Use in Programs
ABAP Dictionary

ABAP Editor

ABAP Program
Run-Time Selection Screen
Summary
 Type groups are used for creating customer-defined data
types. These type groups are created in the ABAP Dictionary
and are available for use in all ABAP programs

 Variables can be declared in ABAP programs using the


customer defined types. Type groups are referenced in
programs by using the TYPE-POOLS statement.
Search Helps
Search Helps
 Search helps are dictionary objects those we develop to compile a set of valid values
for users .

 All throughout SAP, users must enter values into screen fields. These requested
inputs often are numerical codes and ID’s, or abbreviations. Acceptable values might
not be immediately evident, or the user might have forgotten the necessary input.

 A list of valid values will appear when you hit F4, even if a search help was not defined
for that field. These valid values come from the domain that is attached to the field.

 If we invoke a search help, we will see its results, not those from the domain valid
values.

 Whether a search help is available or not depends on whether the programmer has
attached one to the field.

 Search helps can return more than just the original search field to the screen.
Using Search Helps
To see a list of customers
starting with ‘S’

Key fields are


1 indicated by
different color

4
Types of search helps
 An elementary search help is exactly one combination of fields that will
be used to determine the needed value.

 A collective search help is a combination of elementary search helps, so


that the user has the option to pick any path to get to the answer.

 Adding an elementary search help to an SAP table is considered a


modification, and you would have to register your change.

 Adding an elementary search help to an existing collective search help on


an SAP table is allowed without registering.
Elementary vs. Collective
Used to see the full list of
Elementary Search Helps

F4
Used to scroll
the tabs for
Elementary
Search Helps
Individual Elementary Search Helps that
make up the Collective Search Help

Collective Search Help : DEBI (It is called when you hit F4 on


the Customer Number field e.g. transaction XD01)
Creating an Elementary Search Help

Create search help from Dictionary pushbutton on


workbench, or from within Repository Browser.
Steps to create search helps
 To create a search help:
 Go to the ABAP Dictionary: Initial Screen from the ABAP Development
Workbench (Transaction Code SE11).
 Select the “Search helps” radio button.
 Enter a name for your search help. It must begin with the letter Y or
Z, and can be up to 30 characters.
 Hit the Create pushbutton.
 Select Elementary or Collective search help in the next screen.

 Like with most objects in the Dictionary, you can also decide to make a
search help at any point while in the Repository Browser. It will assume
you want to save your object under the development class you are
browsing at the time.
Defining an Elementary Search Help

Data source for


hit list

List Display
method

Used to identify
Optional
search help
Exit

Interface
Parameters
Defining an Elementary Search Help
The following are new terms you will see when you define your search help:
Hot key (optional) - Use this number to code values for the complex dialog box all in the
original search field.
Selection method - The name of the table or view that holds the data that will form your
help hit list. The fields from this table/view will be used in the interface parameters.
Text table - If there is a text table available for your main Selection Method table, it will
appear here. You can then use its fields as well in defining your search help path.
Search help exit (optional) - A function module that enhances the typical processing of the
search help. Not commonly used.
Dialog Type - Controls how you see your results.
The options are:
D - immediate hit list of valid values
C - dialog box where you can narrow down your search, followed by the hit list
A - if there are less than 100 matches, acts like D, if more than 100 matches, acts like C

The interface parameters are covered in more detail on the next slide.
Defining an Elementary Search Help –
Interface Parameters
Parameters for values you Parameter is display only
want to send and receive

Declaration of parameters Data element associated


as import and/or export with parameter

Position parameter Position parameter will Optional default


will be on hit list be on dialog box for parameter
Defining an Elementary Search Help –
Interface Parameters
 Search help parameters - Indicate all the values you will be passing to and from the search
help. When you click in the cell, a drop down arrow will appear. This will give you a list of
fields from your selection method table. If you type in your parameters manually, be sure
that they have the same name as the fields in the table.
 IMP - Indicate parameters as import if you want to pass them from the initial screen to the
search help to be used as search criteria.
 EXP - Indicate parameters as export if you want them to be passed back to the screen from
the search help.
 LPos - Indicate which order on the hit list you want this parameter to be displayed at. For
example, value 3 means the parameter will be the third column of information in the hit list.
 SPos - Indicate which order on the dialog box you want the data associated with this
parameter to be displayed at. If you leave this empty, the parameter will not be displayed on
the dialog box.
 SDis - If checked, this sets the parameter to display only. That means the user will be able to
see the value, but it will be grayed out, and the user cannot enter anything in the field.
 Default value - Set literal in quotes, system field, or parameter ID as default.
Assigning an Elementary Search Help -
Priority Levels

Field
Table

Data Element
Assigning an Elementary Search Help -
Priority Levels
There are three different points where you can attach a search help. You can
assign a search help to all of them if you choose. When the user hits F4, the
system checks to see if there is a search help attached to the:
 Field - To attach a search help to a field, click on the field in the table (or
structure) definition, and go to Goto  Search help  For field. This is the first
type of search help that is checked for, if one is not found, the system checks if
a search help is attached to the table.
 Table - To attach a search help to a table, go to Goto  Search help  For
table. This is the second type of search help that is checked for, if one is not
found, the system checks if a search help is attached to the data element.
 Data element - To attach a search help to a data element, double click on the
data element to get to its definition. Here you will find fields for specifying the
name of the Search Help and the Search Help Parameter. This is the third type
of search help that is checked for, if one is not found, the system does not use
a search help, but will check the domain for valid values. If none exist, then no
help is provided.
Defining a Collective Search Help - Interface

Notice there is no selection method. A


collective search help is a set of one or
more elementary search helps.

There are two parts to maintain in the collective search help definition, the Interface
section, and the Search helps section.
Since the collective search help is meant to be a collection of elementary search helps, you
should use the parameters section to declare all export parameters from all of the
individual elementary search helps.
Defining a Collective Search Help -Adding
Elementary Search Helps

Don’t forget to assign parameters


for each elementary search help.
Do not forget to create parameter assignments. You need to create the link from an
elementary search help back to the collective search help. Select each elementary search
help entry and hit “Param. assignment”. The system will generate a suggested assignment.
Assigning search help to table fields
 Go to SE11, enter table name and click Edit.
 Click on Entry/help check tab.
 Enter the search help name beside the required field.
 Save and activate the table
Summary
 Search helps are dictionary objects that we develop to compile a set of
valid values for users.
 An elementary search help is exactly one combination of fields that will be
used to determine the needed value.
 A collective search help is a combination of elementary search helps.
 When the user hits F4, the system checks to see if there is a search help
attached to the field, search help attached to the table is the second type
of search help that is checked for, if one is not found, the system checks if
a search help is attached to the data element. If one is not found, the
system does not use a search help, but will check the domain for valid
values. If none exist, then no help is provided.
 A search help exit is a function module. Basically, it is extra code that can
be included in the processing of the search help at specific times
End of Slides

You might also like