Introducing the Business Rules Framework Plus (BRFplus)

Objectives

After completing this lesson, you will be able to:
  • Understand the Business Rules Framework Plus (BRFplus) use case in Tax and Revenue Management
  • Start the BRFplus workbench and set up the user interface
  • Understand the different administrator actions available for application maintenance
  • Introduce BRFplus Catalogs to business users and explain their importance
  • Understand modes of operation of BRFplus Functions

Business Rules Framework Plus

Note

There is a separate course DSM100 that describes the BRFplus and DSM (Decision Service Management) in detail. In this Unit, we only focus on the basic concept of BRFplus and how its uses in TRM.

Business Rule Engine

Business Rule Engine

A Business Rules Engine (BRE) is a toolkit for creating essential business logic that can be comprehended and maintained by business experts without the need for code alterations.

A Business Rules Engine (BRE) is a suite of tools designed to empower analysts and developers in constructing calculations, validations, and decision logic. Its primary objective is to segregate business logic from system logic, facilitating alterations in system behavior without requiring code modifications. Business rules are integral throughout the entire tax and revenue processing workflow. Initially, tax return data must undergo validation to ensure completeness. Subsequently, the system must assess compliance with regulations and gauge the risk of compliance failure. Finally, taxes are computed based on specified thresholds. Rules are pervasive and necessitate frequent adjustments.

To streamline this process, SAP provides integration with the Business Rule Framework plus (BRFplus). This integration enables the handling of both form-based and object-based taxes within SAP Tax and Revenue Management (TRM) for the Public Sector. BRFplus boasts advanced features, including a browser-based user interface, traceability, and simulation capabilities, significantly reducing the time and effort required for policy and rule implementation.

Consequently, BRFplus enhances transparency by explicitly documenting business practice decisions, eliminating the need to hide them within the code. It fosters a better understanding of application behavior, promoting predictability. As a result, maintenance and testing costs decrease as business rules become decoupled from the application code. Business users can easily modify, test, and simulate changes, leading to quicker responses to changing conditions and reduced modification cycle times.

BRFplus seamlessly integrates with SAP TRM for the Public Sector, offering a comprehensive set of functionalities to meet specific TRM requirements:

  1. New BRFplus Actions and Expressions: BRFplus introduces additional actions and expressions tailored to TRM needs. These include functions such as creating contract objects, generating billing documents, and updating form bundles.
  2. BRFplus Integration Manager for Form Bundles: Accessible via Transaction code BRFPLUS_MANAGER or under the configuration path: Financial Accounting → Contract Accounts Receivable and Payable → Business Transactions → Public Sector Tax Assessment → BRFplus → Define BRFplus Objects for Form Bundles. This program facilitates the integration of BRFplus with the Forms Processing Framework in TRM. It streamlines the generation of BRFplus objects (for example, applications and functions) within SAP TRM, simplifying the rule definition process in the BRFplus Workbench.
  3. Integration of BRFplus with Form Bundle Type: Configured through the path: Financial Accounting → Contract Accounts Receivable and Payable → Business Transactions → Public Sector Tax Assessment → Form Processing → Form Bundle Type → Define Form Bundle Type. This integration associates form processing activities with BRFplus functions. When a form processing activity is triggered, the customized BRFplus function handles the current form bundle.
  4. BRFplus Integration Manager for Object-Based Taxes: Managed via Transaction code BRFPLUS_MANAGER_OBT or under the IMG Path: Financial Accounting → Contract Accounts Receivable and Payable → Business Transactions → Public Sector Tax Assessment → BRFplus → Define BRFplus Objects for Object-Based Tax. Similar to the form bundle integration, this program generates applications and functions for object-based taxes in the BRFplus Workbench. It offers a feature for converting facts to simplify rule definition and allows for restricting the selection of fact types and categories based on contract object types for BRFplus object generation.
  5. Integration of BRFplus with Revenue Type: Configured through the path: Financial Accounting → Contract Accounts Receivable and Payable → Business Transactions → Public Sector Tax Assessment → Billing → Assign BRF/BRFplus Rules for Each Revenue Type. In this integration, revenue types are associated with BRFplus functions. During object-based billing execution, the customized BRFplus function is invoked to validate and create billing documents.
  6. Lean Trace Management: Utilize programs FMCA_DISPLAY_OBT_LEANTRACE and FMCA_DELETE_OBT_LEANTRACE to display and delete lean traces for object-based billing tax.
  7. Custom TRM Action and Expression Definition: Define custom TRM actions and expressions under the configuration path: Financial Accounting → Contract Accounts Receivable and Payable → Business Transactions → Public Sector Tax Assessment → BRFplus → Define Parameters for Static Methods of BRFplus. Standard delivery includes all specific actions and expressions.
  8. BRFplus Integration for Property Tax: Detailed configuration path for Property Tax integration can be found under: Financial Accounting → Contract Accounts Receivable and Payable → Integration → Flexible Real Estate Management (RE-FX) → Property Tax → Activate BRFplus for the RE-FX Contract

    Note

    For details refer to Unit 12 - Processing Property Tax.

