0% found this document useful (0 votes)
2K views74 pages

SAP - BOPF Developer Guide: Warning

The document provides an overview of key concepts in SAP's Business Object Processing Framework (BOPF), including business objects, nodes, actions, alternative keys, and associations. Business objects are represented as hierarchical trees of nodes, each containing attributes and business logic. Actions implement services or behaviors for nodes. Alternative keys provide human-readable identifiers for nodes. Associations define relationships between nodes in different business objects.

Uploaded by

chiranjeevigiri
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)
2K views74 pages

SAP - BOPF Developer Guide: Warning

The document provides an overview of key concepts in SAP's Business Object Processing Framework (BOPF), including business objects, nodes, actions, alternative keys, and associations. Business objects are represented as hierarchical trees of nodes, each containing attributes and business logic. Actions implement services or behaviors for nodes. Alternative keys provide human-readable identifiers for nodes. Associations define relationships between nodes in different business objects.

Uploaded by

chiranjeevigiri
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/ 74

6/11/2020

SAP - BOPF Developer Guide


Generated on: 2020-06-11

SAP NetWeaver Application Server for ABAP 7.52 | SP01

PUBLIC

Original content: https://help.sap.com/viewer/aa7fc5c3c1524844b811735b9373252a/7.52.1/en-US

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/viewer/disclaimer.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 1/74
6/11/2020

Business Object Metadata Model


In BOPF, a business object is represented as a hierarchical tree of nodes. A single node includes a set of semantically related
attributes and the corresponding business logic. For each node, several types of entities can be de ned to describe the speci c
business logic part of the business object.

The following gure subsumes the elements of the business object metadata model and displays their relationship with each
other.

Figure 1: Elements of the business object metadata model

Related Information
Action
Alternative Keys
Association
Authorization Checks
Determination
Nodes
Validation
Query

Action
An action is an entity assigned to an individual node of a business object that is used to implement a service (operation or
behavior) of the business object.

Examples
You can use the RELEASE action to change the status of an invoice instance of the CUSTOMER_INVOICE business object. As a
result of this action execution, the status of the invoice can be set to RELEASED. Other examples of an action

RELEASE ORDER
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 2/74
6/11/2020
COPY SHEET

PUBLISH SALES_QUOTE

Triggers for Actions


In order for an action to be executed, the corresponding triggers are required. Actions are called actively either by

A service consumer, for example, by a User Interface

Another business object

Internally, for example, by another action or by a determination.

Categories of Actions
In general, BOPF provides the following categories for actions:

BO-Speci c Actions

BO-speci c actions must be created explicitly for the node that requires a speci c service implementation.

Such actions are called by a service consumer or another business object.

Framework Actions

Framework actions provide each BO node with core-services for which no implementation is required. They are
automatically generated by BOPF when a node of a business object is created and are used internally by the framework
itself. For each node, a framework action for create, update, delete, lock, unlock, validate and save is generated. Please note
that these actions are not visible in the node tree of the design-time but some of them are offered actions to be prevented
by an action validation.

Action Cardinality
You can perform an action on one or more node instances, or on no instance of the node. For this very purpose, you can assign the
cardinality to an action. The action cardinality de nes how many node instances the action can operate on during one action call.
You can choose the following cardinality types for actions:

Multiple Node Instances

Action operates on one or more node instances.

Single Node Instance

Action operates on exactly one single node instance.

No Node Instances

Action does not operate on any node instances and de nes a static action.

Action Implementation
An action is implemented in a global ABAP class that implements the corresponding action interface /BOBF/IF_FRW_ACTION.

When calling an action, the consumer must provide the following speci cations:

The key of node instances on which the action operates. (This speci cation only applies when the action operates on one
or more instances.) An action can only be performed with exactly that number of instances that is con gured in the
cardinality of the action.

 Note

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 3/74
6/11/2020
To prevent an action from operating on certain speci c instances, you can de ne an action validation.

Any input parameters that the action requires.

 Note
This speci cation only applies when the action has a parameter structure in its de nition.

In general, an action can have several importing parameters that the consumer passes to the implementation class during
runtime. All parameters are included in the so-called parameter structure.

More on this:

Understanding the Action API

Action Con guration


In addition, you can con gure each action with an exporting type. Using the exporting type parameter, you can specify whether
and if so what kind of data the action should be able to return to the caller during the action execution.

There are three options available:

None - This default option indicates that the action does not return any data to the consumer

Type - This option allows the action to return a data table de ned by the row type maintained in the eld Exporting
Parameter Structure and the corresponding table type maintained in the eld Exporting Parameter Table Type.

Node - This option allows the action to return instances of a foreign node that is de ned by the eld Exporting Parameter
Node and Exporting Parameter BO.

Alternative Keys
In BOPF, alternative keys are used to identify the node instances of business objects.

Alternative keys provide human-readable values for keys and are used, as the name implies, as an alternative to the technical, non-
readable UUIDs of node instances. An alternative key is de ned by an attribute or a set of attributes of a node that uniquely
identi es the corresponding subordinated node instances.

 Tip
In general, multiple alternative keys can be de ned for a single business object node.

Example 1

Let us assume that our customer invoice application needs to be identi ed by a human-readable invoice number (1 – 100.000) for
each single invoice. The key of the corresponding invoice node instance 0050562501281DDF97848577AF34366C obviously does
not meet this requirement. Therefore, a node’s attribute INVOICE_NUMBER that is intended to identify node instances perfectly
represents an unstructured unique alternative key. Consumers can query the technical key of a node instance using a certain
invoice number (for example, 4711).

Example 2

Assuming that a customer invoice instance has been created during the current transaction, you cannot look up the key of this
instance using a query. In such a case, however, you can use an alternative key instead. Unlike queries, alternative key calls can be
executed on BO data that have not been committed to the database yet.

Classi cation of Alternative Keys


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 4/74
6/11/2020
You can classify alternative keys as:

Structured and Unstructured

Alternative keys can be related to a single attribute (unstructured alternative key) or to multiple node attributes (structured
alternative key) of the same node.

Figure 2: Alternative Key

Uniqueness

Alternative keys can also be classi ed according to the uniqueness of their values:

Unique: This classi cation ensures that the value of the alternative key is unique ( for example: there can be only one
invoice root node instance with the invoice number 4711 ).

Unique if attributes not initial: This classi cation ensures that the value of the alternative key is unique if the value is not
initial (not null). This means:

For unstructured alternative keys : each alternative key value that is not initial is always unique, but there can be
some initial alternative keys, too.

For structured alternative keys: alternative key values are unique if all of their elds are lled with (non-initial )
values

Not unique: This classi cation ensures that more than one node instance can have identical alternative key values.

Getting Alternative Keys


Similar to queries, alternative keys provide an initial point of access for the consumer to look up business object node instances.
Unlike queries, alternative key calls can be executed on the Transactional Image

The following method call can be used by an internal consumer (for example, from within an action implementation) to retrieve
alternative keys:

/BOBF/IF_FRW_READ->CONVERT_ALTERN_KEY( )

In the following method call, the transaction service manager is used. This can be triggered by an external consumer - by a
REPORT or a UI component, for example :

/BOBF/IF_TRA_SERVICE_MANAGER->CONVERT_ALTERN_KEY( )

More on this:Method CONVERT_ALTERN_KEY

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 5/74
6/11/2020

Association
In BOPF, an association is used to de ne a direct and unidirectional relationship between two nodes.

You can use an association to navigate from a source node to a related target node. You can de ne associated nodes in one or
more business objects or business object enhancements. If you de ne associated nodes in more than one business object, you
de ne cross-business-object associations. In this way, associations allow you to integrate BOs together in complex assemblies -
according to the LEGO principle. In addition, you can use associations to create new node instances of subnode.

Association Type and Category


BOPF provides two different types of associations:

Figure 3: Composite Associations

Composite associations de ne the relationship from a parent node to a child node within the same tree node hierarchy. This type
of association includes the following categories:

Regular composition association

Specialization

Association with delegated node (dependent object)

Framework associations (link to framework nodes)

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 6/74
6/11/2020

Figure 4: General Associations

This type of association de nes the relationship between a source node and a target node across the tree node hierarchy of one
and the same BO or even between nodes of different BO trees (cross-BO association). The general associations include the
following categories:

Foreign key association / reverse foreign key association

Reverse specialization

Association “To_Parent”

Association “To_Root”

Cross-BO association

implementation-speci c association

Cardinality of Associations
The cardinality of an association expresses how the node instances may be involved in the relationship. It speci es the number of
node instances that are connected to a single source instance and is expressed with a lower bound and an upper bound in the
form: x..y (lower_bound..upper_bound).

You can assign the following values for an association’s cardinality between the source and the target node:

1 : 0..1

1:1

1 : 0..n

1 : 1..n

Figure 5: Cardinality in associations

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 7/74
6/11/2020

Modeling or Implementing Associations


You can provide the association’s logic in two different ways:

Using Association Binding (Recommended!)

The standard way to provide associations with business logic is to bind associations. This modelling approach is done by
declaration steps without any implementation effort.

Implementation

In some cases, however, it can happen that very speci c business logic is needed that is not covered by modelling capabilities. In
such a case, the implementation of a speci c association is necessary. The association is encapsulated within an ABAP class that
implements the association interface BOBF/IF_FRW_ASSOCIATION.

More on this: Understanding the Association API

Using the Association API


The method call can be used by an internal consumer (for example, out of an action implementation) to retrieve node keys and
node data by following an association:

/BOBF/IF_FRW_READ->RETRIEVE_BY_ASSOCIATION( )

In the following call of the RETRIEVE_BY_ASSOCIATION ( ) method, the service manager is used and can be triggered by an
external consumer - by a REPORT or a UI component, for example:

/BOBF/IF_TRA_SERVICE_MANAGER->RETRIEVE_BY_ASSOCIATION( )

Implementing an Association Class


The association is encapsulated within an ABAP class that implements the association interface BOBF/IF_FRW_ASSOCIATION.

More on this: Understanding the Association API

Authorization Checks
Business applications require an authorization concept for their data and for the operations on their data. Consequently, display
and update activities are allowed for authorized users only.

In BOPF, an authorization check is introduced as an entity of a business object node that is used for managing authorizations on
the node level. Using this authorization and role concept allows you to check whether a user is allowed to perform a certain activity
on the node instances or to manipulate certain node data.

Examples

Let us assume that in a customer invoice application the invoices with buyer_region AMERICAS must be visible solely for
authorized users. In addition, only authorized users should be able to change the status of invoices to PAID by executing the
INVOICE_PAID action.

Generic Authorization Concept in BOPF


BOPF provides a generic authorization concept for your applications built on top of business objects so that each display and
update activity can be protected by an authorization check.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 8/74
6/11/2020
Therefore, your application only has to…

1. Create an authorization object

2. Assign the authorization object to the appropriate business object node(s)

3. Map the authorization elds to the appropriate node data attributes

 Note
In your application, you do not have to implement any speci c authorization check coding as long as you accept the generic
authorization concept.

What does the generic concept stand for ?

The generic authorization concept in BOPF is based on the well-known concept of authorization objects and the AUTHORITY-
CHECK ABAP statement. However, the authorization objects that are going to be used in BOPF have to provide a speci c eld
pattern:

Authorization objects that are assigned to the respective node have to meet the following requirements:

The rst eld of the authorization object has to be ACTVT.

The second eld has to be BO_SERVICE.

Further elds to be checked can be de ned for the authorization object. All additional elds should be mapped to
attributes of the respective BO node.

Figure 6: Alternative Key

Basically, all BOPF core service requests ( RETRIEVE, RETRIEVE_BY_ASSOCIATION, CONVERT_ALTERN_KEY,


MODIFY, DO_ACTION, QUERY,…) are relevant for authorization checks and therefore can be checked for authorization
through the implementation of generic authorization.

The generic authorization concept differentiates between static and the instance-based authorization checks:

Static checks: Check whether the user has permission to perform a speci c activity (for example: DISPLAY ). The result
of a static check is independent from speci c data values.

Instance-based checks: Evaluate the node data and check whether the user has permission to display or change data
where an authorization-relevant attribute has a speci c value. The result of this check depends on the node data.

Therefore, the rst invoice example where buyer_region AMERICAS must be visible solely for authorized persons is handled
by an instance-based check, whereas the second example (invoices can be changed to status PAID solely by authorized persons)
is handled by a static check.

The static check utilizes the rst eld ACTVT and the second eld BO_SERVICE of an authorization object. The instance-based
check utilizes all authorization elds, especially the application-speci c ones like B_REGION .

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff813… 9/74
6/11/2020
Propagation to Sub Nodes

