02 BOPF Transaction Service Manager
02 BOPF Transaction Service Manager
This presentation outlines our general product direction and should not be relied on in
making a purchase decision. This presentation is not subject to your license
agreement or any other agreement with SAP. SAP has no obligation to pursue any
course of business outlined in this presentation or to develop or release any
functionality mentioned in this presentation. This presentation and SAP's strategy and
possible future developments are subject to change and may be changed by SAP at
any time for any reason without notice. This document is provided without a warranty
of any kind, either express or implied, including but not limited to, the implied
warranties of merchantability, fitness for a particular purpose, or non-infringement.
SAP assumes no responsibility for errors or omissions in this document, except if
such damages were caused by SAP intentionally or grossly negligent.
Introduction
Architecture Overview
Entities of the Transaction Layer
Dynamic Overview
Implementation
Interfaces
Example
Transaction Processing
Wikipedia
In computer science, transaction processing is information processing that is
divided into individual, indivisible operations, called transactions. Each transaction
must succeed or fail as a complete unit; it cannot remain in an intermediate state.
Example
If a consumer books a trip, this booking must only be committed if both the flight
and a hotel room are available.
AP (a) (b)
Use Services
Consumer
(e.g. do_action)
Consumer
Transaction
Manager
Use Services
Consumer
(e.g. do_action)
Consumer
Transaction
Manager
Transaction Manager
Provides methods to save and exit, save and continue, or clean up the current transaction
Collects all changes that are made within the current transaction
(this means the architectural layering must be strictly obeyed)
Checks whether the cross business object calls are valid
(e.g. calling an action of BO2 from check implementation of BO1 is forbidden)
Used only by the consumer and never called from a BOPF entity implementation
Service Manager
Provides methods to access a business object’s service layer method
Used by consumer and BOPF entity implementation (to access a foreign BO)
Interaction Phase
During this phase, the consumer can use all services that are provided by the service
managers to access the business objects’ functions.
Save Phase
During this phase, the following services are called on each business object that is used in
the current transaction.
Finalize: Perform late modifications to prepare the business objects for saving
Check_Before_Save: Check whether a business object instance can be saved from a
business point of view
Adjust_Numbers: Derive unique numbers from a range of numbers
On_Numbers_Adjusted: If the derived unique numbers are referenced by other node
instances, these references must be updated during this phase.
Do_Save: Save the changes made in the current transaction
After_Successful_Save: Prepare the business object for the next transaction
After_Failed_Save: Undo changes made during the finalize phase to continue the
transaction („After Failed Save Attempt“ determinations)
Cleanup Phase
All changes made so far in the transaction are undone.
Customer Invoice
Do_Action Service Layer:1
Issue_Invoice()
Run Time (Issue_Invoice,
Bo-Instance=23) Do_Action(…)
Consumer
Transaction Manager interface
/BOBF/IF_TRA_TRANSACTION_MANAGER
Transaction
Manager
Service Manager interface
/BOBF/IF_TRA_SERVICE_MANAGER
Service Manager
BO 1
/BOBF/IF_TRA_TRANSACTION_MANAGER
Service Layer Used by the consumer to control the whole transaction
BO 1
/BOBF/IF_TRA_SERVICE_MANAGER
Used to access the core services of a business object (either by the
consumer or by another business object). These generic core
services are provided by every business object.
Transaction Control
SAVE
Save all changes made during the current transaction
CLEANUP
Undo all changes made during the current transaction
Information
GET_TRANSACTIONAL_CHANGES
Get all changes made during the current transaction.
Action Execution
CHECK_ACTION
Check whether an action of a business object can be performed
DO_ACTION
Execute an action of a business object
Consistency Checks
CHECK_CONSISTENCY
Check whether a business object meets its own consistency criteria
CHECK_AND_DETERMINE
Check whether a business object meets its own consistency criteria and resolve any
inconsistencies
Alternative Keys
CONVERT_ALTERN_KEY
Convert an (alternative) key to another alternative or primary key.
RETRIEVE_CODE_VALUE_SET
Return possible values for a certain entity, e.g. a node attribute
F4 help can be provided by the user interface.
RETRIEVE_PROPERTY
Return the properties of certain entities. These properties define how the entities are
displayed in the user interface, for instance whether a node attribute can be edited.
RETRIEVE_DEFAULT_QUERY_PARAM
Return the default parameter values of a certain query
RETRIEVE_DEFAULT_ACTION_PARAM
Retrieve the default parameter values of an action
RETRIEVE_DEFAULT_NODE_VALUES
Return the default node values of a node instance. Thus, if a user creates a new node
instance, some of the node attributes can be prefilled with default values on the user
interface.
Only the reference to the transaction manager provides the consumer with the SAVE
and CLEANUP method.
Save 1
Save
Save and Continue Transaction 1 …
Process
Database
is up to date
Save 1 Save 2
Rely on BO Database access
buffers is allowed
Asynchronous
Transaction 1 Transaction 2 …
Save & Continue
Parallel
Save
Process
Database
is up to date
Preconditions
• Usage of the “Standalone Transaction Manager” (no “Slave Transaction
Manager”, for details see slide 8)
• All business objects that are part of that transaction support enqueue scope
“Update Lock” , transaction mode “Endless Transaction (Keep Objects in Buffer)”
and have no “AfterCommit” Determinations
• There is a risk of inconsistency, if a business object that is not yet up to date
accesses the database immediately after the save of the transaction (e.g.
through RETRIEVE with parameter IV_INVALIDATE_CACHE = X during the
“Rely on BO Buffers” phase on slide 32).
Usage
1. Set transaction context at the beginning of the session
(must be done before any service manager is requested)
DATA lo_transaction_manager TYPE REF TO /BOBF/IF_TRA_TRANSACTION_MGR.
lo_transaction_manager = /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER( ).
lo_transaction_manager->set_transaction_context(
IV_CLEANUP_MODE = /BOBF/IF_CONF_C=>SC_CLEANUP_KEEP
IV_ENQUEUE_SCOPE = /BOBF/IF_CONF_C=>SC_ENQUEUE_SCOPE_UPDATE ).
Result
The configured „clean-up mode“ and „enqueue scope“ for all BOs is overruled.
The SET_UPDATE_TASK_LOCAL call is suppressed.
No part of this publication may be reproduced or transmitted in any form or for any purpose Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps,
without the express permission of SAP AG. The information contained herein may be Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync,
changed without prior notice. Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik and Android are
trademarks or registered trademarks of Google Inc.
Some software products marketed by SAP AG and its distributors contain proprietary
software components of other software vendors. INTERMEC is a registered trademark of Intermec Technologies Corporation.
Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are Wi-Fi is a registered trademark of Wi-Fi Alliance.
registered trademarks of Microsoft Corporation.
Bluetooth is a registered trademark of Bluetooth SIG Inc.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x,
System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Motorola is a registered trademark of Motorola Trademark Holdings LLC.
Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH.
pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP,
RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer,
Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. StreamWork, SAP HANA, and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks of SAP AG in Germany
Linux is the registered trademark of Linus Torvalds in the United States and other countries. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal
trademarks of Adobe Systems Incorporated in the United States and other countries. Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services
Oracle and Java are registered trademarks of Oracle and its affiliates. mentioned herein as well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP company.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin products and services mentioned herein as well as their respective logos are trademarks or
are trademarks or registered trademarks of Citrix Systems Inc. registered trademarks of Sybase Inc. Sybase is an SAP company.
HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C®, Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks
World Wide Web Consortium, Massachusetts Institute of Technology. of Crossgate AG in Germany and other countries. Crossgate is an SAP company.
Apple, App Store, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, All other product and service names mentioned are the trademarks of their respective
Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. companies. Data contained in this document serves informational purposes only. National
product specifications may vary.
IOS is a registered trademark of Cisco Systems Inc.
The information in this document is proprietary to SAP. No part of this document may be
RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry reproduced, copied, or transmitted in any form or for any purpose without the express prior
Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry App written permission of SAP AG.
World are trademarks or registered trademarks of Research in Motion Limited.