This comprehensive integration enhances TRM functionality, streamlines rule management, and ensures efficient handling of various tax and revenue processes within SAP TRM for the Public Sector.

Overview of Business Rules Framework Plus

BRFplus

Streamlining Business Rule Management: BRFplus offers a robust Application Programming Interface (API) and User Interface (UI) for the efficient definition and execution of business rules. This versatile tool simplifies rule modeling and promotes rule reuse across various applications.

Front-End Rule Modeling

BRFplus provides an intuitive Web Dynpro UI for modeling and simulating business rules. This user-friendly interface supports visual expressions, including decision tables, decision trees, and formulas.

Back-End Rule Processing

Behind the scenes, BRFplus features a dedicated rule processor component responsible for compiling and executing business rules. All rule-related objects are securely stored within the rule repository's FDT* tables, housed in the SFDT_CORE package. This architecture ensures the integrity and accessibility of your rule assets.

Comprehensive Rule Management

BRFplus is equipped with a suite of tools and services designed to facilitate the creation, maintenance, and management of rules. These resources empower users to build and oversee rules seamlessly, enhancing the overall efficiency of rule-driven processes.

Processing Data Flow

When a business application invokes BRFplus functions through configuration integration, a systematic process is set in motion. The system transmits crucial business data, such as form data, PSCD data, and Taxpayer data, as the Context input to the BRFplus function.

Within the BRFplus function, two execution pathways exist. It can either directly invoke the top expression or trigger a ruleset. If the top expression is invoked, the result it yields becomes the BRFplus function result. Conversely, when a ruleset is called, it proceeds to execute the rules sequentially. Each rule, in its execution, engages expressions and/or actions to accomplish specific business objectives. For instance, data validation is commonly the initial step, and upon successful validation, actions are triggered to create master data or generate billing documents.

The final result of this process is returned as the BRFplus Function result, reverting to the point within the business application that initiated the call. Subsequent steps are determined by the application's logic flow.

For enhanced transparency and traceability, the entirety of BRFplus logic can be logged as trace data when the lean trace feature is activated.

BRFplus Workbench

The BRFplus User Interface (UI) comprises a versatile workbench tailored for the seamless maintenance of your business rules. Within this workbench, you have the ability to create, modify, and delete various objects related to BRFplus. It serves as a centralized hub for accessing all BRFplus objects within your system.

You can initiate the BRFplus workbench from either the backend system, using transaction BRFplus, or through a web browser using a system-specific BRFplus workbench URL.

To utilize the BRFplus workbench, it's essential to have the BRFplus Administrator role (SAP_BC_FDT_ADMINISTRATOR) added to your user profile and active the Web Dynpro service (FDT Workbench, FDT Object Manager, and FDT Catalog Browser) for BRFplus by transaction SICF.

The BRFplus workbench is organized into two primary panels: the Navigation Panel and the Object Manager Panel. Additionally, it offers several general features accessible via the Menu Bar. These components collectively facilitate efficient business rule management and streamline the configuration process.

Administrator Actions

The Menu in the BRFplus Workbench offers a range of functionalities:

  • Workbench: Here, you can perform various workbench operations, such as creating applications, viewing current repository objects, configuring user settings, toggling between simple and expert UI modes, and adding the current object as a favorite.
  • Tools: The availability of tools depends on the UI mode chosen. In simple mode, only the simulation tool is active, while other tool components are available in Expert Mode.
    • Application Administration: Access various administration tools, including the application cleanup tool to delete unused objects.
    • Application Usage: Use this tool to query which applications are being used by the selected application or to query other applications using the selected one as a reference.
    • Dictionary Usage Overview: Generate a list of all BRFplus objects that utilize a specific DDIC type.
    • Debugger: Execute BRFplus functions in debug mode, allowing step-by-step inspection.
    • Trace: View the trace information for a particular BRFplus function.
    • Mass Change: Make simultaneous changes to multiple BRFplus objects.
    • Simulation: Conduct unit testing for your BRFplus function or expressions by providing sample input data to objects and expressions. Process them using the simulation tool to obtain results, similar to function module testing.
    • Test Case Administration: Effortlessly create and oversee new test cases for BRFplus functions by defining input values and expected outcomes. Upon executing BRFplus, the system provides clear pass or fail results for each test case, ensuring efficient testing and validation.
    • Transport Analysis: Analyze and check the consistency of all BRFplus objects within a transport request.
    • Web Service Generation: Utilize this tool to enable third-party users to process rules defined in BRFplus via web services.
    • XML Export and XML Import: Transport active BRFplus object versions between systems provided both systems support BRFplus.
  • Help: Open the Help Center pane on the right border of the window. Find context-specific application help for the type of object that you are working on. The menu also provides a legend explaining important icons and typographic conventions used in the user interface.