Even if authorization objects and elds are assigned to a speci c node within the BO hierarchy tree, at runtime the static and
instance-based checks will be propagated along the composition tree. Authorizations of higher-level nodes apply implicitly to their
compositions. For example, authorization checks that are con gured for the ROOT node will be propagated to ITEM node.
Therefore, the user is not allowed to display ITEM instances if he or she does not have display authorization for the ROOT node.

Runtime

The generic authorization runtime implementation consists of BOPF service manager and authorization handler, and the
authorization check library class. The latter one can be substituted by an application-speci c check class.

Implementing Application-Speci c Authorization Checks


More on this: Understanding the Authorization API

Determination
In BOPF, a determination is an entity of a business object node that is used to provide functions that are automatically executed as
soon as a certain trigger condition is ful lled. A determination is triggered internally on the basis of changes made to the node
instance of a business object. The trigger conditions are checked by BOPF at different points during the transaction cycle,
depending on the determination times and the changing operations on the relevant node instances. For each determination, it is
necessary to specify both the points of time and the changes that form the trigger condition. Changes can include creating,
updating, deleting, or loading node instances. You can use a determination primarily to compute data that is derived from the
values of other attributes. The determined attributes and the determining attributes of the trigger condition either belong to the
same node or to different nodes.

Example
If there is a change to the quantity of several products (items) in an invoice object instance, the amount attribute (the overall
price) for all relevant products has to be calculated again. To calculate this amount automatically, you have to extend the standard
change process for the invoice business object instances with the help of determination. The determination can then react to the
creation, the modi cation, the deletion, or the loading of an invoice item by deriving new values for the amount eld. For such an
example, the solution might look as follows:

After changing the quantity of invoice items, the trigger conditions of the CALCULATE_ITEM_AMOUNT determination and the
CALCULATE_TOTAL_AMOUNT determination are both ful lled. The CALCULATE_ITEM_AMOUNT determination calculates the
amount of the changed item (price x quantity), whereas the CALCULATE_TOTAL_AMOUNT determination sums up the amounts
of all items to the total amount of the invoice.

Determination Time and Triggers


Depending on the use case in question, BOPF checks the triggers of a determination at several points during the transaction.

A determination time de nes at what time in the transaction cycle the trigger condition of that determination should be evaluated.
For example, the re-calculation of the invoice amount should take place every time after a modi cation is performed
(determination time: After Modify), but only if there are instances of the ITEM node that were updated (trigger: Update).

The following list shows which trigger operations are evaluated at which determination times:

Table 1: The determination time and the triggers defines the trigger condition

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 10/74
6/11/2020

Trigger >
Create Update Delete Load Determine
---------------------------
----

Determination Time

After Modi cation X X X

Calculate Transient X X X X
Attributes

During Check and X


Determine

Before Save X X X

Draw Number X X X
During Save

During Save X X X

After Successful X X X
Save

After Cleanup X X X
Transaction

After Failed Save X X X

Determination Dependencies
If, in the example above, you do not de ne any dependencies between the determinations, the system might calculate the total
amount before the item amount. Therefore, you must specify the

CALCULATE_ITEM_AMOUNT determination as a predecessor of the CALCULATE_TOTAL_AMOUNT determination.

To specify whether a determination is a predecessor or a successor of another determination, you de ne a determination


dependency. If there is more than one determination to be executed, the dependencies of the determinations are considered when
BOPF checks the trigger conditions of determinations.

Example

The following dependency is de ned in such a way that the item amount is calculated before the total amount.

Node: Determination Dependency

ROOT: CALCULATE_TOTAL_AMOUNT Determination depends on CALCULATE_ITEM_AMOUNT

ROOT > ITEM: CALCULATE_ITEM_AMOUNT Determination must be executed before


CALCULATE_TOTAL_AMOUNT

Dependency de nes the execution order of determinations:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 11/74
6/11/2020

Figure 7: Dependencies between determinations

Examples of valid execution orders are:

4, 1, 3, 2, 5 (for example, the determination DET 2 is always executed before the execution of DET 5)

1, 2, 5, 4, 3 (for example, DET 1 is always executed before the execution of DET 2).

Determination Types
Depending on which category of nodes comes into play when executing determinations, there are two different determination
types available:

Transient Determination - Modi es only transient elds or nodes. For such determinations no locking is necessary.

Persistent Determination - Modi es transient and persistent elds or nodes. Here locking is necessary.

Implementing a Custom Determination Class


The determination logic is encapsulated within an ABAP class that implements the determination interface
/BOBF/IF_FRW_DETERMINATION.

More on this: Understanding the Determination API

Nodes
A node is a data structure consisting of a set of attributes. Attributes are either persistent or transient. Persistent attributes are
stored in a database table, whereas transient attributes are stored in the main memory of the system and are calculated during
the user session inside a determination, or an action, fro example.

Nodes are used to describe the data of a business object. A business object has exactly one root node with n subnodes. A
subnode, in turn, can have n subnodes, and so on. The hierarchy of the nodes is described by composition associations.A node is
identi ed by a Technical Key and, where necessary, by further business identi ers.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 12/74
6/11/2020

Figure 8: Tree representation of a business object

Examples
A business object that represents a sales order consists of three nodes - one root node called ROOT with two subnodes called
ITEM and NOTE:

ROOT [SO_ID, BUYER_PARTY_ID, SO_STATUS, …] - sales order header

ITEM [ITEM_POSITION, PRODUCT_ID, QUANTITY, …] - sales order items

NOTE [NOTE] - sales order notes

Node Artefacts
Persistent Structure: De nes the business attributes that are stored on the database

Transient Structure: De nes the business attributes that are calculated at runtime. The transient structure is optional.

Two further artefacts are generated automatically at design-time. They are relevant for framework processing and when BO
services are consumed:

Combined Structure: DDIC structure that includes a key structure (technical key), the persistent structure and the
transient structure if one is de ned.

Combined Table Type: DDIC table type using the Combined Structure as the row type

Finally, a database table is generated and assigned to a node. The table stores the persistent attributes together with the
corresponding technical keys and the client information.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 13/74
6/11/2020

Figure 9: Node artefacts

Node Default Values


The default values of nodes can be important, especially in the UI context of BOPF-based applications. For example, the user
should have access to prede ned values for currencies in a form already when creating a new invoice.

Such defaulting allows the consumer to pre- ll the form that is related to a new node instance. To use node defaulting, the
consumer must call the corresponding core services. The defaults can be consumed using the service manager. The service
manager provides several services used to return default node values for nodes, but also for action parameters and association
parameters. To calculate defaults of a certain node dynamically, a node class (class that is con gured as Node Class) is used. The
node class implements the RETRIEVE_DEFAULT_VALUES method of the node interface /BOBF/IF_FRW_NODE . Since the
default node instances are only cached temporarily, the modi cation and then the save call is necessary to store the default values
in the database.

Example

Figure 10: Sequence diagram for invoice creation based on node default values

Description

(1) The user of an invoice application opens a popup window to create an invoice. The corresponding UI provides a form for invoice
creation.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 14/74
6/11/2020
(2) The service manager of the invoice BO provides the invoice application with a new unique key for the invoice node instance to
be created.

(3) The invoice application retrieves the default values of this node instance key. The service manager calls the node class
instance of the corresponding node and executes the method RETRIEVE_DEFAULT_VALUES. This method is implemented by the
node class instance and is used to calculate the defaults of the related node instance.

(4) As a result of the last method execution, the export of the default data of the node instances to be defaulted is triggered. The
default values of node attributes are returned and displayed on the form. The user populates the form with all values required for
invoice creation and then (5) triggers a MODIFY( ) call to create the new instance. This modi cation call is necessary – otherwise
the new node instance will not be saved at the end of the transaction.

More on this: Understanding the Node API

Query
Queries provide the initial point of access to business objects. They are used by a consumer to look up business object instances
that match certain search criteria.

In BOPF, a query is a business object entity that is always assigned to a certain node. Queries never modify any node instance
data. The result of the query execution is a set of keys of all node instances that match the query criteria. In order to provide
various types of search criteria, a suitable lter structure can be associated with a query.

Example

Let us assume that an application for editing customer invoices (BO: CUSTOMER_INVOICE ) has to provide a screen for
displaying all overdue invoices. This requirement however can be implemented by means of a query entity
GET_OVERDUE_INVOICES located in the CUSTOMER_INVOICE business object that returns all overdue invoices in question.

Types of Queries

Build-in Queries … allow you to look up the node instances with the help of the attribute values.

There are two built-in queries available for nodes:

SELECT_ALL - This query is automatically generated for a node by the BOPF framework when the node
is created. It returns all node instances of the node to which the query is assigned. For this build-in query,
there is no lter structure de ned for selection.

SELECT_BY_ELEMENTS - Returns node instances of the relevant node according to the selection
parameters ( lter structure). Each attribute of the node in question can be used as a selection parameter.

Therefore, you can use this kind of built-in query whenever you only need to search for BO nodes by their
attributes (for example, for a node ID = '12345').

Custom Queries … must be created and implemented explicitly for a BO node

Custom queries allow you to implement application-speci c queries for any use case. You may need to
provide application-speci c queries if the logic of the build-in queries is not sufficient.

Example: GET_OVERDUE_INVOICES

For custom queries, you must code the entire query logic within a global ABAP class that implements the
interface / BOBF/IF_FRW_QUERY.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 15/74
6/11/2020
In addition, you have the option to assign an arbitrary lter structure and a result type for a custom
query:

Filter Structure: This is used to declare the structure of the lter criteria used in a query.

NOTE: This structure can be used for the range value selection by a generic UI to display an input form
that is based on a range table. As soon as the query is executed and the form is lled with selection data,
the corresponding parameter ( IT_SELECTION_PARAMETERS ) is passed at runtime. More: Method
QUERY

Result Type: This is used to adapt the result type that is returned by the query.

Using the Association API


The method call can be used by an external consumer (by a REPORT or a UI component, for example) to execute a query:

/BOBF/IF_TRA_SERVICE_MANAGER->QUERY( ).

Implementing a Custom Queries


The query logic is encapsulated within an ABAP class that implements the query interface /BOBF/IF_FRW_QUERY .

More on this: Understanding the Query API

Validation
In BOPF, a validation is an entity of a business object node that is triggered in certain situations to check various aspects of a given
set of node instances. In particular, it is used to either validate whether a speci c action can be executed on a given node instance
(action validations) or whether a set of node instances is consistent (consistency validations).

Validations never modify any node instance data but return the messages and keys of failed (inconsistent) node instances.

Action Validations
Action validations check whether an action can be carried out.

Therefore, an action validation refers to an individual action and is used to determine whether or not this particular action can be
executed on a set of node instances.

An action validation is executed when an action is called and before the action is executed. If a validation fails for certain instances,
then the action will not be executed on all those failed instances. Action validations return only messages and the keys of node
instances for which the action may not be executed.

Example

Using the RELEASE action of the CUSTOMER_INVOICE business object invoices can be set to the RELEASED status. However,
before an invoice is released, it must be approved. If a consumer calls the RELEASE action, the CHECK_RELEASE action validation
is automatically executed. It checks the node instances on which the RELEASE action has been called. Only instances that have
the APPROVED status are processed by the RELEASE action.

Invoking Action Validations Explicitly

Since the BOPF framework invokes action validations automatically whenever actions are invoked by a consumer (report, UI), it is
quite rare that you will have a need to invoke them directly. However, the /BOBF/IF_TRA_SERVICE_MANAGER interface provides
the CHECK_ACTION( ) method if you wish to do so:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 16/74
6/11/2020
Syntax:

/BOBF/IF_TRA_SERVICE_MANAGER->CHECK_ACTION( )

This method call checks whether an action can be executed or not.

Consistency Validations
Consistency validations check if a node instance is consistent regarding the consistency criteria imposed by the business
requirements. Such validations are called at pre-de ned points within the BOPF BO transaction cycle to ensure that BO nodes are
persisted in a consistent state. These points can be con gured for consistency validations. Each such validation con guration
contains a trigger condition that is checked by BOPF at several time points during the transaction. If the trigger condition is
ful lled, the consistency validation is executed. Otherwise, if there are inconsistent node instances, a consistency validation
behaves in one of the following ways:

The validation sends messages to the consumer

The validation sends messages to the consumer and prevents the transaction from being saved until the inconsistency is
corrected

The validation sends messages to the consumer and changes the consistency status.

Example

The CUSTOMER_INVOICE business object may contain several consistency validations to check if the items of an invoice are in a
consistent state. For example, one consistency validation checks if the quantity and price of each item are maintained. Another
consistency validation checks if the address of the buyer is valid. If it is not, the consistency validation prevents the transaction
from being saved to ensure that only consistent invoice instances can be saved.

