0% found this document useful (0 votes)
34 views

02 BOPF Transaction Service Manager

The document discusses SAP's BOPF Transaction & Service Manager. It provides an overview of the architecture and entities that make up SAP's transaction management layer. The key entities include the Transaction Manager, which provides methods for saving, exiting, and cleaning up transactions, and the Service Manager, which provides access to business object services. The Transaction Manager ensures changes are collected and validates cross-business object calls. Transactions can be controlled using save-and-continue or save-and-exit patterns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

02 BOPF Transaction Service Manager

The document discusses SAP's BOPF Transaction & Service Manager. It provides an overview of the architecture and entities that make up SAP's transaction management layer. The key entities include the Transaction Manager, which provides methods for saving, exiting, and cleaning up transactions, and the Service Manager, which provides access to business object services. The Transaction Manager ensures changes are collected and validates cross-business object calls. Transactions can be controlled using save-and-continue or save-and-exit patterns.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

BOPF Transaction & Service Manager

SAP AG, 2012


Disclaimer

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.

© 2012 SAP AG. All rights reserved. 2


Agenda

Introduction
Architecture Overview
Entities of the Transaction Layer
Dynamic Overview
Implementation
 Interfaces
 Example

© 2012 SAP AG. All rights reserved. 3


Introduction
Introduction
What Is a “Transaction”?

Transaction Processing

Transaction 1 Transaction 2 Transaction 3

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.

© 2012 SAP AG. All rights reserved. 5


Introduction
Transaction Controlling

(a) Save & Continue Transaction 1 Transaction 2

(b) Save & Exit Transaction 1

(c) Cleanup Transaction 1

A transaction can be controlled by the following commands:


Save & Continue: Saves all changes made so far in the current transaction.
Afterwards, a new transaction is created automatically.
Save & Exit: Saves all changes made so far in the current transaction.
Afterwards, no further commands are executed.
Cleanup: Removes all changes made so far in the current transaction.

© 2012 SAP AG. All rights reserved. 6


Architecture Overview
Architecture Overview
Business Suite

AP (a) (b)

There are two possible ways to use the TSM concept:


 Standalone Transaction Manager
Only a single comprehensive save method is provided.
 Master & Slave Transaction Manager (not part of these slides)
Enables the integration of foreign applications within the save process. To do this, a finer-
grained set of methods to control the save-process is provided by the slave transaction
manager and used by the master transaction manager.

© 2012 SAP AG. All rights reserved. 8


Ensemble of Consumer, TSM, and BOPF (1)

Use Services
Consumer

(e.g. do_action)
Consumer

Create, clean up, and save


the transaction
Transaction Layer

Transaction
Manager

Service Manager Service Manager


Transaction BO 7
BO 4

Forward Service Forward Service


Requests Requests
(e.g. do_action) (e.g. do_action)
Use Services
(e.g. do_action)
BOPF

Service Layer Service Layer


BO 4 BO 7

© 2012 SAP AG. All rights reserved. 9


Ensemble of Consumer, TSM and BOPF (2)

Use Services
Consumer

(e.g. do_action)
Consumer

Create, clean up, and save


the transaction
Transaction Layer

Transaction
Manager

Service Manager Service Manager


Transaction BO 7
BO 4

Forward Service Forward Service


Requests Requests
(e.g. do_action) (e.g. do_action)
Use Services
(e.g. do_action)
BOPF

Service Layer Service Layer


BO 4 BO 7

© 2012 SAP AG. All rights reserved. 10


Entities of the Transaction
Layer
Entities of the Transaction Layer (1)

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)

© 2012 SAP AG. All rights reserved. 12


Entities of the Transaction Layer (2)

Transaction Manager Factory


 Provides get_transaction_manager() to receive the transaction manager instance.
(If this instance was not created before, it is instantiated automatically.)
 Ensures that always only one transaction manager instance exists
 Used only by the consumer and not by a BOPF entity implementation

Service Manager Factory


 Provides get_service_manager( iv_bo_key )to receive a service manager instance
of a certain business object
 Ensures that there is always only one service manager instance for each business object
 Used by the consumer and BOPF entity implementation (to access a foreign BO)

© 2012 SAP AG. All rights reserved. 13


Dynamic Overview
Transaction Patterns

The Transaction Manager and the Service Managers