The system provides visual indications of object status:

  • Object Type: Symbols next to object names indicate their types (for example, applications, expressions, functions).
  • Typeface: Objects in bold characters are transportable; others are local to the current system.
  • Traffic Light: Objects with a green traffic light are active and usable in applications.

Interface Personalization

The BRFplus Workbench offers two distinct UI modes:

  • Simple Mode: Designed for business users.
  • Expert Mode: Tailored for business experts or developers.

The key distinction between these modes lies in Expert Mode, which grants access to additional tools necessary for administrative and cleanup tasks.

To further personalize your experience, navigate through the tabs of the Personalization screen:

General Tab

Here, you can configure various settings, including defining the maximum number of search results for queries, selecting your Workbench mode (Simple or Expert), toggling technical names and attributes, and setting XML export/import parameters. You can also customize the default appearance of BRFplus object headers by enabling 'General Section Expanded.' The 'Viewing mode' option allows you to set the default viewing mode for BRFplus objects based on your organizational role, whether you're a business user or a technical/developer.

Navigation Panel Tab

Within the Navigation Panel, BRFplus objects are categorized into different views. In the Personalization settings, you can specify which views should be displayed and set the active view when the system starts. The available views include:

  • Repository: Access all objects from all applications in the repository.
  • Recently Used: Quickly access recently worked-on objects (up to 20 objects).
  • Favorites: View objects you've marked as favorites, useful for maintaining a permanent list of objects of interest.
  • Catalog: Define catalogs to group objects and access them conveniently from the repository.

These personalization options enhance your workbench experience, allowing you to tailor it to your specific needs and preferences.

Catalogs

A Catalog simplifies the rules maintenance process for business users:

  • Hides the Repository
  • Displays only the relevant objects necessary for the maintenance of business rules in a given business scenario

The workbench's navigation bar consists of a repository that offers an unrestricted view of BRFplus objects. To simplify the rules maintenance process for business users, a catalog is used to create user-specific or content-specific views. It achieves this by hiding the repository and displaying only the necessary objects for managing business rules in a specific scenario.

Catalogs are organized into three types of nodes:

  • Folder nodes are used to group other nodes.
  • Object nodes are linked to specific object, like a decision table or constant expression. These objects can be selected or created directly through the link menu.
  • Catalog nodes provide links to nodes from other catalogs, facilitating the reuse of existing catalogs.

Modes of Operation

BRFplus provides four modes of operation for processing a function: Functional mode, Event mode, Functional and Event Mode, and Analytical Mode. The different modes have the following characteristics:

Functional Mode

Experts input Top Expression and it provides the output in the Result, for example, BRFplus in Collections management processing.

Functional mode requires a top expression to be assigned to the function. During processing, the function triggers and evaluates the top expression. The top expression may use a number of nested expressions to find a result. The result of the top expression is the result generated for the function, which must be provided and is returned to the calling program. Common usage: Call BRFplus in Functional mode from a program, or a routine, where you expect to pass the parameters as input (via the top expression) and receive the output in the result variable(s).

Event Mode

Triggers as part of the business process and performs Actions in the system, for example, BRFplus in Form Bundle processing, or object-based taxes.

Event mode uses Rulesets to trigger processing instead of a top expression. A BRFplus Function can have numerous Rulesets assigned. Each Ruleset contains a number of Rules. A Rule consists of a condition and an action part. Common usage: In Form Bundle processing, BRFplus is called during the form processing and may execute various standard TRM Actions in the system, for example, to create master data, create or amend documents, create correspondence, filing obligations, and so on.

Functional and Event Mode

Combines the two modes above, for scenarios where both operating mechanisms are needed to fulfill the process requirements, for example, any scenario where you would like to return values to the caller from BRFplus, but also perform standard Actions.

Functional and Event mode is a combination of Functional mode and Event mode. As with Functional mode, assigning a top expression and a result data object is mandatory. In addition, rule sets can be processed so that actions can be performed, thereby possibly changing the context.

Analytical Mode

Used for evaluation of very large data sets persisted in the SAP HANA database, and in conjunction with SAP HANA Rules Framework.

Use BRFplus to create analytical functions with rules that are based on persisted data in CDS Views. These analytical functions use a database context for the query and a table object for the results. Requirements for using this mode:

  • SAP S/4HANA Cloud 1705.
  • SAP Decision Service Management 1.0 SP04. For information about DSM installation, see SAP Decision Service Management.
  • SAP HANA Rules Framework (HRF) 1.0 SP10 or higher. 

Note

Analytical mode is not commonly used, as it requires HRF and SAP S/4HANA Cloud. On-premise installations do not support this mode of operation. However, it is mentioned here for completeness of training. For more information, consult the SAP Help documentation and SAP HANA Rules Framework Installation Guide.