Business Rules Framework Plus Integration

Use

The SAP Application Interface Framework provides an integration with the Business Rules Framework plus (BRFplus), which you can access using the BRFplus transaction code. BRFplus is a rule tool that provides a comprehensive application programming interface (API) and user interface (UI) so that you can define and implement technical and business process-oriented sets of rules.

Integration

A function is the rule interface in BRFplus and it acts as a link between the application code and the BRFplus code. A function carries a context and a result. It imports the context and returns a result after processing.

In the SAP Application Interface Framework, the BRFplus integration is done with a function that you define for value mapping, structure mapping, and checks. In Customizing for the SAP Application Interface Framework (transaction code /AIF/CUST) under Interface Development, you specify the name of the BRFplus application (in the BRFplus Application Name field) and the name of the BRFplus function (in the BRFplus Function Name field) under the following:

  • Define Value Mapping

  • Start of the navigation pathDefine Structure Mapping Next navigation step Assign Destination StructureEnd of the navigation path

  • Start of the navigation pathChecks Next navigation step Define Single ChecksEnd of the navigation path

Features

During data processing in the SAP Application Interface Framework, a BRFplus function, which is assigned to a value mapping, structure mapping, or check, is called. The data from the SAP Application Interface Framework is transferred to the BRFplus function. The BRFplus function is executed and the result is returned to the value mapping, structure mapping, or check.

Activities

In order to use a BRFplus function in the SAP Application Interface Framework, the function needs to be set up in the following specific ways:

Structure Mapping

A function for structure mapping within an application can have the following context:

Component Name in BRFplus Function

Description

RAW_STRUCT

Contains the source structure of the interface

RAW_LINE

Contains the row of the table/structure of the source structure for which the BRFplus mapping function is currently executed

SENDING_SYSTEM

A field of the source structure needs to be maintained in Field for the Sending System in the interface definition. If the BRFplus function should behave differently for different senders, you can use this parameter to differentiate the behavior.

OUT_STRUCT

Contains the destination structure

DEST_LINE

Contains the data of the current line in the destination structure. You might change the data of this parameter in this function module.

DEST_TABLE

Contains the data of the current structure in a table

You can define the following objects as result data objects:

  • OUT_STRUCT

  • DEST_LINE

  • DEST_TABLE

Value Mapping

A function for a value mapping within an application needs to be defined with the following context:

Component Name in BRFplus Function

Description

  • VALUE_IN

  • VALUE_IN2

  • VALUE_IN3

  • VALUE_IN4

  • VALUE_IN5

The fields defined in the field mapping (Fieldname 1 to Fieldname 5) are used as importing parameters.

SENDING_SYSTEM

A field of the source structure needs to be maintained in Field for the Sending System in the interface definition. If the BRFplus function should derive different values for different senders, you can use this parameter to differentiate the behavior.

Furthermore, one result data object, with a name of your choice, is required. The resulting value of the BRFplus function is passed back to the SAP Application Interface Framework. The value is passed to the corresponding field in the destination structure.

Check

A function for a single check within an application can have the following context:

Component Name in BRFplus Function

Description

DATA_STRUCT

Contains the data of the current structure. If the check is executed during structure mapping, the current structure is either the SAP or raw data structure. This is dependent on the Check raw data checkbox in the check assignment. If the check is executed in an action, the structure is the destination structure. If the check is executed for a condition, the current structure is the source structure.

DATA_LINE

Contains the current line of the structure that is mapped

DATA_FIELD

If the check is executed in the structure mapping or as condition and at least Fieldname 1 is defined, this field contains the value of the field defined in Fieldname 1.

  • VALUE1

  • VALUE2

  • VALUE3

  • VALUE4

  • VALUE5

Contains the values of the fields defined when the check is assigned (Fieldname 1 to Fieldname 5).

SENDING_SYSTEM

A field of the source structure needs to be maintained in Field for the Sending System in the interface definition. If the BRFplus function should behave differently for different senders, you can use this parameter to differentiate the behavior.

One result data object can be added. This result data object should simply indicate if the result of the function is successful or if it has an error.