Show TOC

Definition of Query FormulasLocate this document in the navigation structure

During the definition of query result fields and query selection criteria (see Definition of Query Result Fields and Definition of Query Selection Criteria), you can define formulas. Formulas are formal descriptions of how to compute a field value from available information. You can use them in place of a field value in a search criterion, or to allow the enhancement of the result that the search connector provides with additional fields. BCV uses Business Rules Framework plus (BRFplus) to define formulas, which are called functions in BRFplus. For more information, see SAP Library at http://help.sap.com, under Start of the navigation path SAP NetWeaver Next navigation step SAP NetWeaver 7.0 including Enhancement Package 1 Next navigation step SAP NetWeaver Library  Next navigation step SAP NetWeaver by Key Capability Next navigation step Application Platform by Key Capability Next navigation step Business Services Next navigation step Business Rule Framework plus End of the navigation path.

Example

You can use formulas in the following ways:

  • A new result field STATUS_ICON contains the icon for a green, yellow, or red traffic light. It is dependent of the product total stock value (query result field) and two threshold values (query input fields) given as input. The formula for the new result field gets the total stock value of each product and decides if it is below threshold value one (for red), between threshold value one and two (for yellow) or above threshold two (for green). You have defined the total stock value and both of the threshold values as input parameter of the formula (BRFplus function). The output parameter is the new defined result field STATUS_ICON of type Icon and has the values @08@ (green), @09@ (yellow) or @0A@ (red).

  • A query input field needs the last day of a year, but the selection criterion does not contain a date field, only a query input field for the year. The system then calculates the necessary date value by use of the predefined BRFplus function LAST_DAY_OF_YEAR with year as input and a date as output.

Recommendation

For more information about the setting of individual fields, see the field help and input help texts.