Académique Documents
Professionnel Documents
Culture Documents
Day 2
Content Day 2
Changes to Database Tables :
1. Change to database tables 2. Effect of changes to the table structure 3. Database Utility 4. Append Structures
Indexes Views :
1. Why Do we need Views? 2. Join Conditions and Foreign Keys 3. Project views 4. Database views 5. Maintenance Views
Lock Objects
Changes to Tables
ABAP Dictionary
Field 1 Field 2 Field 3
Active version
inactive version
Field 1 Field 2 Field 3 Field 4
Database
Copyright 2009 Deloitte Development LLC. All rights reserved. 4
SAP AG 1999
Active version
Field 1 Field 2 Field 3 Field 4
SAP AG 1999
Append Structures 1
Field A Field B
Table
Field 1 Field 2 Field 3
Append structure
SAP AG 2002
Append Structures 2
Field A Field B
Table
Field 1 Field 2 Field 3
Append structure
SAP AG 2002
Append Structures 3
Field A Field B
Table
Field 1 Field 2 Field 3 Field 4
Append structure
Activate
SAP AG 2002
Summary
always be consistent. For this reason, the corresponding database table must be adjusted when you change a table in the ABAP Dictionary.
The system always tries to make structure changes to
tables by changing the database catalog (ALTER TABLE). If this is not possible, a conversion takes place.
In a conversion, the data is stored in a temporary table and
SAP AG 2002
Indexes Primary index and secondary index Structure of an index Data access using an index Table buffering Advantages of buffering Local table buffers Buffering types Buffer synchronization Which tables should be buffered?
10
SAP AG 1999
11
Program
Optimizer
Index 0 F1 Z Index A F2 Z 10 A3 10 Text
Copyright 2009 Deloitte Development LLC. All rights reserved. 12
TAB F1 F2 F3
SAP AG 2002
Views
Why do you need views? Creating a view by join, projection, and selection Join conditions and foreign keys Selection of data with views Database views Maintenance views Inner and outer joins
SAP AG 2002
F1 F2 F3
F4
F5
F6 F7 F8
Table 1
Table 2
Table 3
14
SAP AG 1999
Table TABA
Table TABB
Field 1 Field 2 Field 3 Field 4 Field 5 1 Text 1 1 Text 1 1 Text 1 1 Text 1 2 Text 2 2 Text 2 2 Text 2 Copyright 2009 Deloitte Development LLC. All rights reserved. 2 Text 2
SAP AG 2002
1 1 2 2 1 1 2 2
A B A B A B A 15 B
16
SAP AG 1999
Joins
17
Types of Views
18
Field 1 Field 2 Field 4 Field 5 1 1 2 2 Text 1 Text 1 Text 2 Text 2 A B A B Text 3 Text 4 Text 5 Text 6
Projection
Field 1 Field 2 Field 5 1 1 2 2
Copyright 2009 Deloitte Development LLC. All rights reserved.
SAP AG 1999
Database Views
F1
F2
F3
F5
F8
F1 F2 F3
F4
F5
F6 F7 F8
Table 1
Copyright 2009 Deloitte Development LLC. All rights reserved.
Table 2
20
Table 3
SAP AG 1999
Maintenance Views
Application object
F1
F2
F3
F5
Table 1 F1 F2 F3
Table 2 F4 F5
Table 3 F6 F7 F8
Foreign key
21
Foreign key
SAP AG 1999
Unit Summary
with a database view is usually faster than direct table selection with a nested SELECT statement.
You can maintain data records from several tables
22
SAP AG 2002
Search Help
The input help (F4 help) is a standard function of the R/3 System. The user can display the list of all possible input values for a screen field with the input help. Standard Input Help Process A user calls an input help with the following steps: The user starts the input help to display the possible input values for a field (search field) in a screen. The system offers the user a number of possible search paths. The user selects one of these search paths. Each search path offers a number of restrictions to limit the number of possible input values. These values are offered in a Dialog box for value restriction when the search path is selected. The user enters restrictions if required and then starts the search.
23
Search Help
The system determines the values that satisfy the entered restrictions (hits) and displays them as a list (hit list). The user selects the most suitable line from the hit list by double-clicking. The value of the search field is returned to the screen template (possibly together with other values).
24
25
26
27
If the data needed in the hit list comes from more than one table, you must link these tables with a view (database view or help view). This view must be defined as the selection method.
If the underlying tables are client-specific, the client field must be contained in the view. Otherwise selection for the input help would be for all clients.
28
If the search is restricted with a parameter of the search help, this is used in the data selection for formulating a WHERE condition for the field of the selection method with the same name. Vice versa, the parameters of the search help are assigned the contents of the fields of the selection method having the same name.
The search help should not contain any parameters for the clients. In the input help, selection is automatically in the logon client of the user. A data element must be assigned to each search help parameter, that is a type is always defined for the search help parameters.
29
30
Dialog Behavior
Dialog type
Display values immediately The hit list is displayed directly when the user clicks on F4 on the screen field. This option is usually used when the hit list is expected to have less entries. Dialog with value restriction A dialog box with options further to restrict the selection of values will be displayed first. On clicking on Enter, hit list with all valid values will be displayed. This is used when the hit list is expected to have more entries. Dialog depends on set of values It behaves like Dialog values immediately when the number of entries are less(say 100) and like Dialog with restriction when the hit list is expected to have more entries.
Hot Key
Hot keys are used to directly select an elementary search help from a collective search help. Hot keys are usually used when a specific search criteria is used frequently for searches.
Copyright 2009 Deloitte Development LLC. All rights reserved. 31
32
33
34
35
Lock Objects
Simultaneous accessing of the same data record by two users in the SAP system is synchronized by a lock mechanism. Locks are set and released by calling certain function modules. These function modules are generated automatically from the definition of so-called lock objects in the ABAP/4 Dictionary Function modules : Enqueue_<obj name> - to lock the table Dequeue_<obj name> - to release the lock
36