05 BOPF Integration
05 BOPF Integration
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.
Legacy Application
Legacy ABAP
UI
Application Core
Invoke Functions
Interaction
Phase
Save
Commit
Save
Phase
Rollback
Rollback
Rollback
Phase
Interaction
Phase Invoke BOPF Functions
Save
Finalize, CheckBeforeSave, AdjustNumbers,
BOPF Finalize, CheckBeforeSave
Pre
Commit
Phase
Commit Triggers BOPFs
Save update task
Phase
AfterSuccessfulSave
BOPF AfterSuccessfulSave
Post
Commit
Phase
The Legacy Application is called Master Transaction Manager as it handles the COMMIT/ ROLLBACK.
Interaction
Phase Invoke BOPF Functions
Rollback
Cleanup (iv_execute_rollback_work = false)
BOPF Cleanup BOPF clears
Pre transactional
Rollback Rollback buffers
Phase Phase
Rollback
Implement your own master transaction manager instead of using the BOPF (standalone)
transaction manager. It needs to handle both the save (and cleanup) process of the BOPF
BOs via the Slave Transaction Manager and the save of the legacy application. The slave
manager instance can be received by the /BOBF/CL_TRA_TRANS_MGR_FACTORY =>
GET_SLAVE_TRANSACTION_MANAGER() method.
You can take the /BOBF/CL_TRA_TRANSACTION_MGR, method SAVE() as a reference of
the sequence which needs to be called while save. Also implement the cleanup
functionality.
Data Function
Application Layer
Database Layer
BOPF
BO
Transaction Save
New Transaction (BOPF calls commit)
Action is called
This action calls the
legacy function
Transaction Cleanup
New Transaction (BOPF calls rollback)
Action is called
This action calls the
legacy function
Issue
The function to be integrated uses transactional commits and rollbacks which cant
be supressed by parameters.
Only the BOPF (or the master transaction manager if existing) is allowed to execute
commits and rollbacks. If a function is calling those commands on ist own, the
enqueues (update locks) set by BOPF to protect changed node instances are
released. This can cause inconsistencies (lost updates) in case of a foreign
session.
Solution: Staging
Stage the function calls in a static variable and execute the real function call only
via an after successful save determination. Use a second determination
configured to the cleanup time to clear that static variable if the current transaction
is cleaned up by the user.
Issue
The function to be integrated does not have an undo option (transaction rollback
would be not sufficient).
All changes which are done during a transaction must be made undone as soon as
the user cleans up the current transaction instead of saving it. Also all changes
done by that functions needs to be made undone if a rollback is not sufficient.
Solution 1: Staging
Stage the function calls in a static variable and execute the real function call only
via an after successful save determination. Use a second determination
configured to the cleanup time to clear that static variable if the current transaction
is cleaned up by the user.
Solution 2: Log & Compensate
Create a determination at cleanup time which compensates the changes done by
the integrated function. Be aware that also the compensation operations could fail.
Issue
The function modifieds objects which needs to be locked and which might be locked
by other users in parallel. If the function is called and the necessary lock is not
available, the situation must not harm the transactional consistency (all or nothing
paradigma)
Solution: Action Validation to get the Locks
If the function is integrated by the help of a BOPF action, you can use an action
validation which acquires the necessary lock for your function up front. If the lock is
not available, the action validation rejects the action execution.
BOPF Application
BOPF
BO
If the legacy database table has already compliant fields to the BOPF default
persistency layout (very rare case) or those fields can be introduced, the
integration is possibly by just maintaining the corresponding table in the node
configuration.
Issue
The legacy database table is usually used by another application. This application
uses an own enqueue concept which needs to be obeyed. Before the BOPF
modifies the entries of that legacy database table, a corresponding enqueue must
be acquired (and later on released).
Solution
Reimplement the BOPF Lock and Unlock Action for the node that integrates the
legacy table. Set both the locks for the legacy application and the ones for the
BOPF. As soon as BOPF requires locks, your lock/unlock action will be invoked to
acquire or release the lock.
Issue
The primary key of the legacy database table is type-compliant to BOPF default
persistency layout. However the name does not match the BOPF default
persistency layout (e.g. the key not named DB_KEY). It is not possible to
change the fields name.
Solution 1: Persistency Mapping (not recommended)
Use the persistency mapping tab of the BOPF Configuration UI to bind the
different named field to the DB_KEY field. This is not possible in BOBX and
Eclipse and should not be done at all.
Solution 2: Own DAC (not recommended)
Implement your own DAC by copying /BOBF/CL_DAC_TABLE and replace the
SQL statements/coding accordingly. As this dublicates a lot of code which needs
to be separatly maintained, this should not be done.
Solution 3: Usage of Legacy DAC
The Legacy DAC allows to integrate legacy database tables having arbitrary fields
as a common BOPF node.
1. Create a persistent node and maintain the BOPF Legacy DAC class as data access
class
2. Maintain a unqiue alternative key namend DB_KEY on that node consisting of all the
components of the legacy database table building the legacy key (can be more than one
component)
3. If the node is not the ROOT node, maintain also a unique alternative key
PARENT_KEY (consisting of all legacy components building the parent key
information) and the corresponding ROOT_KEY. If there is no ROOT_KEY alternative
key, the legacy DAC will automatically concatenate the parent key information to
simulate a ROOT navigation.
4. In case of self implemented queries, the mapping functionality of the legacy DAC can be
usedvia ist methods map_to_bopf_key and map_to_legacy_key.
Please be aware that in this case an own lock and unlock action class must be provided
as the BOPF library lock class expects globally unique keys those transient keys are
only unqiue within their session but not cross session (see chapter Action for action
implementations). But as there is usually non-BOPF business logic operating on the
legacy database table, the lock/unlock behavior always needs to be adapted.
Please be aware that the transient keys must not be stored by the consumer as they will
change for each session. Thus the consumer always has to start the transaction using
an alternative key (or query) to get the current transient keys but is not allowed persist
the transient keys.
24 CDV CARTER
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.