Invoking Consistency Validations Explicitly

The consistency validations are executed after each modi cation of node data, depending on the con gured request nodes and
when the consistency check is explicitly triggered (for example, by the UI).

To invoke a consistency validation explicitly, you can use the corresponding methods that are provided by the
/BOBF/IF_TRA_SERVICE_MANAGER interface:

Syntax:

/BOBF/IF_TRA_SERVICE_MANAGER->CHECK_AND_DETERMINE( )

This method call performs a consistency check and also checks dependent determinations.

/BOBF/IF_TRA_SERVICE_MANAGER->CHECK_CONSISTENCY( )

This method performs the consistency check.

Implementing a Custom Validation Class


The validation logic is encapsulated within an ABAP class that implements the validation interface /BOBF/IF_FRW_VALIDATION.

More on this: Understanding the Validation API

Working with the BOPF API


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 17/74
6/11/2020
Although different types of BOPF entities need to implement different interfaces, they have common patterns and techniques for
implementing business logic. These common patterns are described in this chapter.

Consuming Business Objects


The way for accessing business objects follows a service layer pattern. That means that a business object is abstracted by a set of
common operations (such as RETRIEVE, EXECUTE_ACTION) that can be performed by its consumers. BOPF distinguishes
between internal and external consumption and de nes two kinds of APIs for this purpose:

Internal Access API for BO internal access

Service Manager API for accessing an external BO

Internal BO Access
IO_READ: An object that provides reading access to the instances of the business object. The most common uses of this
object are to read data using the RETRIEVE method or to navigate to an association using the
RETRIEVE_BY_ASSOCIATION method.

More: Reading Data Interface

IO_MODIFY: An object that provides modifying access to the instances of the business object. This includes direct
modi cations by the methods CREATE, UPDATE and DELETE but also indirect modi cations by the method
EXECUTE_ACTION.

More: Changing Data Interface

External BO Access
The so-called Service Manager API is used to consume services of an external business object.

Constants Interface
Since the APIs de ne common operations that are implemented by any business object, the signatures of these operations are
typed generically and the consumer needs to specify the actual BO entity that is to be addressed by the actual operation. For
example, in the signature of the RETRIEVE operation, the user needs to specify the actual node that is to be read. Or when calling
EXECUTE_ACTION, the user needs to specify the action that is to be called and the corresponding node to which this action is
assigned. A special constants interface plays a central role in specifying actual parts of a business object. The constants interface
de nes constants for all parts of a business object like nodes, actions, node attributes, and so on. Each single constant is
represented by a GUID for the internal framework handling. Please note that it’s not recommended to use the GUIDs directly in
your business object code because GUIDs can change whenever the business object model is changed.

io_read->retrieve(
EXPORTING
iv_node = <ci>=>sc_node-root "Constant to identify the root node of your BO

IMPORTING
...).

Reading Data
Reading BO data is one of the main tasks of business logic. The corresponding operations (for example, RETRIEVE) have an
exporting parameter called ET_DATA to receive the read data. Since this parameter is typed generically, it is important that the
consumer is using the correctly typed variables in their implementation that ts the read data. Correctly typed means you have to
use the Combined Table Type of the corresponding node.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 18/74
6/11/2020

DATA lt_root TYPE zcei_t_root. "Combined Table Type of the node

io_read->retrieve(
EXPORTING
iv_node = <ci>=>sc_node-root
it_key = it_key
IMPORTING
et_data = lt_root ).

Writing Data
Some of the BOPF entities - like actions and determinations - are able to change data. For a BO internal change the
implementation would call the operations CREATE, UPDATE, or DELETE on the IAO IO_MODIFY. CHANGE and UPDATE has a
generically typed IS_DATA parameter to take over the new values of the node instance. You have to work with a data reference of
the Combined Structure nodes in this case.

Messages
BOPF provides a new message container EO_MESSAGE for those entities that are meant to return messages. The most prominent
entity is validation. The message concept is based on ABAP class-based messages. An entity that needs to throw a message
instantiates a message object based on a class that inherits from /BOBF/CM_FRW and nally adds the message instance to the
messages container EO_MESSAGE. BOPF takes care that the message is returned to the service consumer. Please note that you
can’t rely on EO_MESSAGE being already initialized when the entity is executed. Therefore you have to use the method
/BOBF/CL_FRW_FACTORY=>GET_MESSAGE( ).

DATA lo_message type ref to zcm_my_messages "Class inherits from /BOBF/CM_FRW


IF problem found.
CREATE OBJECT lo_message
EXPORTING
textid = zcm_my_messages=>something_is_wrong
severity = zcm_my_messages=>co_severity_error
ms_origin_location = ls_erro_location
... .
IF eo_message IS NOT BOUND.
eo_message = /bobf/cl_frw_factory=>get_message( ).
ENDIF.
eo_message->add_cm( lo_message )
ENDIF.

When instantiating the message object, you have to specify the error text severity and an original location where you can provide
speci c information about the error location. For example, in the case of an inconsistent attribute value, the UI is able to point to
the attribute that is inconsistent. BOPF message objects have some other parameters in the constructor that are described here.

Related Information
Understanding the Action API
Understanding the Association API
Understanding the Authorization API
Understanding the Determination API
Understanding the Node API
Understanding the Query API
Understanding the Validation API

Understanding the Action API


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 19/74
6/11/2020
An action in BOPF is de ned as a global ABAP class that implements the action interface /BOBF/IF_FRW_ACTION.

/BOBF/IF_FRW_ACTION

This interface de nes methods for action execution in BOPF. Each ABAP class that represents an action in an application at
runtime must implement this interface.

Method Summary
Deprecated

Do not implement the methods

RETRIEVE_DEFAULT_PARAM

PREPARE

Method Description

RETRIEVE_DEFAULT_PARAM Deprecated!

PREPARE Deprecated!

EXECUTE Carries out the action at runtime

Method Details
Method RETRIEVE_DEFAULT_PARAM

Method PREPARE

Method EXECUTE

Method RETRIEVE_DEFAULT_PARAM
Retrieves the default parameters if a parameter structure is de ned for the action

Deprecated

Do not use this method!

Method PREPARE
Allows you to enlarge the set of keys for which the action is executed

Deprecated

Do not use this method!

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 20/74
6/11/2020

Method EXECUTE
Carries out the action at runtime

The execution of this mandatory method results in the possible modi cation of node data, both of the action's BOs and nodes
that belong to other BOs.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_ACT

IT_KEY type /BOBF/T_FRW_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY

IS_PARAMETERS type ref to DATA

exporting EO_MESSAGE type ref to /BOPF/IF_FRW_MESSAGE

ET_FAILED_KEY type /BOBF/T_FRW_KEY

ET_DATA type INDEX TABLE

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides context information of the action

More: Action Context IS_CTX

IT_KEY Set of keys of the node instances on which the action is to be performed

IO_READ Provides read access to the business object

More : Reading Data Interface

IO_MODIFY Provides write access to the business objects

More : Changing Data Interface

IS_PARAMETERS Provides the parameters of the action call. These parameters are supplied by the service consumer.

EO_MESSAGE Message container to return information, warning or error messages from the implementation

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 21/74
6/11/2020

Parameter Description

ET_FAILED _KEY Set of node instance keys, for which the action execution failed

 Note
The parameter ET_FAILED_KEY must only be provided in the case of technical errors (for example of
a not successful attempt to lock nodes).

ET_DATA The exporting type parameter speci es whether and if so what kind of data the action should be able to
return to the caller during the action execution.

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Example
The following source code is used to implement the PUBLISH action of the business object SALES_QUOTE. A consumer can use
this action to mark the sales quotation as published.

METHOD /bobf/if_frw_action~execute.

DATA lr_root TYPE REF TO zbo_s_root. " Combined structure of the BO


DATA lt_changed_fields TYPE /bobf/t_frw_name.
DATA ls_key TYPE /bobf/s_frw_key.

* To prepare update information, create the data reference for the root node
CREATE DATA lr_root.

* Set the ATTRIBUTE quote_status to new value


lr_root->quote_status = 'P'. "Published

APPEND zif_bo_sales_quote_c=>sc_node_attribute-root-quote_status TO lt_changed_fields.

* Read the keys for all node instances that are processed by the action
LOOP AT it_key INTO ls_key.

* Use io_modify to update the node instance


io_modify->update(
EXPORTING
iv_node = zif_bo_sales_quote_c=>sc_node-root
iv_key = ls_key-key
is_data = lr_root
it_changed_fields = lt_changed_fields ).
ENDLOOP.

ENDMETHOD.

Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 22/74
6/11/2020
For the implementation of the PUBLISH action only the EXECUTE method is used here. As in most cases, the rst step within the
EXECUTE method is to retrieve relevant data of those node instances that are going to be changed. Remember, a ll attributes of
the root node are represented by the combined structure’s components.

For this purpose, a data reference for the root node lr_root is used, where lr_root refers to the combined structure zbo_s_root .
This enables you to access the root node attribute quote_status and then set a new value 'P' that indicates that the node instance
is set to status PUBLISHED.

In the second step, the internal table lt_changed_ elds is populated with attributes that are going to be updated. Like all other
entity names, the attribute names, too, are available through the Constants Interface zif_bo_sales_quote_c .

The keys of the node instances that need to be processed and thus need to be read are managed by the EXECUTE method’s
importing parameter it_key . It contains the keys of all node instances on which the action should be applied. For each relevant
node instance, the update method of the access object io_modify is called.

Understanding the Association API


The association API interface is used by BOPF to resolve implemented associations and, if this association has the property
“create enabled”, to create node instances. The association implementation itself belongs to the consumer application, which
must implement the interface BOBF/IF_FRW_ASSOCIATION.

Both methods of this interface have to be implemented to prevent a runtime error. Each method implementation must include at
least the METHOD/ENDMETHOD statements.

/BOBF/IF_FRW_ASSOCIATION

This interface de nes the following methods for creating and resolving associations in BOPF.

Method Summary

Method Description

CREATE Creates an instance of a target node using an implemented association

RESOLVE Resolves an association that has been implemented by the application

METHOD DETAILS
Method CREATE

Method RESOLVE

Method CREATE
Creates an instance of a target node using an implemented association

The execution of the method results in the creation of a node instance. When implementing the method, you also have the option
to initialize certain elds of the node data with prede ned values, such as indicator or type code elds.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 23/74
6/11/2020

Prerequisites:
This method is only called if the association has the property create enabled

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_ASSOC

IT_MODIFICATION type /BOBF/T_FRW_MODIFICATION

IO_READ type ref to /BOBF/IF_FRW_READ

IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY

exporting EO_MESSAGE type ref to /BOPF/IF_FRW_MESSAGE

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides context information for associations

IT_MODIFICATION Table type used for changes to be executed when creating an instance of a target node

IO_READ Object that provides reading access to the instances of the business object

More: Reading Data Interface

IO_MODIFY Object that provides writing access to the instances of the business object

More: Changing Data Interface

EO_MESSAGE Message container to return information, warning, or error messages from the implementation

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Method RESOLVE
Resolves an association that has been implemented by the application

The result of the method execution is a link table that assigns the target node instance keys to the source node instance keys.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 24/74
6/11/2020

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_ASSOC

IT_KEY type /BOBF/T_FRW_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

IS_PARAMETERS type ref to DATA

IT_FILTERED_ATTRIBUTES type /BOPF/IF_FRW_NAME

exporting ET_KEY_LINK type /BOPF/IF_FRW_KEY_LINK

ET_FAILED_KEY type /BOBF/T_FRW_KEY

EO_MESSAGE type ref to /BOPF/IF_FRW_MESSAGE

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides context information of the association

IT_KEY Set of keys of the node instances for which the association is to be resolved

IO_READ Object that provides reading access to the instances of the business object

More: Reading Data Interface

IS_PARAMETERS Provides the parameters that are used when resolving the association between node instances

These parameters are supplied by the service consumer.

- Optional parameter

IT_FILTERED_ATTRIBUTES List of eld names that are relevant for association resolution

- Optional parameter

Link table that assigns the target node instance keys to the source node instance keys
ET_KEY_LINK

ET_FAILED_KEY Set of node instance keys (subset of IT_KEY ) that do not match the criteria for association resolution

EO_MESSAGE Message object used for returning information, warning, or error messages related to association
resolution

Exceptions

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 25/74
6/11/2020

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Understanding the Authorization API


Extending the Generic Authorization Concept
To rede ne the behavior of the standard implementation of authorization checks, you can substitute the authorization check
library class /BOBF/CL_LIB_AUTHCHECK_W_QUERY by an application-speci c check class. In such a case, you must rede ne
the respective methods of the interfaces /BOBF/IF_LIB_AUTH_CUSTOMIZER and /BOBF/IF_LIB_AUTH_CUSTOM_GEN.

