Carsten Ziegler, Chief Product Owner SAP NetWeaver
Decision Service Management, SAP AG
Custom-Defined Attributes for BRFplus with SAP
NetWeaver Decision Service Management
October 2013
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
TABLE OF CONTENTS
HOW TO DEFINE CUSTOM ATTRIBUTES ..................................................................................................... 3
HOW TO DEFINE CUSTOM ATTRIBUTE VALUES ........................................................................................ 4
HOW TO USE CUSTOM ATTRIBUTES IN SEARCHES ................................................................................. 5
HOW TO CHECK AND CHANGE CUSTOM ATTRIBUTE VALUES WITH AN APPLICATION EXIT............ 6
END NOTE ........................................................................................................................................................ 7
2
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
SAP NetWeaver Decision Service Management (DSM) embeds and extends Business Rule Framework plus
(BRFplus) for the creation of business rules. As a major extension, DSM provides access to master data or
configuration data on any managed (= remote) system in the customer landscape. With DSM, business rules
can therefore be used as decision services that can be deployed (transferred) to managed systems for local
execution. A list of capabilities that come with DSM can be found in the blog SAP NetWeaver Decision
Service Management – Let’s Talk Features.
Amongst the many features, tools, and capabilities that DSM adds to BRFplus there are also custom
attributes. Custom-defined attributes show up in the general data section of BRFplus objects and can for
example be used to add customer-specific properties such as “owner”, “organizational area”, and so on.
Custom attributes are also supported in the object search dialog.
This document shows you how to define and use custom attributes.
HOW TO DEFINE CUSTOM ATTRIBUTES
Custom attributes are defined by data objects. Currently, only elementary data objects of the text type are
supported and the number of custom attributes is limited to 8 per application.
The elementary data objects may impose value restrictions but also allow the use of domain values or value
lists derived from the data dictionary (see the “How to define custom attribute values” section below).
Figure 1: Definition of data objects
Once the elementary data objects have been defined, it is possible to use them in the application UI for the
definition of custom attributes (see Figure 2: Definition of custom attributes in the application). In addition, custom
attributes can be marked as mandatory or optional. When set to mandatory, a value needs to be maintained
for the attribute for all objects in the application (excluding objects marked for deletion or as obsolete). For
mandatory attributes it is therefore recommended to maintain the values first and then switch the attribute
setting to mandatory. Objects that have no value set for a mandatory custom attribute cannot be activated.
3
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
Figure 2: Definition of custom attributes in the application
HOW TO DEFINE CUSTOM ATTRIBUTE VALUES
If an application defines custom attributes, all objects of the application offer a new Custom Attributes tab in
the General section. On this tab, it is possible to enter values for the attributes. For your convenience,
attribute values that start with "http://" or "https://" will automatically be shown as a link when you are in
display mode.
4
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
Figure 3: Maintenance of custom attribute values
Figure 4: Custom attributes in display mode with an internet address rendered into a link
HOW TO USE CUSTOM ATTRIBUTES IN SEARCHES
Attribute values are also supported in the search dialogs. A new search field, Custom Attribute Value, which
makes a combined search over all custom attributes possible, has been added.
5
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
Figure 5: Using custom attributes in searches
HOW TO CHECK AND CHANGE CUSTOM ATTRIBUTE VALUES WITH AN APPLICATION EXIT
In general, it is possible to use code exits in BRFplus. Such exits can also be used to control custom attribute
values.
For code exits, a class that implements interface IF_FDT_APPLICATION_SETTINGS needs to be created.
This class can then be set as the exit class in the application maintenance UI.
In the class-constructor of the exit-class, the required and actually implemented exit methods have to be
activated. This is achieved by setting the respective static interface-attributes to true.
if_fdt_application_settings~gv_get_element_values = abap_true.
if_fdt_application_settings~gv_change_notification = abap_true.
if_fdt_application_settings~gv_check = abap_true.
if_fdt_application_settings~gv_activation_veto = abap_true.
The corresponding exit methods then have to be implemented. The following exit methods may be of
particular interest with respect to custom attributes:
CHANGE_NOTIFICATION: When a BRFplus object is changed, this method acts like an event that
lets you react to the change. You may update other attributes of the object or do something outside
of BRFplus.
CHECK: When a BRFplus object is checked or activated, this method is called so that customer-
specific checks can be performed. Returning messages of type E, A, or X results in an error
message that does not allow activation of the respective object.
ACTIVATION_VETO: Additional checks that are executed at the time of activation may only be
implemented here.
GET_ELEMENT_VALUES: With this exit, it is possible to define custom value lists that are used in
value helps or in consistency checks. Programmatically-defined value lists for custom attributes can
be implemented here.
The following lines of code are an example of the access of custom attribute values in a CHECK-exit
method:
METHOD if_fdt_application_settings~check.
DATA: lo_i TYPE REF TO if_fdt_admin_data,
lts_aval TYPE if_fdt_admin_data=>ts_attribute_value,
6
Custom-Defined Attributes for BRFplus with SAP NetWeaver Decision Service Management
ls_aval TYPE if_fdt_admin_data=>s_attribute_value.
cl_fdt_factory=>get_instance_generic(
EXPORTING iv_id = iv_id
IMPORTING eo_instance = lo_i ).
lo_i->get_custom_attribute_values(
IMPORTING ets_attribute_value = lts_aval ).
READ TABLE lts_aval INTO ls_aval
WITH TABLE KEY id = '<UUID OF ATTRIBUTE/DATA OBJECT>'.
ENDMETHOD.
END NOTE
SAP NetWeaver AS ABAP in version 7.40 with Support Package 5 as well as SAP NetWeaver Decision
Service Management 1.0 Support Package 2 were used for this document. The examples also work in a very
similar way on other versions of the software starting with SAP NetWeaver AS ABAP 7.31 Support Package
9.
For more information about SAP NetWeaver Decision Service Management, see the SAP Community
Network: http://scn.sap.com/docs/DOC-29158
7
www.sap.com
SAP AG. All rights reserved 2013 ©
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP
BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP
products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of SAP AG in Germany
and other countries.
Business Objects and the Business Objects logo, BusinessObjects,
Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as
well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP
company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL
Anywhere, and other Sybase products and services mentioned herein
as well as their respective logos are trademarks or registered
trademarks of Sybase Inc. Sybase is an SAP company.
Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are
registered trademarks of Crossgate AG in Germany and other
countries. Crossgate is an SAP company.
All other product and service names mentioned are the trademarks of
their respective companies. Data contained in this document serves
informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials
are provided by SAP AG and its affiliated companies ("SAP Group")
for informational purposes only, without representation or warranty of
any kind, and SAP Group shall not be liable for errors or omissions
with respect to the materials. The only warranties for SAP Group
products and services are those that are set forth in the express
warranty statements accompanying such products and services, if
any. Nothing herein should be construed as constituting an additional
warranty.