Show TOC

Procedure documentationCreating BRFplus Functions

 

You can create BRFplus functions that the system can evaluate during outlier detection and event generation. You should use this procedure if you want to define complex BRFplus expressions and use them in outlier detection or future event creation.

Prerequisites

You have created a BRFplus application where you can save the expressions and functions you create. For more information, see the BRFplus documentation in SAP Library for SAP Supply Chain Management (SAP SCM) on SAP Help Portal at http://help.sap.com/scm702Information published on SAP site, under Start of the navigation path Cross-Application Services Next navigation step Business Rule Framework (BRF) End of the navigation path.

To use this function, you must activate the business function SCM-APO-FCS, Events and Outliers, Causals, ABC/XYZ Classification (SCM_APO_FORECASTING_1). For more information, see SCM-APO-FCS, Events and Outliers, Causals, ABC/XYZ Classification.

Procedure

The following procedure describes the technical details of creating BRF plus expressions and functions, and using them in outlier detection and event generation. For more information about how to use the BRFplus framework, see the BRFplus documentation in SAP Library for SAP Supply Chain Management (SAP SCM) at http://help.sap.comInformation published on SAP site, under Start of the navigation path Cross-Application Services Next navigation step Business Rule Framework (BRF) End of the navigation path.

  1. Run the FDT_WORKBENCH transaction.

  2. Create an expression and assign it to your application.

    Make sure that the expression contains rules that can be evaluated as occurrences (dates) of an event type.

  3. Create a function with the following signature:

    • Context: add data object IV_DATE to the context

    • Result data object: add data object RV_VALID as result data object

    The above data objects are available in the /SAPAPO/DP_EVENT_MANAGEMENT BRFplus application and are globally accessible.

  4. Assign your expression as top expression to your function.

  5. Save and activate the expression and the function.

  6. On the SAP Easy Access screen, under Start of the navigation path Advanced Planning and Optimization Next navigation step Demand Planning Next navigation step Environment Next navigation step Demand Planning Worklist End of the navigation path, create an event type with the definition BRFplus Function.

  7. Assign the BRFplus unction you created to the event type and specify the duration, periods before, periods after.

  8. Save the event type.

If you want to consider the event type in the automatic outlier detection, then you must assign the event type to an event catalog, and assign the event catalog to an outlier detection profile. Fore more information, see Demand Planning Worklist and the documentation for the Customizing activity Configure Outlier Detection and Event Catalog Assignments). When the system evaluates the function during automatic outlier detection, it supplies each date of a date range where an outlier was found. The system interprets the result as valid in case the BRFplus function returns a valid value, otherwise, as not valid.

Note Note

If you change the context of the function after you have assigned it to an event type of BRFplus Function, the system ignores the function during automatic outlier detection.

End of the note.

Example

Example 1.
  • Expression type: Formula

  • Expression:

    • Result: RV_VALID

    • Formula: IF(DT_GET_CURRENT_DATE()>IV_DATE,1=1,1=0)

  • Function:

    • Top expression: the formula

    • Signature:

      • Context: IV_DATE

      • Result Data Object: RV_VALID

Example 2.
  • Expression type: Decision table

  • Expression:

    • Table settings:

      • Result data object: RV_VALID

      • Columns:

        • IV_DATE

        • RV_VALID

      • Table data (direct value input) for date:

        • Set RV_VALID as return value for each line using the navigation to details option in the context menu.

      Example lines in table:

      • If IV_DATE is between 01.01.2010 and 01.03.2010 then RV_VALID is true, otherwise RV_VALID is false.

      • If IV_DATE is greater than 01.06.2010 then RV_VALID is true, otherwise RV_VALID is false.

  • Function:

    • Top expression: the decision table expression

    • Signature:

      • Context: IV_DATE

      • Result data object: RV_VALID