Figure 11: Authorization class

More on this : Class /BOBF/CL_LIB_AUTHCHECK_W_QUERY

Implementing Own Authorization Checks


In rare cases, it might be necessary to implement a completely different authorization concept - for example, if the Access Control
Lists are used instead of standard authorization objects. To achieve this, you can implement an application-speci c class that
inherits from the abstract authorization check superclass /BOBF/CL_FRW_AUTHORITY_CHECK .

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 26/74
6/11/2020

Figure 12: Authorization checks

More on this: Class /BOBF/CL_FRW_AUTHORITY_CHECK

Class
/BOBF/CL_LIB_AUTHCHECK_W_QUERY
This class provides a default implementation of the authorization concept including queries. It inherits from the abstract class
/BOBF/CL_FRW_AUTHORITY_CHECK.

Use of BO Metadata
The implementation takes the authorization-relevant metadata of the business object node into account. This includes both the
assigned authorization objects and the authorization eld mapping.

 Note
Authorization objects that are assigned to the respective node have to meet the following requirements:

First eld has to be ACTVT

Second eld has to be BO_SERVICE

Additional elds can be de ned; all additional elds should be mapped to attributes of the BO node.

Implementing Application-Speci c Logic


/BOBF/CL_LIB_AUTHCHECK_W_QUERY is not de ned as a nal class. Therefore, subclasses can be derived to provide
application-speci c implementation. A new ABAP class that inherits from this must rede ne the respective methods of the
interfaces /BOBF/IF_LIB_AUTH_CUSTOM_GEN and /BOBF/IF_LIB_AUTH_CUSTOMIZER.

In this way, you can change the runtime behavior (compared with the generic authorization concept), for example, by …

Rede ning both static elds ACTVT and BO_SERVICE of the authorization object

Example: For querying node data, use activity display instead of query.

Suppressing authorization propagation

Example: For retrieving items, check authority only on item node instead of item and root node

Sending application-speci c messages in the case of authorization denied


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 27/74
6/11/2020

Class
/BOBF/CL_FRW_AUTHORITY_CHECK
This abstract class is the superclass of the authorization check classes and acts as an interface de nition when you implement
your own authorization concept in BOPF.

Each application-speci c authorization check class can inherit directly from this class (requires complete implementation) or
from one of the subclasses (allows rede nition of particular methods).

A default implementation is provided with the class /BOBF/CL_LIB_AUTHCHECK_W_QUERY.

This class de nes all instance attributes, constants, and methods for authorization check execution.

Instance Attributes

Instance Attribute Description

Represents the BO key for which the authorization is con gured


MV_BO_KEY

Represents the (authority) node for which the instance of the authorization check class has been
MV_NODE_KEY
created

MO_FACTORY Provides access to instances of another authorization check class in order to propagate authorization
checks from subnodes to superior nodes

Constants

Constant Description

SC_ACTIVITY Speci es all activity types (create, change, display, … ) that are used by the framework in order to check
the authorization

Supplement that speci es extended context information about the situation in which the authorization
SC_ACTIVITY_SUPPLEMENT
check is called

For example, the value RBA_SOURCE_NODE is set as a supplement if the


RETRIEVE_BY_ASSOCIATION service is executed and authority has to be checked for the source
node.

SC_AUTHORITY_FIELD Speci es the BOPF-speci c authorization elds ( ACTVT and BO_SERVICE )

Method Summary

Method Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 28/74
6/11/2020

Method Description

CHECK_AUTHORITY Executes the static and instance-based authorization check

CHECK_AUTHORITY _STATICALY Executes the static authorization check

GET_QUERY_CONDITION_PROVIDER Returns the authority condition provider to execute query based on SADL

Method Details
Method CHECK_AUTHORITY

Method CHECK_AUTHORITY_STATICALY

Method GET_QUERY_CONDITION_PROVIDER

Method CHECK_AUTHORITY
Executes the static and instance-based authorization check

This method is usually called by the BOPF framework when a core service is executed and the static authorization check has
already been passed successfully.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_AUTH

IT_KEY type /BOBF/T_FRW_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

exporting ET_FAILED_KEY type /BOBF /T_FRW_KEY

EO_MESSAGE type ref to /BOBF /T_FRW_MESSAGE

Parameters

Parameter Description

IS_CTX Provides model information of the authorization (authorization context)

More: Authorization Context IS_CTX

IT_KEY Set of keys for node instances for which the authorization check is to be executed

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 29/74
6/11/2020

Parameter Description

IO_READ Reference that provides read access to the data of the business object instances

More: Reading Data Interface

ET_FAILED _KEY Set of keys for node instances (subset of IT_KEY) that do not match the criteria for authorization
checks

EO_MESSAGE Message object used for returning information, warning, or error messages related to the authorization
check execution

Method CHECK_AUTHORITY_STATICALY
Executes the static authorization check

This method is usually called before the execution of a BOPF core service in order to check whether the user has authorization to
execute the service at all.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_AUTH

exporting EV_FAILED type BOOL_D

EO_MESSAGE type ref to /BOBF /T_FRW_MESSAGE

Parameters

Parameter Description

IS_CTX Provides model information of the authorization (authorization context)

More: Authorization Context IS_CTX

ET_FAILED Set of keys for node instances (subset of IT_KEY) that do not match the criteria for authorization
checks

EO_MESSAGE Message object used for returning information, warning, or error messages related to the authorization
check execution

Method
GET_QUERY_CONDITION_PROVIDER
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 30/74
6/11/2020
Returns the authority condition provider for executing a query based on SADL

This method returns a SADL query condition provider, which adds the authorization conditions to a query in order to enable
execution of authorization checks directly on the database level. The query condition provider is needed for execution of generic
queries for which no implementation class is de ned (usually SELECT_ALL or SELECT_BY_ELEMENTS queries).

 Note
As a consequence, queries always have to be implemented if it is not possible to return a query condition provider. Such a
situation may occur if the authorization checks are not completely modeled. An example for this would be an authorization
eld mapping that uses an implemented association. The implemented association cannot be resolved by the database. The
query implementation has to take care of authorization checks in this case.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_AUTH

returning value RO_PROVIDER type ref to IF_SADL_COND_PROVIDER_AUTHS

Parameters

Parameter Description

IS_CTX Provides model information of the authorization (authorization context)

More: Authorization Context IS_CTX

Instance of the SADL query authorization condition provider, which adds the authorization conditions to
RO_PROVIDER
a query

 Note
SADL supports the concept of authorization condition providers. Such providers are objects that are
responsible for reading the metadata of business objects, evaluating the authorizations of the active
users, and transforming the result into suitable restriction information for the database selection.

Understanding the Determination API


A determination in BOPF is de ned as a global ABAP class that implements the action interface
/BOBF/IF_FRW_DETERMINATION.

/BOBF/IF_FRW_DETERMINATION

This interface de nes methods for action execution in BOPF. Each ABAP class that represents an action in an application at
runtime must implement this interface.

The determinations are executed after each modi cation of node data, depending on the con guration. See also: Determination
Time and Triggers

Method Summary

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 31/74
6/11/2020
Deprecated

Do not implement the methods

CHECK_DELTA

CHECK

Method Description

CHECK_DELTA Deprecated!

CHECK Deprecated!

EXECUTE Carries out the validation at runtime

The method execution can modify the data of node instances.

METHOD DETAILS
Method CHECK_DELTA

Method CHECK

Method EXECUTE

Method CHECK_DELTA
Checks the relevance of node instances for the execution of a determination based on changes made since the last determination
run

Deprecated

Do not use this method!

Method CHECK
Checks the relevance of node instances for the execution of a determination based on attribute values, independently of change
independently of changes

Deprecated

Do not use this method!

Method EXECUTE
Carries out the determination at runtime

This mandatory method implements the main determination logic. It provides modi cation access to the node’s instance data and
returns the messages and the keys of failed node instances (instances for which the determination cannot be executed).

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 32/74
6/11/2020

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_DET

IT_KEY type /BOBF/T_FRW_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY

exporting EO_MESSAGE type ref to /BOBF/T_FRW_MESSAGE

ET_FAILED_KEY type /BOBF/T_FRW_KEY

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides model information of the determination (determination context)

More: Determination Context IS_CTX

IT_KEY Set of node instance keys that are to be processed by the determination

IO_READ Reference that provides read access to the data of the business object instances

More: Reading Data Interface

IO_MODIFY Reference that provides write access to the data of the business object instances

More: Changing Data Interface

EO_MESSAGE Message object used for returning information, warning, or error messages related to the determination
execution

More: Message Object Interface

ET_FAILED _KEY Set of node instance keys (subset of IT_KEY) that do not match the determination criteria

 Note
The parameter ET_FAILED_KEY must only be lled in case of technical errors (for example, a not
successful attempt to lock nodes). It cannot be used to control the transactional behavior like the
execution of succeeding determinations.

Exceptions

Exception Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 33/74
6/11/2020

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Example

METHOD /bobf/if_frw_determination~execute.

DATA lt_item_data TYPE zci_t_item.


DATA lr_item_data TYPE REF TO zci_s_item.

* For the customer invoice retrieve its ITEM nodes


io_read->retrieve(
EXPORTING
iv_node = zif_ci_customer_invoice_c=>sc_node-item
it_key = it_key
IMPORTING
et_data = lt_item_data ).

* Calculate the amount (= price x quantity) for each item


LOOP AT lt_item_data REFERENCE INTO lr_item_data.
lr_item_data->amount = lr_item_data->price * lr_item_data->quantity.

* Update the customer invoice with calculated amount


io_modify->update(
EXPORTING
iv_node = zif_ci_customer_invoice_c=>sc_node-item
iv_key = lr_item_data->key
is_data = lr_item_data ).
ENDLOOP.

ENDMETHOD.

Description:

In this sample code, the execute() method implements a determination that is called when data of a customer invoice item is
updated.

The reading access object io_read is used to retrieve the item instances of the customer invoice business object. Within the
LOOP statement, the new amount value is calculated for each relevant item instance by applying the formula: amount =
price x quantity. To update the data of the invoice items for each relevant node instance, the update method of the access
object io_modify is called.

Understanding the Node API


A node of a business object in BOPF is de ned as a global ABAP class that implements the node interface /BOBF/IF_FRW_NODE.

/BOBF/IF_FRW_NODE

This interface de nes methods for operating with node instances in BOPF.

You can use this interface to calculate default values of node attributes at runtime. Providing default values of nodes can be
important, especially in the UI context of BOPF-based applications.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 34/74
6/11/2020

Method Summary
Obsolete

Do not implement the SET_NODE_CATEGORY method in the context of ABAP Development Tools!

Method Description

RETRIEVE_DEFAULT_VALUES Returns default values of a node instance

Obsolete!
SET_NODE_CATEGORY

METHOD DETAILS
Method RETRIEVE_DEFAULT_VALUES

Method SET_NODE_CATEGORY

Method RETRIEVE_DEFAULT_VALUES
Returns the default value set of a node instance

If the node instance belongs to a subnode, the association and its parameters IS_ASSOC_PARAMETERS, and the list of eld
names IT_ASSOC_FILTERED_ATTRIBUTES can also be speci ed.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_ASSOC

IT_KEY type /BOBF/T_FRW_KEY

IS_ASSOC_PARAMETERS type ref to DATA

IT_ASSOC_FILTERED_ATTRIBUTES type /BOBF/T_FRW_NAME

IV_SOURCE_NODE_KEY type /BOBF/OBM_NODE_KEY

IV_SOURCE_KEY type /BOBF/CONF_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

IO_MODIFY type ref to /BOBF/IF_FRW_MODIFY

exporting EO_MESSAGE type ref to /BOBF/T_FRW_MESSAGE

raising /BOBF/CX_FRW

Parameters

Parameter Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 35/74
6/11/2020

Parameter Description

IS_CTX Provides context information for the default values. (Default values of a node instance are context-
dependent.)

IT_KEY Table with technical keys of the node instances for which the default value set is to be retrieved

- Optional parameter

IS_ASSOC_PARAMETERS Parameters of an association that are used when creating node instances with default values

- Optional parameter

IT_ASSOC_FILTERED_ATTRIBUTES List of eld names that are relevant for association resolution

- Optional parameter

IV_SOURCE_NODE_KEY Source node of the association

- Optional parameter

IV_SOURCE_KEY Source node key of the association

- Optional parameter

IO_READ Provides read access to the data of the business object

More: Reading Data Interface

