BC 414 - Programming Database Changes Complee
BC 414 - Programming Database Changes Complee
2015年5月25日 20:47
分区 Index 的第 1 页
Native SQL
Lesson: Cluster Tables
Data Cluster
Syntax
ABAP Cluster Databases
Key of Database Table INDX
Cluster Tables and Transparent Tables
Lesson: SAP Locks
Update and Lock Durations for _scope = 1
Lesson: BAPI Transaction Model
BAPI Definition
Where Are BAPIs Used?
BAPI Properties
BAPI Transaction Model as of Release 4.6 (Example
分区 Index 的第 2 页
Lesson: Database Updates with Open SQL
2015年5月25日 20:44
Database LUW
Implicit DB Commits
In the R/3 System, this means that each database lock is released when a new
screen is displayed, since a change of screen triggers an implicit database commit.
Therefore, database locks are not sufficient if data is collected throughout several
screens and the respective data records are to be kept locked during this time frame.
Lock objects are maintained in the ABAP Dictionary. Customer lock objects must
begin with EY or EZ
If an application program that has created lock entries is terminated, the locks are
released automatically (implicitly). Program termination takes place, for example,
if you have messages of the type A / X, if you have the statements LEAVE
PROGRAM and LEAVE TO TRANSACTION , or if the user enters /n in the
command field..
Lock argument
The core part of a lock entry is the lock argument that consists of the
lock parameters (key fields of the respective table) and the key of the table
entry(entries) to be locked.
Faster
Delete: RESET_ENQUEUE
Data flow
Writing/Closing Requests
In asynchronous updates, the dialog program and update program run separately:
• The dialog program writes the change requests to the log table and closes
the LUW with a COMMIT WORK.
• The update initiated by the COMMIT WORK now processes the change
requests. The dialog program is continued; the system does not wait for
the update to end.
• The update program runs in a special update work process. This can be on an
application server other than the one used for the R/3 System.
Synchronous Update
Local Update
V1 and V2 Updates
Update Execution
If you are calling an ABAP program that has a standard selection screen, you can
pass values to the input fields on the selection screen.. There are two ways to
do this:
• You enter a variant for the call (SUBMIT addition USING SELECTION-SET)
• By entering actual values for the input fields on the selection screen during the call (see next figure).
SUBMIT . . . WITH
External:
The user inputs a number that is then checked by the system
to see if it has been reserved for external assignment.
Internal:
the system automatically assigns a number to a business object. Thus,
there are different number ranges for external and internal number assignment.
分区 Unit 6 Appendix 的第 51 页
Number Range Object Transaction Code : SNRO
Number range objects can be organized according to subobjects (for example,
according to company code, user department, or airline carrier).
Subobjects
分区 Unit 6 Appendix 的第 52 页
分区 Unit 6 Appendix 的第 53 页
Function Modules for Number Management
2015年5月28日 10:19
分区 Unit 6 Appendix 的第 55 页
Buffering Numbers
2015年5月28日 10:25
Buffering Numbers
Accessing Table NRIV Without a Buffer
分区 Unit 6 Appendix 的第 56 页
Access Through Number Range Buffer (Standard)
Number range servers are logical units on the application server and run their own
LUWs. Thus gaps can occur in number assignments due to rollback or network
errors.
分区 Unit 6 Appendix 的第 57 页
Another means of assigning buffered numbers is to buffer the numbers block by
block for each application server on the database.
Features:
• Serialization only takes place for each individual server.
• No gaps.
• Not in chronological order.
分区 Unit 6 Appendix 的第 58 页
Using Function Groups to Manage Number Ranges
2015年5月28日 10:38
分区 Unit 6 Appendix 的第 59 页
Lesson: Creating Change Documents
2015年5月28日 10:40
You must transfer the following data to the update module that writes the change
documents:
• Application data before it is changed by the program
• Application data updated in the program
• Administration data for the document header (user ID, change date, change
time, name of the transaction making the change, and so on).
分区 Unit 6 Appendix 的第 60 页
Creating Change Documents
2015年5月28日 10:48
分区 Unit 6 Appendix 的第 61 页
Generating Document-Creation Module and Call
For each defined change-document object, the system can generate the
corresponding document-generation function module and also call the module
together with the required data declarations (ABAP syntax).
分区 Unit 6 Appendix 的第 62 页
Use of Includes in the Application Program
分区 Unit 6 Appendix 的第 63 页
Change Document Management
2015年5月28日 10:58
分区 Unit 6 Appendix 的第 64 页
Lesson: Authorization Checks
2015年5月28日 11:35
分区 Unit 6 Appendix 的第 65 页
Authorization Checks for Transactions
分区 Unit 6 Appendix 的第 66 页
Lesson: SAP Buffers
2015年5月28日 11:43
SAP Buffers
• Reduce the time needed to access data with read accesses. Data on the
application server can be accessed more quickly than data on the database.
• Reduce the load on the database. Reading the data from application server
buffers reduces the number of database accesses.
分区 Unit 6 Appendix 的第 67 页
Updating SAP Buffers
2015年5月28日 19:41
分区 Unit 6 Appendix 的第 68 页
Buffering Types
2015年5月28日 19:44
Buffering Types
• Resident buffering (100%): The whole table is loaded to the table buffer
when the table is accessed for the first time.
• Generic buffering: A generic key (first n key fields) must be specified in
the technical settings for the table in the ABAP Dictionary.
• Single-record buffering: Only single records are read by the database and
stored in the table buffer.
分区 Unit 6 Appendix 的第 69 页
Lesson: Native SQL
2015年5月28日 19:47
Native SQL
分区 Unit 6 Appendix 的第 70 页
Lesson: Cluster Tables
2015年5月28日 19:49
Data Cluster
A data cluster is a combination of data objects. Data objects are fields, structured
fields, internal tables, and complex structures derived from these.
分区 Unit 6 Appendix 的第 71 页
Syntax
2015年5月28日 19:54
分区 Unit 6 Appendix 的第 72 页
ABAP Cluster Databases
2015年5月28日 19:57
You can create your own ABAP cluster databases To do this, proceed as follows:
• Define a database table as a transparent table in the ABAP Dictionary. This
table represents its cluster database.
• Build the table structure as shown above.
• The MANDT field can be omitted (it will be filled automatically if it exists).
• The fields RELID, SRTF2, CLUSTR, CLUSTD and the cluster ID are filled
automatically within an EXPORT action.
• Any user-defined fields must be filled before the EXPORT. They can then be
evaluated after an IMPORT.
• You can choose the field names for the cluster ID and your own fields. The
remaining field names are specified by the system.
• The length of the part used for the data cluster is calculated from the total
length of the structure minus the length of the first six fields.
分区 Unit 6 Appendix 的第 73 页
Key of Database Table INDX
2015年5月28日 20:01
The INDX database is an example of a database table in which you can store data
clusters. It is installed in your system by default and has a key length of 31 bytes.
The key consists of a client, area, cluster ID, and subsequent record number.
分区 Unit 6 Appendix 的第 74 页
Cluster Tables and Transparent Tables
2015年5月28日 20:08
分区 Unit 6 Appendix 的第 75 页
Lesson: SAP Locks
2015年5月28日 20:19
分区 Unit 6 Appendix 的第 76 页
Lesson: BAPI Transaction Model
2015年5月28日 20:24
BAPI Definition
分区 Unit 6 Appendix 的第 77 页
Where Are BAPIs Used?
2015年5月28日 20:26
分区 Unit 6 Appendix 的第 78 页
BAPI Properties
2015年5月28日 20:27
BAPI Properties
分区 Unit 6 Appendix 的第 79 页
BAPI Transaction Model as of Release 4.6 (Example External
Client)
2015年5月28日 20:30
分区 Unit 6 Appendix 的第 80 页