SAP New Framework For Developers: An Introduction: Wipro Technologies
SAP New Framework For Developers: An Introduction: Wipro Technologies
SAP New Framework For Developers: An Introduction: Wipro Technologies
BOPF
SAP New Framework for Developers: An introduction
BOPF
Table of Contents:
Introduction.........................................................................................................................................2
BOPF Architecture ...............................................................................................................................2
BOPF Transaction Model.......................................................................................................................3
BOPF T-Codes.............................................................................................................................4
Business Object Model....4
Nodes/Subnodes...4
Actions.....6
Association..7
Determinations......8
Validations.....9
Query........10
BOPF Enhancement Framework..11
BOPF Integration.12
Reference......13
Page 1
BOPF
Introduction
BOPF stands for business Object Processing Framework. As the name implies, this is all about the
business objects (BO) modeling which provides the tool and services to model a business object cycle.
This is complete OO-based framework. Using this frameworks generic services and functionalities,we
can standardize, modularize and save our time during the development. We are already familiar with
some BO frameworks (defined in Transaction SWO1, BOL etc.). BOPF also shares some similarities with
these models but more evolved.
BOPF is not a new framework. In fact, it is broadly used in multiple SAP applications and products i.e.
Transportation Management (TM), Environment, Health and Safety (EH&S), but still very few. Earlier this
was not available for customer development. Now it is released with SAP Business Suite EHP5 SP11,
SAP Business Suite EHP6 SP05, and SAP Business Suite EHP7 and available to customers for their own
development. Using BOPF, we get the whole application infrastructure and integration of various
components (i.e. with FPM, Workflow, SAPUI5, BRF+, PPF etc.). This allows us to rapidly build
applications on a stable and customer-proved infrastructure.
In a typical complex object we have a large ABAP team and the tasks are distributed among all the
developers. Here, it can be difficult to enforce best practices and ensure that each developer accesses
the object data properly. This is as a result of developers not understanding how to access the data. In
short, there's no overarching object model which ensures that business objects are accessed
consistently. Within the BOPF, everything has its place. Business data is modeled consistently in BO
nodes and attributes. Behaviors are defined as actions. Validations are performed automatically via
validation modules. Triggers can be defined using determinations. The relationships between BOs are
defined statically via associations.
BOPF Architecture
Consumer
The consumer is implemented as a user interface or an autonomous process participant. Frequently,
BOPF BOs will be consumed by UI applications such as WDA applications, etc.
Transaction Layer
Interactions with BOs within the BOPF are brokered through a centralized transaction layer which handles
low-level transaction handling details such as object locking, etc.From the perspective of the consumer
layer, interactions with the transaction layer consist of little more than a handful of intuitive API calls.
BOPF Model
The core of the BOPF functionality lies within the BOPF runtime. This layer contains all of the functionality
required to instantiate BOs, trigger their functionality, and so on. the BOPF runtime utilizes the BOPF
model definitions created at design time as metadata for instantiating BO instances, navigating BO
associations, etc.
Page 2
BOPF
Page 3
BOPF
Interaction
Phase
Save Phase
Cleanup Phase
Finalization
Check Before
Save
Save
/BOBF/CONF_UI:
BOPF_EWB:
Enhancement workbench
/BOBF/TEST_UI:
Nodes/Subnodes
Nodes are basic key of the BO. These are arranged hierarchically to model the various
dimensions of the BO data and organized underneath a single root node (much like XML). The
hierarchy can be nested arbitrarily deep depending upon business requirements.There are
several different node types supported by the BOPF. However,most of the time we will beworking
with persistent nodes (e.g. nodes which are backed by the database). It is also possible to
define transient nodes whose contents are loaded on demand at runtime. These types of nodes
Page 4
BOPF
can come in handy whenever we want to bridge some alternative persistence model (e.g. data
obtained via service calls).
Each node consists of one or more attributes which describe the type of data stored within the
node.Attributes come in two distinct varieties: persistent attributes and transient attributes.
Persistent attributes represent those attributes that will be persisted whenever the BO is
saved.Transient attributes are volatile attributes which are loaded on demand.Therefore a node's
attributes aredefined in terms of structure definitions from the ABAP Dictionary.
At runtime, a BO node is like a container which may have zero, one, or many rows like the
concept ofcontroller contexts with the Web Dynpro programming model.
Page 5
BOPF
Actions
Actions define the services (or behavior) of a BO and assigned to individual nodes within a BO. In
the below screenshot we have SAP defined action category.
The functionality provided by an action is defined in terms of an ABAP Objects class that
implements the /BOBF/IF_FRW_ACTION interface. Functioning of actions is more similar to the
methods of an ABAP Objects class. Implement the class if you want to add actions other than
standard (i.e. save, validate etc.)
Page 6
BOPF
Associations
Though BOs are designed to be self-contained, autonomous entities, they do not have to exist in
isolation. With associations, we can define a direct and unidirectional relationship from one BO to
another.
Here, the product assignments for sales order items is defined in terms of an association with a
product BO called /BOBF/DEMO_PRODUCT. This composition technique makes it possible to
not only leverage the product BOs data model, but also its behaviors, etc.
Page 7
BOPF
Determinations
According to the aforementioned BOPF enhancement guide, a determination "is an element
assigned to a business object node that describes internal changing business logic on the
business object".
In some respects, determinations are analogous to database triggers. In other words, they are
functions that are triggered whenever certain triggering conditions are fulfilled. These conditions
are described in terms of a series of patterns. i.e. "Derive dependent data immediately after
modification" or "Derive dependent data before saving" etc.
To get the above screen, right click on the INIT_ITEM_FIELDS and select Guided Procedure.
Page 8
BOPF
The logic within a determination is defined via an ABAP Objects class that implements the
/BOBF/IF_FRW_DETERMINATION interface.
Validations
As the name suggests, this node is used to check internal business logic on the business
object.Validations come in two distinct forms:
o
Page 9
BOPF
The validation logic is encapsulated within an ABAP Objects class that implements the
/BOBF/IF_FRW_VALIDATION interface.
Query
Queries are BO node entities which allow us to search for BOs using various types of search
criteria.Queries make it possible for consumers to access BOs without knowing the BO key up
front.Queries also integrate quite nicely with search frameworks. Queries come in two varieties:
o
Node Attribute Queries: Node attribute queries are modeled queries whose logic is
defined within the BOPF runtime. These simple queries can be used whenever you
simply need to search for BO nodes by their attributes (e.g. ID = '12345').
Page 10
BOPF
Custom Queries: Custom queries allow you define your own query logic by plugging in an
ABAP Objects class that implements the /BOBF/IF_FRW_QUERY interface.
Page 11
BOPF
An enhancement can only extend entities that are located in a base object and that are defined as
extensible. You can extend nodes with the following additional entities:
Subnodes
Attributes
Determinations
Actions
Consistency validation
Action validations
o Pre action enhancement
o Post action enhancement
BOPF Integration
We can integrate different components of business applications with BOPF. When using BOPF we dont
have to care about the development of adapters or integration layers. Below are some such components:
Dynpro:BOPF provides a standard interface for consumption by the classic Dynpro UI.
Floor Plan Manager (FPM):FPM is implemented as a Web Dynpro component and can be easily
integrated with BOPF, commonly known as FBI: FPM BOPF Integration. BOPF provides
configurable and codeless integration of FPM and enables you to seamlessly consume the
services of BOPF Business Objects in a modification-free environment.
SAPUI5:SAPUI5 is designed for building lightweight UIs for casual use.We have some integration
with BOPF to get the backend data.
Gateway (OData):SAP NetWeaver Gateway enables you to create and maintain data for
consumption by the web (HTML5) and mobile devices (iPhone and Blackberry).The BOPF
integration of the Gateway is based on REpresentational State Transfer (REST) and OData
standards, known as GBI: Gateway BOPF Integration.
Page 12
BOPF
Business Object Layer & GenIL:The Business Object Layer (BOL) provides a generic API for
accessing business data. The Generic Interaction Layer (GenIL) enables uniform access to
business data using a stateless request/response format. BOPF provides adapters for BOL and
GenIL integration.
Post Processing Workflow:With BOPF BOs, you can integrate business processes using the
Post Processing Workflow.
With a BOPF-specific expression type, it is possible to create BO data retrieval expressions in BRF+.
These expressions make data of BOs available in BRF+ environments that support any kind of rule
processing.
Reference
1. http://help.sap.com/saphelp_tm80/helpdata/en/0e/4a3aba521342f685bada9dabb32d5f/content.ht
m
2. http://scn.sap.com/community/abap/bopf
Page 13