Provides write access to the data of the relevant business object instances
IO_MODIFY
More: Changing Data Interface

EO_MESSAGE Message object used for returning information, warning, or error messages related to node value
retrieval

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Example
The following source code demonstrates how this method is used to set a default currency code (in our example: EUR) as a default
value when creating a new invoice.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 36/74
6/11/2020

METHOD /BOBF/IF_FRW_NODE~RETRIEVE_DEFAULT_VALUES.

DATA ls_key TYPE /bobf/s_frw_key.


DATA lt_to_fill TYPE zbo_t_root.
DATA ls_to_fill TYPE zbo_s_root.
DATA lv_ref_data TYPE REF TO zbo_s_root. " Combined structure of the BO

io_read->retrieve(
EXPORTING
iv_node = zif_bo_currency_code_c=>sc_node-root
it_key = it_key
IMPORTING
et_data = lt_to_fill ).

* Data reference that is typed with node’s Combined Structure


DATA ls_fill TYPE REF TO zbo_s_root.

LOOP AT lt_to_fill INTO ls_to_fill.

ls_to_fill-currency_code = ‘EUR’.

* Node instance data for update


CREATE DATA ls_fill.
ls_fill->* = ls_to_fill.

io_modify->update(
EXPORTING
iv_node = zif_bo_currency_code_c=>sc_node-root
iv_key = ls_to_fill-key
is_data = ls_fill ).

ENDLOOP.

ENDMETHOD.

Description

The BO access object io_read provides read access to the node instances of the invoice business object by calling the retrieve( )
method. This method exports the data of the root node instances to be defaulted from the buffer.

All attributes of the root node are represented by the combined structure’s components. This enables you to access the root node
attribute currency_code and set the value 'EUR' as the default value for the node instance.

For each relevant node instance, the update( ) method of the access object io_modify is called.

As a result of the method call, the node instance data is updated in the buffer.

Method SET_NODE_CATEGORY
Deprecated / Obsolete

Do not use this method!

Understanding the Query API


A query in BOPF is de ned as a global ABAP class that implements the query interface /BOBF/IF_FRW_QUERY.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 37/74
6/11/2020
/BOBF/IF_FRW_QUERY

This interface de nes methods for action execution in BOPF.

Method Summary

Method Description

QUERY Executes the query logic

RETRIEVE_DEFAULT_PARAM Returns the default values for parameters of a query

- Optional method

METHOD DETAILS
Method QUERY

Method RETRIEVE_DEFAULT_PARAM

Method QUERY
Executes the query logic

The result of the method execution is a set of keys of the node instances that match the selection parameters.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_QUERY

IT_FILTER_KEY type /BOBF/T_FRW_KEY

IT_SELECTION_PARAMETERS type /BOBF/T_FRW_QUERY_SELPARAM

IO_QUERY_AUTHORITIES type ref to /BOBF/IF_FRW_AUTHORITY_QUERY

IS_QUERY_OPTIONS type /BOBF/S_FRW_QUERY_OPTIONS

IO_QUERY type ref to /BOBF/IF_FRW_QUERY

IO_READ type ref to /BOBF/IF_FRW_READ

IO_MIDIFY type ref to /BOBF/IF_FRW_MODIFY

IV_FILL_DATA type BOOLE_D

IT_REQUESTED_ATTRIBUTES type /BOBF/T_FRW_NAME

exporting EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

ET_KEY type /BOBF/T_FRW_KEY

ES_QUERY_INFO type /BOBF/S_FRW_QUERY_INFO

ET_DATA type INDEX TABLE

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 38/74
6/11/2020
raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides the context information of a query (BO key, key of root node, key of assigned node, …)

IT_FILTER_KEY Table with keys for a limited set of node instances that are to be affected by the query execution. When
this optional parameter is used, the service consumer is able to specify a type of ltering.

If this parameter is empty, all node instances (that are assigned to the query) are affected by the query.

- Optional parameter

IT_SELECTION_PARAMETERS Represents a range table of attributes of the query lter structure

Using this parameter, you can specify (limit) a value range for dynamic query selections.

- Optional parameter

IO_QUERY_AUTHORITIES Represents the authority object that provides information for authority checks of the query

- Optional parameter

IS_QUERY_OPTIONS Structure that provides the query options. It includes the following components:

MAXIMUM_ROWS – Speci es the m aximum number of node instances to be returned by the


query. In the case of activated paging: the number of node instances of a single page.

SORTING_OPTIONS – You can use this option to specify the sorting of results. It consists of a
table that allows you to specify the sort order (ascending/descending) for the attributes.

PAGING_OPTIONS – You can use this option to change the paging. For example, it allows you to
de ne the top instance of the current page, either by a row (START_ROW ) or by an instance key
(START_KEY )

- Optional parameter

IO_QUERY Represents the query object that allows execution of the query

IO_READ Provides read access to the data of business object instances

More: Reading Data Interface

Provides write access to the data of business object instances


IO_MODIFY
More: Reading Data Interface

- Optional parameter

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 39/74
6/11/2020

Parameter Description

IV_FILL_DATA Indicates that the node data is to be read. If true, ET_DATA holds the read node data - including all
attributes. If false, only the attribute key is returned in table ET_DATA .

- Default value = ABAP_FALSE

IT_REQUESTED_ATTRIBUTES List of names (attribute names)

- Optional parameter

EO_MESSAGE M essage object that contains all messages that are generated during query execution

More: Reading Data Interface

Set of keys of the node instances for which the query has been executed (result of the query)
ET_KEY
Note: This parameter is not provided if IV_FILL_DATA is set to false.

ES_QUERY_INFO Structure that provides query-related information. It comprises the following components:

COUNT – Total number of results

QUERY_HANDLE – Handle to identify the context

ET_DATA Table of node data that is returned as a result of the query execution

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Example

METHOD /bobf/if_frw_query~query.

DATA: lt_sel_parameters TYPE /bobf/t_frw_query_selparam,


ls_sel_parameters TYPE /bobf/s_frw_query_selparam.

CLEAR: eo_message, et_key, es_query_info, et_data.

* Prepare selection condition


ls_sel_parameters-sign = 'I'.
ls_sel_parameters-option = 'EQ'.

* Payment status: '01' (not paid)


ls_sel_parameters-attribute_name = <ci>=>sc_node_attribute-root-payment_status.
ls_sel_parameters-low = '01'.

APPEND ls_sel_parameters TO lt_sel_parameters.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 40/74
6/11/2020

io_query->query(
EXPORTING
is_ctx = is_ctx
it_filter_key = it_filter_key
it_selection_parameters = lt_sel_parameters
io_query_authorities = io_query_authorities
is_query_options = is_query_options
io_query = io_query
io_read = io_read
io_modify = io_modify
iv_fill_data = 'X'
it_requested_attributes = it_requested_attributes
IMPORTING
eo_message = eo_message
et_key = et_key
es_query_info = es_query_info
et_data = et_data
).
ENDMETHOD.

Description:

In this sample code, the query() method implements the query GET_OVERDUE_INVOICES that is used to return all invoices of
the CUSTOMER_INVOICE business object that are not yet paid.

The data object ls_sel_parameters is used to specify the parameters (value range) for query selection. The constant interface <
ci > of the BO is used to retrieve the payment status of invoices. In this case, the payment status is de ned as an attribute of the
BO root node. All selection parameters are then appended to the internal table lt_sel_parameters , which, in turn, passes a
value range for dynamic query selections to query() method. The query object io_query carries out the actual query.

Method RETRIEVE_DEFAULT_PARAM
Returns the default value set of a node instance

You can implement this optional method to provide the service consumer with default parameters for query selection.

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_QUERY

changing CT_SELECTION_PARAMETERS type /BOBF/T_FRW_QUERY_SELPARAM

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides context (model) information for the query

CT_SELECTION_PARAMETERS Parameters of a query selection that are prede ned with default values

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 41/74
6/11/2020

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

Understanding the Validation API


A validation in BOPF is de ned as a global ABAP class that implements the validation interface /BOBF/IF_FRW_VALIDATION.

/BOBF/IF_FRW_VALIDATION

This interface de nes methods for validation execution in BOPF. Each ABAP class that represents a validation must implement
this interface.

Method Summary
Deprecated

Do not implement the methods

CHECK_DELTA

CHECK

Method Description

CHECK_DELTA Deprecated!

CHECK Deprecated!

EXECUTE Carries out the validation at runtime

Method Details
Method CHECK_DELTA

Method CHECK

Method EXECUTE

Method CHECK_DELTA
Deprecated

Do not use this method!

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 42/74
6/11/2020

Method CHECK
Deprecated

Do not use this method!

Method EXECUTE
Carries out the validation at runtime

This mandatory method implements the main validation logic. It does not provide any modifying access to the node’s instance
data but returns the messages and the keys of failed node instances (instances for which the action may not be executed).

Signature

importing IS_CTX type /BOBF/S_FRW_CTX_VAL

IT_KEY type /BOBF/T_FRW_KEY

IO_READ type ref to /BOBF/IF_FRW_READ

exporting EO_MESSAGE type ref to /BOBF/T_FRW_MESSAGE

ET_FAILED_KEY type /BOBF/T_FRW_KEY

raising /BOBF/CX_FRW

Parameters

Parameter Description

IS_CTX Provides context information of the validation

More: Action Context IS_CTX

IT_KEY Set of node instance keys that should be processed by the validation

IO_READ Provides read access to the data of the business object instances

More: Reading Data Interface

EO_MESSAGE Message object used for returning information, or warning or error messages related to the validation

ET_FAILED _KEY Set of node instance keys (subset of IT_KEY ) that do not match the validation criteria

 Note
Whenever you implement an action validation, the corresponding action will not be executed on
node instances that are contained in the parameter ET_FAILED_KEY.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 43/74
6/11/2020

Exceptions

Exception Description

/ BOBF/CX_FRW Exception class that throws an exception when an error occurs

It provides the user with BOPF-related message texts that are returned from T100.

BOPF - API Appendix


Content
Reading Data Interface

Action Context IS_CTX

Changing Data Interface

Message Object Interface

Semantics of Parameter IV_BEFORE_IMAGE

Action Context IS_CTX


/BOBF/S_FRW_CTX_ACT

This DDIC structure de nes the action context in BOPF.

It provides static model information of the BO (no instance-related information) that is used as input parameter of all action
classes.

Structure Components Summary

Structure Components Description

BO_KEY Key of the business object that the action is part of

ROOT_NODE_KEY Key of the business object’s root node

NODE_KEY Key of the node, to which the action is assigned

ACT_KEY Key of the action

ACT_CAT Category of the action

Examples: /BOBF/IF_CONF_C=>SC_ACTION_LOCK,
/BOBF/IF_CONF_C=>SC_ACTION_DELETE_STANDARD

 Note
The category is only relevant for framework actions. User-created actions have always the category
/BOBF/IF_CONF_C=>SC_ACTION_STANDARD.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 44/74
6/11/2020

Example

Figure 13: Example of an action context

Authorization Context IS_CTX


/BOBF/S_FRW_CTX_AUTH

This DDIC structure de nes the authorization context in BOPF.

The authorization context provides further information about the situation in which the authorization check is executed. It is used
as an input parameter for all methods of the authorization check class and allows the applications to control the behavior in a ne
granular way - depending on the situation.

Structure Components Summary

Structure Components Description

NODE_KEY Key of the BO node for which the authorization check will be executed

The NODE_KEY is not necessarily the same node to which the authorization check is assigned. It can
also be a subnode that has no own authorization check de ned.

ACTIVITY Activity type (create, change, display, … ) for which the authorization check will be executed

ACTIVITY_SUPPLEMENT Extended context information about the situation (activity) in which the authorization check is called

BO_SERVICE Name of the BO service (query or action) for which the authorization check will be executed

Determination Context IS_CTX


/BOBF/S_FRW_CTX_DET

This DDIC structure de nes the determination context in BOPF.

The determination context provides static model information of the BO (no instance-related information) and is used as the input
parameter for all determination methods.

Structure Components Summary


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 45/74
6/11/2020

Main Structure Components Description

BO_KEY Model Key of the business object that the determination is part of

ROOT_NODE_KEY Model key of the business object’s root node

NODE_KEY Model key of the node that is parent of the determination

DET_KEY Model key of this determination

EXECTIME One of the constants /BOBF/IF_CONF_C=>SC_TIME_* that can be used to identify the actual
determination time

ASSOC_KEY Model key of the association is set when EXECTIME is


/BOBF/IF_CONF_C=>SC_TIME_BEFORE_RETRIEVE and when the loading is triggered by a
RETRIEVE_BY_ASSOCIATION method.

ASSOC_PARAMETERS List of the association parameters is set when EXECTIME is