Consumer interact by using services during the transaction.
Service Interface The order in which the service calls are executed is
restricted by transaction patterns. Two inbuilt
Transaction transaction patterns are available:
Manager

Service Interface  Save & Continue


Saves all changes made so far in the current
Service Manager transaction. Afterwards, a new transaction is created
BO 4 automatically .

Service Layer  Save & Exit


BO 4 Saves all changes made so far in the current
transaction. Afterwards, no further services can be
executed.

© 2012 SAP AG. All rights reserved. 15


States of a Transaction

1. After calling a service manager’s


service, the transaction remains in
the interaction state.

2. As soon as the SAVE method of the


transaction manager is called by the
consumer, the interaction state is finished.
All of the following states are processed
automatically by the transaction manager.

3. Difference between both transaction patterns:


Save & continue creates a new transaction and forms a
cycle.

© 2012 SAP AG. All rights reserved. 16


Description of the Transaction Phases

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.

© 2012 SAP AG. All rights reserved. 17


Implementation
Interfaces
Core Service Approach vs. Object Orientation
Example

Object-Oriented Approach Core Service Approach


Design Time << Business Object>>
Customer Invoice
Issue_Invoice()

Customer Invoice:23 Service Manager:56

Customer Invoice
Do_Action Service Layer:1
Issue_Invoice()
Run Time (Issue_Invoice,
Bo-Instance=23) Do_Action(…)

The action of the object is The action is called using a


called. generic core service.

© 2012 SAP AG. All rights reserved. 19


Interface Overview

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.

© 2012 SAP AG. All rights reserved. 20


Transaction Manager Interface (1)
/BOBF/IF_TRA_TRANSACTION_MANAGER

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.

© 2012 SAP AG. All rights reserved. 21


Transaction Manager Interface
/BOBF/IF_TRA_TRANSACTION_MANAGER

Read Node Instance Data


 RETRIEVE
Read the data of node instances that can be identified by their node instance key
 RETRIEVE_BY_ASSOCIATION
Read the data of node instances that can be identified by using a certain association
 QUERY
Execute a certain query to find node instances

Modification of Node Instance Data


 MODIFY
Create, update, or delete node instances of a certain node

© 2012 SAP AG. All rights reserved. 22


Transaction Manager Interface
/BOBF/IF_TRA_TRANSACTION_MANAGER

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.

© 2012 SAP AG. All rights reserved. 23


Transaction Manager Interface
/BOBF/IF_TRA_TRANSACTION_MANAGER

Miscellaneous (mainly used by the user interface implementation)

 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.

© 2012 SAP AG. All rights reserved. 24


Implementation
Examples
Example of Initialization Phase

Only the reference to the transaction manager provides the consumer with the SAVE
and CLEANUP method.

© 2012 SAP AG. All rights reserved. 26


Example of Interaction Phase

© 2012 SAP AG. All rights reserved. 27


Example of Cross-Business Object Call

© 2012 SAP AG. All rights reserved. 28


Example of Save Phase

Assumption: Only BO1 was changed within the current transaction.

© 2012 SAP AG. All rights reserved. 29


Transaction Patterns
Transaction Pattern: Save and Continue

Save 1

Save
Save and Continue Transaction 1 …
Process

Database
is up to date

Save And Continue


The default transaction pattern saves all changed data and continues afterwards
with a new transaction.

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->save( ).

© 2012 SAP AG. All rights reserved. 31


Transaction Pattern: Asynchronous Save and Continue 1/2

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

Asynchronous Save and Continue


Allows the consumer to proceed even if the saving process of data that were
changed during the last transaction is not finished yet. Therefore, the business
objects must hold the buffered data that are up to date.

© 2012 SAP AG. All rights reserved. 32


Transaction Pattern: Asynchronous Save and Continue 1/2

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).

© 2012 SAP AG. All rights reserved. 33


Transaction Pattern: Asynchronous Save & Continue 2/2

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 ).

2. Save in the Asynchronous Save & Continue Mode


lo_transaction_manager->save(iv_transaction_pattern =
/bobf/if_tra_c=>gc_tp_async_save_and_continue ).

Result
The configured „clean-up mode“ and „enqueue scope“ for all BOs is overruled.
The SET_UPDATE_TASK_LOCAL call is suppressed.

© 2012 SAP AG. All rights reserved. 34


Thank you
© 2012 SAP AG. All rights reserved.

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.

© 2012 SAP AG. All rights reserved. 36

You might also like