0% found this document useful (0 votes)
360 views29 pages

05 BOPF Integration

bopf

Uploaded by

Pallav Gangele
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)
360 views29 pages

05 BOPF Integration

bopf

Uploaded by

Pallav Gangele
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/ 29

BOPF Integration

SAP AG, 2014


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


BOPF Integration
Agenda

1. Integration of BOPF Business Objects into Legacy Applications


(Master/Slave Transaction Manager)

2. Integration of Legacy Data and Functions into BOPF Business Objects


a. Function Integration on Application Layer
b. Data Integration on Application Layer

2012 SAP AG. All rights reserved. 3


BOPF Integration
Agenda

1. Integration of BOPF Business Objects into Legacy Applications


(Master/Slave Transaction Manager)

2. Integration of Legacy Data and Functions into BOPF Business Objects


a. Function Integration on Application Layer
b. Data Integration on Application Layer
(Legacy DAC)

2012 SAP AG. All rights reserved. 4


Integration of BOPF Business Objects into existing
Legacy Applications

Legacy Application

BOPF BOPF BOPF


BO BO BO

Scenario: Existing BOPF business objects needs to be integrated into an


application or another framework.
Issue: BOPF business objects must rely on the correct processing of the BOPF
transaction phases like it is ensured using the BOPF standalone transaction
manager. For instance the finalize phase must be executed to run the finalize
determinations before a commit work is called.
Solution: Instead of using the (standalone) transaction manager, you have to
implement an own master transaction manager orchestrating both the save
process of the legacy application as well as the save process of the BOPF
business objects.

2012 SAP AG. All rights reserved. 5


Integration of BOPF BOs into Legacy Applications (1/3)
Legacy Application

Legacy ABAP
UI
Application Core

Invoke Functions
Interaction
Phase

Save
Commit
Save
Phase

Rollback
Rollback
Rollback
Phase

2012 SAP AG. All rights reserved. 6


Integration of BOPF BOs into Legacy Applications (2/3)
Legacy Application & BOPF Save Phase

Legacy ABAP BOPF Slave BOPF


BOPF Service
Service
UI BOPF Service
Application Core Transaction Manager Managers
Managers
Managers
Invoke Legacy
Functions

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.

2012 SAP AG. All rights reserved. 7


Integration of BOPF BOs into Legacy Applications (3/3)
Legacy Application & BOPF Cleanup Phase

Legacy ABAP BOPF Slave BOPF


BOPF Service
Service
UI BOPF Service
Application Core Transaction Manager Managers
Managers
Managers
Invoke Legacy
Functions

Interaction
Phase Invoke BOPF Functions

Rollback
Cleanup (iv_execute_rollback_work = false)
BOPF Cleanup BOPF clears
Pre transactional
Rollback Rollback buffers
Phase Phase
Rollback

2012 SAP AG. All rights reserved. 8


Implementation of a Master Transaction Manager

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.

2012 SAP AG. All rights reserved. 9


BOPF Integration
Agenda

1. Integration of BOPF Business Objects into Legacy Applications


(Master/Slave Transaction Manager)

2. Integration of Legacy Data and Functions into BOPF Business Objects


a. Function Integration on Application Layer
b. Data Integration on Application Layer
(Legacy DAC)

2012 SAP AG. All rights reserved. 10


Integration Object

Data Function

Depending on the scenario, (legacy) data and (legacy) functions needs to be


integrated into a BOPF based application. For instance, an existing function
module must be offered to the consumer by the help of a business object.

2012 SAP AG. All rights reserved. 11


Integration Layer

User Interface Layer

Application Layer

Database Layer

Integration can be achieved on different layers of an application. In this chapter,


only the application layer is focused as it is represented by the BOPF. The
possibilities of integrating on User Interface Layer and Database Layer heavily
depend on the used technology.

2012 SAP AG. All rights reserved. 12


Integration Matrix
Examples of Integration Possibilities

Data Integration Function Integration


(e.g. Database Table) (e.g. Function Module)
User Interface Layer e.g. Frames in HTML e.g. UI buttons calling functions

Content of this Presentation


Application Layer Specific BOPF Encapsulation via
(BOPF) Data Access Class BOPF Actions, Determinations
or Validations