/BOBF/IF_CONF_C=>SC_TIME_BEFORE_RETRIEVE and when the loading is triggered by a
RETRIEVE_BY_ASSOCIATION method.

FILTERED_ATTRIBUTES List of attributes is set when EXECTIME is /BOBF/IF_CONF_C=>SC_TIME_BEFORE_RETRIEVE and


when the loading is triggered by a RETRIEVE_BY_ASSOCIATION method.

CLEANUP_MODE One of the constants /BOBF/IF_CONF_C=>SC_CLEANUP_* that can be used when EXECTIME is
/BOBF/IF_CONF_C=>SC_TIME_CLEANUP

KEEP_CACHE Is only set when EXECTIME is /BOBF/IF_CONF_C=>SC_TIME_CLEANUP. Evaluating this component


enables the application to discard any cached data when it potentially becomes out-dated.

Example

Figure 14: Example of a determination context

Reading Data Interface


/BOBF/IF_FRW_READ

De nes various methods that allow the business objects to retrieve the node data.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 46/74
6/11/2020
An instance of this interface is passed to the methods of business content classes that can read node data (associations, actions,
determinations, queries, validations) when these methods are executed. This interface is implemented by BOPF and directs the
calls to the buffering classes.

Method Summary

Method Description

CONVERT_ALTERN_KEY Converts alternative keys to BOPF keys (RAW 16 format)

GET_ROOT_KEY Retrieves the root keys of the speci ed node keys

RETRIEVE Retrieves node instance data

RETRIEVE_BY_ASSOCIATION Retrieves node keys and data by following an association

