BOPF For Beginners Part 1 Introduction
BOPF For Beginners Part 1 Introduction
Part 1 – Introduction
zapyard.com/bopf-for-beginners-part-1-introduction/
There are some technologies like HANA, Fiori, SAPUI5, OData, SAP Netweaver Gateway
etc which every ABAPer wants to learn and utilize. But in all those hypes, another framework
called BOPF is being neglected. In this article and in the future series, I would like to touch
base upon BOPF and how we can use it in real project scenarios. Although most of the
concepts would be for beginners, I am confident, even the seasoned BOPF consultants
would get few cents to take home for this BOPF series.
Introduction:
BOPF (Business Object Processing Framework) is a framework for working with the BO
(Business Objects). This framework provides tools and services for entire BO life cycle. BO
is a representation of a type of uniquely identifiable business entities described by a
structural model, an internal process model, and one or more service interfaces.
1/20
BOBF(Business Object Building framework) it’s not BOPF unlike the name of the
framework
BOB (Business Object Builder)
BOBT (BO Test)
BOBX(Business Object Enhancement Workbench)
Architecture:
The upper layer is the UI layer where it can be FPM (BOPF is tightly integrated with FPM) or
Fiori to display the data. And then comes the Transaction layer which gets instantiated
automatically whenever we interact with the BO, low-level transaction handling like lock
objects are handled by the transaction layer. So, whenever we call any BO internally it may
call many BO’s, all these are taken care by the BOPF framework. The next layer that is the
BOPF Object layer which doesn’t get instantiated automatically when we are out of the
framework like when we write the report we need to explicitly instantiate it but when we are
inside the framework we need not to instantiate it, the framework takes care of it. Database
layer consists of the data.
2/20
The BOPF framework consists of all BO (Business Object) like for example Sales order,
Outbound delivery, Inbound delivery (EWM Space) as an entity and that is modeled as a
business object. It will have a Structural model which consists of the header structure, item
structure, etc. When we go inside BOBF t-code we see standard BO delivered by SAP. Open
the demo sales order BO.
As we see the BO Demo Sales Order has Root node as ROOT (we can change the name if
we want when we build our own custom BO) and sub-node as ITEM, ROOT_LONG_TEXT,
ROOT_TEXT, CUSTOMER_BO. Under the Root node, we see there are different sub-nodes
with grey, green and green with a star each with a different meaning. Whenever we create
any custom node we get three option to select the type of the Node as shown below.
3/20
And you see they are Standard, Delegated and Business Object Representation Node.
The grey one is nothing but the Standard node, Green one are Delegated node and green
with a star are the Business Object Representation Node or the Cross BO node.
1. Standard node is the node which we create for Item detail under header as seen
above.
2. Delegated node is the dependent node which we can use as per our requirement,
things like Attachment folder, Text collection can be used in any particular node as and
when required.
3. Business Object Representation Node or Cross BO node are nodes of other BO as
the name says “CROSS”. The framework is well designed to integrate these
functionalities. All we need to know is the particular constant interface of the BO and
we are well to go which we will come to know as we work with BOPF.
4/20
We see under node elements the procedural elements (Node Elements) of the root node
which contains the business logic. The procedural models are Determinations, Actions,
Validations, etc. Clear separation between changing and checking business logic. Changing
logic is nothing but the determinations if something has happened to my application, I need
to react to it so there is something called an action and to validate the data whether it is
correct or not we have validations which are nothing but checking business logic. So there
is no mixing of both, all are separate. We have a separate section for everything.
Go to Transaction BOB:
We see here three BO Categories viz. Custom Business Object, SAP Business Object
and Business Object enhancements which are self-explanatory.
5/20
Click on Create Custom Business Object:
The next steps are simple for the creation of the BO, just provide the necessary names and
you are ready to go.
Provide the prefix, ignore the namespace (namespace is like you are working for a client and
you need your entire BO namespace to have the same name instead to be in Z namespace
then we buy the namespace from SAP).
6/20
Click continue
7/20
You find the Constant Interface name is already proposed, that’s the beauty of BOPF. You
can also change the name if you wish to do so. And then click continue.
By default, the name of the root node is Root (you can change if you wish). Provide the
description and the name of the Persistent and Transient structure (you can also click on
the Propose Name button and the framework gives you the name). Moreover, the Transient
structure is optional, you may leave it blank if you wish so but the Persistent structure is
mandatory to give.
As the name says the Transient structure is transient in nature i.e. it gets called at the
runtime.
Note – You need to have zpersistent and ztranscient structure (not table) in the database.
Else you would get an error like below.
Also Check – How to identify S/4HANA System from ABAP on HANA System?
Click continue…
8/20
The BOPF framework automatically proposes the Combined Structure, Table Type, and
Database Table name, however, you can change the name as per your choice in Z
namespace.
Click continue…
9/20
And finally, click Complete and your BO is created. As said earlier BOPF is more of
modeling and less of coding.
10/20
Click on the BO and you find all the details of your Business Object viz the structural model,
procedural model (Node Elements), constant interface, etc. We haven’t done any coding yet
and our BO got created with the database table unlike in traditional process we have to do
these manually.
11/20
When we open the DB table we find it has the key field generated automatically.
12/20
In BOPF we don’t create the key field. The framework itself created the key and the key is a
long 32 digit hexadecimal number. It is very difficult to remember but there is a way to handle
it. We have something called as alternative keys which we will look in our later tutorials.
In the next part, as per requirement, we can create our node structure i.e. we can add sub-
node of any of the three types specified above. Also, implement the Logic in the node
elements section. We will check how there is a clear separation of Business model and
Logic.
All the above steps are good case scenario. What if you face some issues in the Custom
BO Creation process? Check the below section which one of our team members faced
while doing the step by step tutorial above. You might find solutions in case you have similar
problems.
1. If you get “Business Object could not be created” message, do not worry.
13/20
Go to t-code BOBF and you would find your Business Object was created.
Look for Home Business Objects section (in above image). Double click on your Object. You
would find that the change icon is disabled.
14/20
How to enable the maintain/change of Business Object?
15/20
Magic!! The Display<>Change Icon is enabled.
Go to change mode. From Extras Menu -> Generate Repository Objects -> Generate
Dictionary Elements.
16/20
Hit the green tick mark.
17/20
The Data Dictionary Objects would be generated and activated.
Go to SE11 and check them. They are activated. If you happen to check them before
Generating the Repository Objects from the Extras Menu, then those SE11 objects would be
in NEW status, not Active.
18/20
Let us stop here today. Hope I was able to give you a fair introduction. BOPF is no Rocket
Science and it is not that complex as some say. We just need to understand some
fundamentals, then you would start loving the framework and appreciate it better.
As already revealed above, the next article would be more interesting with real project case.
We would create our Node Structure. Add Sub Nodes of types (Standard Node, Delegated
Node, and Business Object Representation Node). We would implement the logic in the
elements of the nodes and we would see how we can separate the business model and
logic. So, please stay tuned.
If you are already working in BOPF, please share your project use case. Let us know what
issue you faced and how you resolved.
19/20
We want to hear from you. Please Like, Share and Leave your Comments below.
20/20