Database Layer e.g. DB Views e.g. DB trigger,


stored procedures

2012 SAP AG. All rights reserved. 13


BOPF Integration
Agenda

1. Integration of BOPF Business Objects into Legacy Applications


(Master/Slave Transaction Manager)

2. Integration of Legacy Data and Functions into BOPF Business Objects


a. Function Integration on Application Layer
b. Data Integration on Application Layer
(Legacy DAC)

2012 SAP AG. All rights reserved. 14


Function Integration on Application Layer
Motivation

BOPF Application Legacy Function

BOPF
BO

There is an existing function module which shall be consumed via a BOPF


business object. This has the advantage that BOPF UI infrastructure can be
reused (e.g. user interface frameworks) and the data can be easily consumed
from other BOPF business objects.

2012 SAP AG. All rights reserved. 15


Function Integration on Application Layer
Best Practise

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

The legacy function is encapsulated by the help of a BOPF action (determination


or validation would also be possible). Changes done by that function are saved or
cleaned up by the BOPFs commit or rollback.
2012 SAP AG. All rights reserved. 16
Issues of Integrating Functions on Application Layers
Legacy Function calls Commit or Rollback

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.

2012 SAP AG. All rights reserved. 17


Issues of Integrating Functions on Application Layers
Legacy Function has no cleanup/undo Option

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.

2012 SAP AG. All rights reserved. 18


Issues of Integrating Functions on Application Layers
Legacy Function modifies Objects which needs to be locked

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.

2012 SAP AG. All rights reserved. 19


BOPF Integration
Agenda

1. Integration of BOPF Business Objects into Legacy Applications


(Master/Slave Transaction Manager)

2. Integration of Legacy Data and Functions into BOPF Business Objects


a. Function Integration on Application Layer
b. Data Integration on Application Layer
(Legacy DAC)

2012 SAP AG. All rights reserved. 20


Data Integration on Application Layer
Motivation

BOPF Application

BOPF
BO

BOPF Tables Legacy Table

An existent legacy database table shall be integrated into a BOPF business


object. It shall be represented by a node.
In contrast to directly access the table, the BOPF infrastructure (UI, extensibility)
can be reused and further functionality can easily be added to the node.

2012 SAP AG. All rights reserved. 21


Data Integration on Application Layer
Case 1: BOPF Default Persistency Layout is used

Root Database Table


Field Type Subnode Database Table
MANDT MANDT Field Type Subsubnode Database Table
DB_KEY /BOBF/CONF_KEY MANDT MANDT Field Type
(RAW16)
DB_KEY /BOBF/CONF_KEY MANDT MANDT
(RAW16)
DB_KEY /BOBF/CONF_KEY
PARENT_KEY /BOBF/CONF_KEY (RAW16)
(RAW16)
PARENT_KEY /BOBF/CONF_KEY
(RAW16)
ROOT_KEY /BOBF/CONF_KEY
(RAW16)

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.

2012 SAP AG. All rights reserved. 22


Data Integration on Application Layer Issues
Case 1: BOPF Default Persistency Layout is used

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.

2012 SAP AG. All rights reserved. 23


Data Integration on Application Layer Issues
Case 2: Incompatible Database Layout

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.

2012 SAP AG. All rights reserved. 24


Legacy DAC
How to use

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.

2012 SAP AG. All rights reserved. 25


Legacy DAC
Restrictions

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.

2012 SAP AG. All rights reserved. 26


Legacy DAC
Principle
Consumer KEY ID ID_TYPE CREATED_BY KEY field is hidden by field
properties (disabled)
0 23 INV SMITH
1 24 CDV CARTER

BOPF KEY ID ID_TYPE CREATED_BY


0 23 INV SMITH
1 24 CDV CARTER

Legacy DAC KEY ID ID_TYPE KEY ID ID_TYPE CREATED_BY


+Mapping Table 0 23 INV 0 23 INV SMITH
1 24 CDV 1 24 CDV CARTER

Legacy Database Table ID ID_TYPE CREATED_BY


23 INV SMITH

24 CDV CARTER

Field ID and ID_TYPE are the primary key components of the


legacy table uniquely identifying each table entry

2012 SAP AG. All rights reserved. 27


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

You might also like