COMPARE Compares the current with the previous version of data (data image prior the last change

More: Semantics of Parameter IV_BEFORE_IMAGE

Method Details
Method CONVERT_ALTERN_KEY

Method GET_ROOT_KEY

Method RETRIEVE

Method RETRIEVE_BY_ASSOCIATION

Method COMPARE

Method CONVERT_ALTERN_KEY
This method converts alternative keys to BOBF keys (RAW 16 format) .

Signature

importing IV_NODE_KEY type /BOBF/OBM_NODE_KEY

IV_ALTKEY_KEY type /BOBF/OBM_NODE_KEY

IV_TARGET_ALTKEY_KEY type /BOBF/OBM_ALTKEY_KEY

IT_KEY type INDEX TABLE

IV_BEFORE_IMAGE type BOOLE_D

IV_INVALIDATE_CACHE type BOOLE_D

exporting ET_KEY type INDEX TABLE

ET_RESULT type /BOBF/T_FRW_KEYINDEX

Parameters

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 47/74
6/11/2020

Parameter Description

IV_NODE_KEY Model Key of the node where the conversion is to be carried out. The source and target alternative keys
belong to this node.

IV_ALTKEY_KEY Model key of the source alternative key

IV_TARGET_ALTKEY_KEY Model key of the target alternative key

- Optional parameter

- Default value = technical key of IV_NODE_KEY

IT_KEY Table of source alternative keys for which the target alternative keys is be retrieved

IV_BEFORE_IMAGE Indicates whether the conversion should run on the before image or not. The before image can be
different - depending on the context where this method is used.

More: Semantics of Parameter IV_BEFORE_IMAGE

- Optional parameter

- Default value = false

IV_INVALIDATE_CACHE Deprecated

ET_KEY Resulting target alternative keys of the conversion. Typed by the table type of the target alternative key.

 Note
Do not use this parameter if you have a non-unique alternative key of the node instance key.

ET_RESULT Table of technical keys pointing to a line in IT_KEY. ET_RESULT can have multiple entries pointing to the
same source alternative key in IT_KEY if the source alternative key is not unique.

 Note
You can also use the Technical Key as the source or the target of a conversion. To specify the KEY attribute in IV_ALTKEY_KEY
or IV_TARGET_ALTKEY_KEY , access the constant /BOBF/IF_FRW_C=>SC_ALTERNATIVE_KEY_KEY .

Method GET_ROOT_KEY
The method retrieves the root keys of the speci ed node keys. The result of the method call is stored in the table of node instance
pairs where the node keys are assigned to its root keys.

Signature

importing IV_NODE type /BOBF/OBM_NODE_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_BEFORE_IMAGE type BOOLE_D

exporting ET_TARGET_KEY type BOPF/T_FRW_KEY

ET_KEY_LINK type BOPF/T_FRW_KEY_LINK

ET_FAILED_KEY type /BOBF / T_FRW_KEY

Parameters

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 48/74
6/11/2020

Parameter Description

IV_NODE Model Key of the node where the technical keys of the ROOT node are to be retrieved

IT_KEY Table of Node Instance for which the technical keys of their ROOT node are to be read

IV_BEFORE_IMAGE Parameter that indicates whether the retrieval runs on the before image. The semantics of the before
image can be different, depending on the context where this method is used.

More:Semantics of Parameter IV_BEFORE_IMAGE

- Optional parameter

- Default value = false

 Note
A before image is not always available. Depending on the content category (action, association,
determination, query, validation) that is called, and on the execution time (if the content is a
determination), there may be no valid before image. In such a case, the returned values are those of
the current image.

ET_TARGET_KEY Table of technical ROOT node keys that are retrieved for the node instances in IT_KEY

ET_KEY_LINK A table of node instance pairs (Source node instance, ROOT node instance)

ET_FAILED_KEY Table of node instance keys that could not be read (for example, if the node instances do not exist). It is
equal to or a subset of IT_KEY .

Method RETRIEVE
Retrieves node instance data

The method exports the data of the requested node instances.

If a node instance does not exist, or it does not exist in the requested image (before or current image), the key is returned in the
parameter ET_FAILED_KEY .

Signature

importing IV_NODE type /BOBF/OBM_NODE_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_BEFORE_IMAGE type BOOLE_D

IV_FILL_DATA type BOOLE_D

IT_REQUESTED_ATTRIBUTES type /BOBF/T_FRW_NAME

exporting EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

ET_DATA type INDEX TABLE

ET_FAILED_KEY type /BOBF / T_FRW_KEY

ET_NODE_CAT type /BOBF/T_FRW_NODE_CAT

Parameters

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 49/74
6/11/2020
Deprecated

Do not use the parameters

1. IT_REQUESTED_ATTRIBUTES

2. ET_NODE_CAT

Parameter Description

IV_NODE Model Key of the node that should be read

IT_KEY Table ofNode Instance that should be read, represented by its technical keys

IV_BEFORE_IMAGE Indicates that the before image is to be read. The before image can be different, depending on the
context where this method is used.More:Semantics of Parameter IV_BEFORE_IMAGE

- Optional parameter

- Default value = false

IV_FILL_DATA Indicates that the node data is to be read. If true, ET_DATA holds the read node data - including all
attributes. If false, only the attribute key is returned in table ET_DATA.

- Optional parameter

- Default value = true

 Note
This parameter might be set to false if just an existence check has to be performed.

IT_REQUESTED_ATTRIBUTES Deprecated!

EO_MESSAGE Message container that contains all messages that are created by the RETRIEVE call

ET_DATA Table of node data typed with the Combined Table type of the read node

 Note
This parameter is not provided if IV_FILL_DATA is set to false.

ET_FAILED_KEY Table of node instance keys that could not be read (for example, if the node instances do not exist). It is
equal to or a subset of IT_KEY .

ET_NODE_CAT Deprecated!

Method RETRIEVE_BY_ASSOCIATION
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 50/74
6/11/2020
Retrieves node keys and data by following an association The method returns the data of the target nodes - if requested. It also
returns a key link table that assigns the source nodes to the target nodes and a table of the target keys.

Signature

importing IV_NODE type /BOBF/OBM_NODE_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_ASSOCIATION type /BOBF/OBM_ASSOC_KEY

IS_PARAMETERS type ref to DATA

IT_FILTERED_ATTRIBUTES type BOBF/T_FRW_NAME

IV_FILL_DATA type BOOLE_D

IV_BEFORE_IMAGE type BOOLE_D

IT_REQUESTED_ATTRIBUTES type /BOBF/T_FRW_NAME

exporting EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

ET_DATA type INDEX TABLE

ET_KEY_LINK type /BOBF/T_FRW_KEY_LINK

ET_TARGET_KEY type /BOBF/T_FRW_KEY

ET_FAILED_KEY type /BOBF /T_FRW_KEY

Parameters
Deprecated

Do not use the parameter IT_REQUESTED_ATTRIBUTES!

Parameter Description

IV_NODE Model Key of the source node of the association

IT_KEY Table of technical keys of source Node Instance for which the target node instances are to be retrieved

More:

IV_ASSOCIATION Model key of the association on the source node that is to be used

IS_PARAMETERS Indicates whether the lter has values for a ltered association or not

- Optional parameter

IT_FILTERED_ATTRIBUTES Speci es which attributes in the lter structure are to be used for the evaluation of the association

- Optional parameter

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 51/74
6/11/2020

Parameter Description

IV_FILL_DATA Indicates that the data of the target node instances is to be read. If set to true, the parameter ET_DATA
will have the data of the target node instances.

- Optional parameter

- Default value = false

IV_BEFORE_IMAGE Indicates that the before image is to be read. The before image can be different, depending on the
context where this method is used.

More :Semantics of Parameter IV_BEFORE_IMAGE

- Optional parameter

- Default value = false

IT_REQUESTED_ATTRIBUTES Deprecated!

EO_MESSAGE Message container that comprises the messages that are raised by the RETRIEVE_BY_ASSOCIATION
call

ET_DATA Table of target node data, typed with the Combined Table type of the read target node. Note that this is
only provided if IV_FILL_DATA is set to true.

ET_KEY_LINK A table of node instance pairs (source node instance, target node instance) that is returned by this
association

ET_TARGET_KEY Table of the target node instances that is returned by this association

ET_FAILED_KEY Table of node instance keys that could not be read (for example, if the source node instances do not
exist). It is equal to or a subset of IT_KEY .

Method COMPARE
Compares the current with the previous version of data (data image prior the last change)

You can use this method to compare the current and before image of node instances IT_KEY of the node IV_NODE .

The result of the method call is passed as the change object EO_CHANGE . If required ( IV_FILL_ATTRIBUTES = true ), the
attributes of the node instances are compared too, and the result is also written into the change object. The scope de nes
whether only the node speci ed or the complete subtree is compared.

Signature

importing IV_NODE_KEY type /BOBF/OBM_NODE_KEY

IT_KEY type /BOBF/T_FRW_KEY

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 52/74
6/11/2020
IV_FILL_ATTRIBUTES type BOOLE_D

IV_SCOPE type BOBF/FRW_SCOPE

exporting EO_CHANGE type ref to /BOBF/IF_FRW_CHANGE

Parameters

Parameter Description

IV_NODE_KEY Model Key for the node where the data versions is to be compared

IT_KEY Technical Key of node instances that should be compared

IV_FILL_ATTRIBUTES If true, the comparison is carried out on attribute level. Changed attributes are part of the change
container content.

- Optional parameter

- Default value = false

IV_SCOPE The scope de nes whether only the speci ed node or the complete subtree is compared.

- Optional parameter

- Default value = local

 Note
The call /BOBF/IF_FRW_C=>SC_SCOPE_LOCAL compares exactly the node indicated in
IV_NODE_KEY, whereas /BOBF/IF_FRW_C=> SC_SCOPE_SUBSTRUCTURE also compares the sub
nodes of IV_NODE_KEY .

Note that this scope is supported only for the ROOT node of a business object.

EO_CHANGE Change container that comprises the changes between the transactional image and the Before Image.

Changing Data Interface


/BOBF/IF_FRW_MODIFY de nes various callback methods that allow the business objects to change the node data.

An instance of this interface is passed to the methods the business content classes that can change node data (CREATE method
of associations, EXECUTE method of actions and determinations) when these methods are executed. This interface is
implemented by BOBF and directs the calls to the buffering classes.

Method Summary

Method Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 53/74
6/11/2020

Method Description

CREATE Creates a new node instance

DELETE Deletes one or multiple node instances

DO_ACTION Executes a BOBF action

DO_MODIFY Modi es a set of node instances

END_MODIFY Triggers a block of modi cations on node instances explicitly

NOTIFY_CHANGE Indicates node instances as changed without executing an modi cation

NOTIFY_ASSOCIATION_CHANGE Indicates outgoing associations of a node as changed without executing a modi cation

NOTIFY_PROPERTY_CHANGE Indicates node instance properties as changed

UPDATE Updates the data of a node instance

Method Details
Method CREATE

Method DELETE

Method DO_ACTION

Method DO_MODIFY

Method END_MODIFY

Method NOTIFY_CHANGE

Method NOTIFY_ASSOCIATION_CHANGE

Method NOTIFY_PROPERTY_CHANGE

Method UPDATE

Method CREATE
Creates a new node instance

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 54/74
6/11/2020
The signature allows the caller to assign a key to the node instance to be created. If the caller does not state a key in parameter
IV_KEY , the framework assigns a new key automatically. This key is then returned to the caller in the parameter EV_KEY . The
result of the method call is a created instance of a speci ed node in the buffer.

importing IV_NODE type /BOBF/OBM_NODE_KEY

IV_KEY type /BOBF/CONF_KEY

IV_NODE_CAT type /BOBF/OBM_NODE_CAT_KEY

IS_DATA type ref to DATA

IT_CHANGED_FIELDS type /BOBF/T_FRW_NAME

IV_ASSOC_KEY type /BOBF/OBM_ASSOC_KEY

IV_SOURCE_NODE_KEY type /BOBF/OBM_NODE_KEY

IV_SOURCE_KEY type /BOBF/CONF_KEY

IV_ROOT_KEY type /BOBF/CONF_KEY

exporting EV_KEY type /BOBF/CONF_KEY

Parameters
Deprecated

Do not use the parameter IV_NODE_CAT!

Parameter Description

IV_NODE Model Key of that node for which a node instance is to be created

IV_KEY The Technical Key that is to be used for the created node instance

If IV_KEY is not provided, the framework generates a new key automatically. The newly generated key is
returned by the exporting parameter EV_KEY .

- Optional parameter

IV_NODE_CAT Deprecated!

IS_DATA Data of the node that is to be used for node instance creation

- Optional parameter

IT_CHANGED_FIELDS Table with attribute names that is to be taken into account in the structure IS_DATA when creating the
node instance

- Optional parameter

Model key of the association that leads to the node for which the new node instance is to be created
IV_ASSOC_KEY
- Optional parameter

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 55/74
6/11/2020

Parameter Description

IV_SOURCE_NODE_KEY Model key of the association’s source node

- Optional parameter

IV_SOURCE_KEY Technical key of the source node instance

- Optional parameter

IV_ROOT_KEY Speci es the technical key of root node instance to which the newly created node instance belongs

- Optional parameter

 Note
This parameter can be used for to improve the performance behavior since the framework does not
to need to discover the root node instance by its own.

However, note that wrong content can cause unde ned behavior of the business object.

EV_KEY Technical key of the newly created node instance

 Note
The importing parameters IV_ASSOC_KEY , IV_SOURCE_NODE_KEY, and IV_SOURCE_KEY are necessary if the node to be
created is a sub node and not a root within the business object’s node hierarchy.

Method DELETE
Deletes one or multiple node instances

Signature

importing IV_NODE type /BOBF/OBM_NODE_KEY

IV_KEY type /BOBF/CONF_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_ROOT_KEY type /BOBF/CONF_KEY

Parameters

Parameter Description

IV_NODE Model Key of the node to be deleted

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 56/74
6/11/2020

Parameter Description

IV_KEY Technical Key of the node instance to be deleted

- Optional parameter

IT_KEY Table of technical keys of the Node Instance to be deleted

- Optional parameter

IV_ROOT_KEY Speci es the technical key of the root node instance to which the deleted node instance belongs

- Optional parameter

 Note
This parameter can be used to improve the performance behavior since the framework does not
need to discover the root node instance on its own.

Note, however, that incorrect content can cause unde ned behavior of the business object.

Method DO_ACTION
Executes a BOPF action

The result of the method execution is identical to that of an action called externally (using the Service Manager API). It can include
all kinds of modi cations.

 Note
When you call an action using this method, the action validations will be processed in the same way as if the action had been
called by means of the Service Manager API.

Signature

importing IV_ACT_KEY type /BOBF/ACT_KEY

IT_KEY type /BOBF/T_FRW_KEY

IS_PARAMETERS type ref to DATA

exporting EO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

ET_FAILED_KEY type /BOBF/T_FRW_KEY

EO_CHANGE type ref to /BOPF/IF_FRW_CHANGE

ET_DATA type INDEX TABLE

Parameters

Parameter Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 57/74
6/11/2020

Parameter Description

IV_ACT_KEY Model Key of the action to be executed

IT_KEY Table of technical Node Instance keys for which the action is to be executed

IS_PARAMETERS Parameter structure used as input for the action - if the action has a parameter structure de ned

- Optional parameter

EO_MESSAGE Message container that comprises all messages created by the action

ET_FAILED_KEY Table of technical node instance keys, for which the action was not executed successfully

EO_CHANGE Change container that comprises all changes executed by the action

ET_DATA The exporting type parameter speci es whether and if so what kind of data the action should be able to
return to the caller during the action execution.

Method DO_MODIFY
Modi es a set of node instances

Signature

importing IT_MODIFICATION type /BOBF/T_FRW_MODIFICATION

Parameters

Parameter Description

IT_MODIFICATION Table with changes on node instances

Method END_MODIFY
Explicitly triggers a block of modi cations on node instances

Generally, BOPF buffers all modi cations made by a content method. When the END_MODIFY method is called, the modi cations
that were made during the processing of the calling methods are immediately executed on the buffer. Based on the modi cations,
the change handler and a message instance are returned.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 58/74
6/11/2020

 Note
In most cases, it is not necessary to call this method. After processing the content method and before retrieving data, the
framework automatically ushes all modi cations. The only reason to trigger the modi cations explicitly is if processing of the
content method relies on values of the parameters EO_MESSAGE and EO_CHANGE .

Signature

importing IV_PROCESS_IMMEDIATELY type BOOL_D

exporting EO_MESSAGE type ref to /BOBF/IF_FRW_MESSSAGE

EO_CHANGE type ref to /BOBF/IF_FRW_CHANGE

Parameters

Parameter Description

IV_PROCESS_IMMEDIATELY If this indicator is set to true, the changes that have been made so far will not only be immediately
executed on the buffer, but also all corresponding determinations after modi cation will be executed.

- Optional parameter

 Note
This functionality is only available within action implementations.

EO_MESSAGE Message container with all messages that are created during the modi cation

EO_CHANGE Change container that contains all changes that are executed by the modi cation

 Note
All changes that are performed by the Internal Access Object IO_MODIFY are not applied directly but stored in a modi cation
buffer. Due to performance, the changes are executed automatically in one shot when the data is accessed from the business
object (lazy modi cations). By calling the END_MODIFY method, you are able to force the ush of the modi cation buffer
immediately.

Method NOTIFY_CHANGE
Indicates node instances as changed without executing an modi cation (without real data change)

As a result of the method call, a change noti cation is created and used to explicitly trigger determinations without any real data
change.

 Note
Do not use this method to notify changes that were already made explicitly using CREATE , UPDATE , or DELETE . In latter case,
the changes are noti ed by the framework.

Signature

importing IV_NODE_KEY type /BOBF/OBM_NODE_KEY

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 59/74
6/11/2020

IV_KEY type /BOBF/CONF_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_CHANGE_MODE type /BOBF/CONF_CHANGE_MODE

Parameters

Parameter Description

IV_NODE_KEY Model Key of the node for which the change is to be noti ed

IV_KEY
Technical Key of the node instance for which the change is to be noti ed

- Optional parameter

IT_KEY Table with technical keys ofNode Instance for which the change is to be noti ed

More:

- Optional parameter

IV_CHANGE_MODE The kind of change that is to be noti ed

- Default value = /BOBF/IF_FRW_C =>SC_MODIFY_UPDATE

Method NOTIFY_ASSOCIATION_CHANGE
Indicates outgoing associations of a node as changed, without executing a modi cation

If consumers hold data in their own buffers, this noti cation is used as a trigger that the buffer might be outdated. To get recent
data, the consumer would re-navigate the corresponding association for all source node instances that are currently stored in the
buffer.

Signature

importing IV_NODE_KEY type /BOBF/OBM_NODE_KEY

IV_KEY type /BOBF/CONF_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_ASSOC_KEY type /BOBF/OBM_ASSOC_KEY

Parameters

Parameter Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 60/74
6/11/2020

Parameter Description

IV_NODE_KEY Model Keyof the association’s source node for which the change is to be noti ed

IV_KEY
Technical Key of the node instance for which the change is to be noti ed

- Optional parameter

IT_KEY Table with technical keys of Node Instance for which the change is to be noti ed

- Optional parameter

IV_ASSOC_KEY Model key of the association for which the change is to be noti ed

If this parameter is not provided, the change will be noti ed for all associations that have been indicated
as the source node (in the parameter IV_NODE_KEY).

- Optional parameter

Method NOTIFY_PROPERTY_CHANGE
Indicates node instance properties as changed

As result of method call, a property change noti cation is created and passed to the service consumer.

 Note
In general, it is sufficient to model the dependency between the change noti cations and the property change noti cations
using the BOPF con guration tools. However, in some cases, the modelling capabilities might not be detailed enough to cover
all use cases. This method enables the application developers to explicitly create property change noti cations.

Signature

importing IV_NODE_KEY type /BOBF/OBM_NODE_KEY

IV_KEY type /BOBF/CONF_KEY

IT_KEY type /BOBF/T_FRW_KEY

IV_NODE_CHANGED type BOOLE_D

IV_NODE_ATTRIBUTE_CHANGED type BOOLE_D

IV_ASSOCIATION_CHANGED type BOOLE_D

IV_ACTION_CHANGED type BOOLE_D

Parameters

Parameter Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 61/74
6/11/2020

Parameter Description

IV_NODE_KEY Model Key of the node for which the property change is to be noti ed

IV_KEY
Technical Key of the node instance for which the property change is to be noti ed

- Optional parameter

IT_KEY Table with technical keys of Node Instance for which the property change is to be noti ed

- Optional parameter

IV_NODE_CHANGED If the value is true, a property change of the node will be noti ed

- Default value = ABAP_FALSE

IV_NODE_ATTRIBUTE_CHANGED If the value is true, a property change of the node attributes will be noti ed

- Default value = ABAP_FALSE

IV_ASSOCIATION_CHANGED If the value true, a property change will be noti ed for all associations with the node as the source
node

- Default value = ABAP_FALSE

IV_ACTION_CHANGED If the value is true, a property change will be noti ed for all actions of the node

- Default value = ABAP_FALSE

Method UPDATE
Updates the data of a node instance

As result of the method call, the node instance is updated in the buffer. If the IT_CHANGED_FIELDS parameter is not passed, all
elds of the node instance will be updated. Due to performance reasons, you can also use the ROOT_KEY parameter.

Signature

importing IV_NODE type /BOBF/OBM_NODE_KEY

IV_KEY type /BOBF/CONF_KEY

IV_ROOT_KEY type /BOBF/CONF_KEY

IS_DATA type ref to DATA

IT_CHANGED_FIELDS type /BOBF/T_FRW_NAME

Parameters

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 62/74
6/11/2020

Parameter Description

IV_NODE Model Key of the node that is to be updated

IV_KEY Technical Key of the node instance that is to be updated

IV_ROOT_KEY Technical key of the corresponding rootNode Instance

More:

- Optional parameter

IS_DATA Provides node instance data for update

It is represented as a data reference that is typed with node’s Combined Structure.

IT_CHANGED_FIELDS Table of names for attributes that are to be used for the update. If this parameter is not provided, all
attributes will be updated.

- Optional parameter

Changing Object Interface


/BOBF/IF_FRW_CHANGE provides access to change noti cations that were done on business object instances during a
roundtrip

An instance of this interface is returned by all changing methods on a business object. Please note that not all methods of the
interface will be used by business object implementations like actions, determinations, and so on. They are used within the
framework only and will not be described in detail.

Method Summary

Method Description

ADD Adds a list of change noti cations. To be used within the framework only.

Adds a single change noti cation on node instance data. To be used within the framework only.
ADD_CHANGE

Adds a single change noti cation to the content of an instance (for example, change of an association ).
ADD_CONTENT_CHANGE
To be used within the framework only.

Removes redundant change noti cations. To be used within the framework only
CONDENSE

Returns all change noti cations


GET

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 63/74
6/11/2020

Method Description

Returns the speci ed change noti cations


GET_CHANGES

Returns true if the change object has any change noti cations
HAS_CHANGES

Adds the changes of any given change object instance. To be used within the framework only
MERGE

Method Details
Method GET

Method GET_CHANGES

Method HAS_CHANGES

Method GET
Returns all change noti cations

The result of this method can be in uenced by the IV_SORTED parameter for performance-optimized processing. For example, if
an implementation is interested in the changes for speci c node instances, this method might be called so that the result is sorted
by the instance keys.

Signature

importing IV_SORTED type /BOBF/FRW_CHANGE_SORT

IV_NO_LOAD type BOOLE_D

exporting ET_CHANGE type /BOBF/T_FRW_CHANGE

EV_SORTED type /BOBF/FRW_CHANGE_SORT

ET_CONTENT_CHANGE type /BOBF/T_FRW_CHANGE_CONTENT

ET_CHANGE_LOAD type /BOBF/T_FRW_CHANGE

ET_CHANGED_LOAD_KEY type /BOBF/T_FRW_CHANGE

EV_RELOAD_INT type BOOLE_D

EV_RELOAD_DEL type BOOLE_D

Parameters
Deprecated

Do not use the parameters

ET_CHANGE_LOAD

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 64/74
6/11/2020
ET_CHANGE_LOAD_KEY

EV_RELOAD_INT

EV_RELOAD_DEL

Parameter Description

IV_SORTED Indicates according to which criteria the results in ET_CHANGE are to be sorted -- for example, by
change mode, node instance key. This could be used to in uence the result for optimized processing

- Optional parameter

-Default value = /BOBF/IF_FRW_C=>SC_CHANGE_SORT_COMPLETE (sorting on all elds)

IV_NO_LOAD If true, no load noti cations will be returned by ET_CHANGE, ET_CHANGE_LOAD and
ET_CHANGE_LOADE_KEY

- Optional parameter

ET_CHANGE A table of node data change noti cations

EV_SORTED Indicates how the result in ET_CHANGE was sorted

ET_CONTENT_CHANGE A table of content change noti cations.

ET_CHANGE_LOAD Deprecated!

ET_CHANGE_LOAD_KEY Deprecated!

EV_RELOAD_INT Deprecated!

EV_RELOAD_DEL Deprecated!

Method GET_CHANGES
Returns all node data change noti cations

In contrast to the method GET this method returns node data change noti cations only.

Signature

importing IV_CHANGE_MODE type /BOBF/CONF_CHANGE_MODE

IS_CHANGE_MODE type /BOBF/S_CONFRO_CHG_MODE

IV_FAILED type BOOLE_D

IV_NODE_KEY type /BOBF/EBM_NODE_KEY

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 65/74
6/11/2020
exporting ET_CHANGE type /BOBF/T_FRW_CHANGE

ET_CHANGED_KEY type /BOBF/T_FRW_KEY

ET_CHANGED_NODE type /BOBF/T_FRW_NODE

Parameters

Parameter Description

IV_CHANGE_MODE To lter the result for a special kind of change noti cation. Could be used if the consumer is only
interested in speci c changes (for example, create, update, and so on). If this parameter is not provided,
the method will return all kinds of noti cations

-Optional parameter

IS_CHANGE_MODE To lter the result for a set of special change noti cations. If this parameter is not provided, the method
will return all kinds of noti cations

-Optional parameter

IV_FAILED If true, the result the method will return also noti cations about failed changes

- Optional parameter

IV_NODE_KEY Model Key of a node to lter the result for a speci c node

- Optional parameter

ET_CHANGE Table of change noti cations

ET_CHANGED_KEY Table of Node Instance keys that have been changed

ET_CHANGED_NODE Table of node instance keys that have been changed including the corresponding node model keys

Method HAS_CHANGES
Indicates whether changes exists

Signature

importing IV_SELECTION type /BOBF/FRW_CHANGE_SCOPE

IV_CHANGE_MODE type /BOBF/CONF_CHANGE_MODE

returning EV_EXISTS type BOOLE_D

Parameters
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 66/74
6/11/2020

Parameter Description

IV_SELECTION De nes the scope for the result. The scope can be set on all, successful, or failed changes

- Optional parameter

- Default = /BOBF/IF_FRW_C=>SC_CHANGE_SUCC_ONLY

IV_CHANGE_MODE Indicates which kind of change is to be taken into consideration

- Optional parameter

EV_EXISTS True if changes exists

Message Object Interface


/BOBF/IF_FRW_MESSAGE

Interface of a message container object that provides access to all (class-based) messages that are issued during a roundtrip.

An instance of this interface is raised by changing and reading methods.

Method Summary
Deprecated

Do not implement the methods

ADD_EXCEPTION

ADD_MESSAGE

Method Description

ADD Adds all messages contained in a given message object to this message object

ADD_CM Adds a class-based message to the message object

ADD_CM_WITH_NEW_LOCATION Adds a class-based message with new location information to the message container

ADD_EXCEPTION Deprecated!

ADD_MESSAGE Deprecated!

CHECK Returns true if the message object contains error messages

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 67/74
6/11/2020

Method Description

GET Returns all messages

GET_MESSAGES Returns all speci ed message

Method Details
Method ADD

Method ADD_CM

Method ADD_CM_WITH_NEW_LOCATION

Method ADD_EXCEPTION

Method ADD_MESSAGE

Method CHECK

Method GET

Method GET_MESSAGES

Method ADD
Adds all messages contained in a given message object to this message object.

To be used to merge two message objects.

Signature

importing IO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

Parameters

Parameter Description

IO_MESSAGE Message instance that is to be added to the message object

Method ADD_CM
Adds a class-based message to the message object

A class-based message can only be added to the message object it inherits from /BOBF/CM_FRW

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 68/74
6/11/2020

Signature

importing IO_MESSAGE type ref to /BOBF/IF_FRW_MESSAGE

IT_MESSAGE type /BOBF/CM_FRW=>TT_FRW

Parameters

Parameter Description

IO_MESSAGE Message instance that is to be added to the message object

IT_MESSAGE Table of message instances that is to be added to the message object

Method ADD_CM_WITH_NEW_LOCATION
Adds a class-based message with new location information the message object

To be used if an existing message instance is to be reused while providing information about origin location, severity, and so on.

Signature

importing IO_MESSAGE type ref to /BOBF/CM_FRW

IV_NEW_BOPF_LOCATION type /BOBF/CONF_KEY

IS_NEW_ORIGIN_LOCATION type /BOBF/S_FRW_LOCATION

IT_NEW_ENVIRONMENT_LOCATION type /BOBF/T_FRW_LOCATION

IV_NEW_LIFETIME type /BOBF/CM_FRW=>TY_MESSAGE_LIFETYME

IV_NEW_SYMPTOM type /BOBF/CM_FRW=>TY_MESSAGE_SYMPTOM

IV_NEW_SEVERITY type /BOBF/CM_FRW=>TY_MESSAGE_SEVERITY

Parameters
Deprecated

Do not use the parameters

IT_NEW_BOPF_LOCATION

IT_NEW_ENVIRONMENT_LOCATION

Parameter Description

IO_MESSAGE Message instance that is to be added to the message object

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 69/74
6/11/2020

Parameter Description

IV_NEW_BOPF_LOCATION Deprecated. Do not use!

IS_NEW_ORIGIN_LOCATION New origin location for the added message instance

- Optional parameter

IT_NEW_ENVIRONMENT_LOCATION Deprecated. Do not use!

IV_NEW_LIFETIME New lifetime for the added message instance

- Optional parameter

New symptom for the added message instance


IV_NEW_SYMPTOM
- Optional parameter

IV_NEW_SEVERITY New severity for the added message instance

- Optional parameter

Method ADD_EXCEPTION
Deprecated

Do not use this method!

Method ADD_MESSAGE
Deprecated

Do not use this method!

Method CHECK
Returns true if the message object has messages with severity error.

Signature

importing IV_CONSISTENCY_MESSAGES type BOOLE_D

IV_ACTION_MESSAGES type BOOLE_D

returning EV_ERROR_MESSAGES type BOOLE_D

Parameters
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 70/74
6/11/2020

Parameter Description

IV_CONSISTENCY_MESSAGES To indicate whether only messages of consistency validations are to be taken into consideration

- Optional parameter

IV_ACTION_MESSAGES To indicate whether only messages of action validations are to be taken into consideration

- Optional parameter

EV_ERROR_MESSAGES True if the message object contains error messages

Method GET
Returns all messages of the message object

Signature

exporting ET_MESSAGE type /BOBF/CM_FRW=>TT_FRW

Parameters

Parameter Description

ET_MESSAGE Table of message instance that are contained in the message object

Method GET_MESSAGES
Returns a table of message speci ed by the importing parameters of the method

Signature

importing IV_SEVERITY type /BOBF/CM_FRW=>TY_MESSAGE_SEVERITY

IV_CONSISTENCY_MESSAGES type BOOLE_D

IV_ACTION_MESSAGES type BOOLE_D

exporting ET_MESSAGE type /BOBF/T_FRW_MESSAGE_K

Parameters

Parameter Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 71/74
6/11/2020

Parameter Description

IV_SEVERITY To indicate that only messages of a certain severity are to be returned

- Optional parameter

IV_CONSISTENCY_MESSAGES To indicate that only messages of consistency validations are to be returned

- Optional parameter

IV_ACTION_MESSAGES To indicate that only messages of action validations are to be returned

- Optional parameter

ET_MESSAGE Table of message instances

Semantics of Parameter IV_BEFORE_IMAGE


The parameter IV_BEFORE_IMAGE of the reading operations has different semantics - depending on the context when the
application logic is called.

The following list shows the different meanings of the parameter, depending on the entity that is used by the consumer (when you
set the parameter to abap_true ).

Entity Categories (for Semantics of Before Image


Determinations)

Action The caller retrieves data that corresponds to the database state.
Note that the database state is also buffered if the data is read
multiple times.

Action Validation If the consumer triggers validation by standard actions, the caller
retrieves data corresponding to the current database state.

If the validation is triggered by framework actions such as create,


update, or delete, the caller retrieves the last saved BEFORE
MODIFICATION state.

Consistency Validation If the validation is triggered by create, update, or delete, the caller
retrieves data corresponding to the state after last validation run.

If the validation is triggered by a check, the caller retrieves data


corresponding to the current database state.

Association The before image corresponds to the current state and is equal to
the requested state of consumer.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 72/74
6/11/2020

Entity Categories (for Semantics of Before Image


Determinations)

Determination Calculate transient attributes This parameter can only be used during the execution time point
After Modify (the execution time point is indicated with attribute
EXECTIME = /BOBF/IF_CONF_C=>SC_TIME_AFTER_MODIFY of
the importing structure IS_CTX). In this case, the caller retrieves
data corresponding to the state after the last determination run.

Calculate properties The caller retrieves data corresponding to the current database
state

React after modi cation The caller retrieves data corresponding to the state after last
determination run

React Before Save, The caller retrieves data corresponding to the current database
state
React on Check and Determine,

React before Save

Glossary
Before Image A data image that is prior to the current transaction image. Depending of the context, the before image
can have different semantics.

Combined Structure Structure type of a node that contains the technical key attributes as well as the persistent and
transient structures as an include

Combined Table Table type of a node that has the Combined Structure type as its line type

Constants Interface An ABAP interface that is dedicated for a speci c business object. The interface includes constants for
each business object’s entity like nodes, attributes, actions and so on.

Content Change Noti cation Indicates the change of a business object’s entity. For example, a change of an association indicates
that the result of an association might have changed. Consumers that have their own data buffers can
use this kind of noti cation as a trigger to re-read the data.

Message Lifetime Property of a message instance that can be used by UIs to decide how long a message will be displayed
to the user. For example, only once after a roundtrip because a certain action was not possible, or
permanently because the some BO data is inconsistent and will be corrected by the user

Message Symptom Property of a message instance to indicate why the message has been issued. For example, because of
a detected data inconsistency, locking con ict, and so on.

Model Key

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 73/74
6/11/2020
A key that speci es an entity of a given business object. Model keys can be found as constants in the
Constants Interface of the corresponding business object.

Node Instance A data set of a business object node that is identi ed by its technical key

Origin Location Provides the error location in a BO for an issued message

Technical Key The primary key of a node instance. The primary key is stored in an attribute with name KEY along with
the business-related attributes of a node.

Transactional Image A data image that represents the state of the current transaction including changes that not have been
committed to the database yet.

References
How to get started?
Introduction to BOPF - Overview

Getting Started with BOPF – guides you through all the steps required to create your rst business object from scratch
and to implement a basic operation using the BOPF API.

Tutorials:
Creating and Implementing Consistency Checks in Business Object Builder

Getting Started with Determinations in Business Object Builder

How to Create Queries with Business Object Builder

How to Use Authorization Checks in BOPF

Related blogs - published on ABAP community pages:


Business Object Overview

Working with BOPF API

Advanced BOPF API Features

Enhancements Techniques

Testing and UI integration

Tool reference on SAP help portal:


Creating Business Objects using ABAP Development Tools (Eclipse)

BO Builder Help

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20626307&topics=e5ea9085cfe2494faacae415ff81… 74/74

You might also like