###### Technical Articles

# SAP Commissions – 11 Tips to write better and reusable functions

## Writing better functions can save even more time during pipeline calculation

This article will introduce how to write better functions in your formula or in a rule which you can consider it be required as default, so you can re-use at any point in time in your SPM projects.

**Functions** are predefined formulas provided by SAP Commissions that you can use in compensation rules to calculate and specify values or conditions. In general, functions fall into groups based on their use. For example, a group of functions, called order-level functions, is provided to calculate summary information related to transactions on an order for use in writing credit rules based on orders. Most functions are accessible from the functions listing in the Legal Moves pane. A few functions are accessible from the data fields listing in the Legal Moves pane. These functions are known as data field functions.

The list of functions that are available in SAP Commissions in a particular context depends on the kind of formula, the return type of the formula, and the input to the formula.

Real examples are below is really simple, now we need to find a way to combine them, the more traditional way would be to **put functions as arguments of the next function by calling Formula**

**Feel free to save it, and use it wherever you find it valuable!**

List of formula’s calling functions which can be common re-usable to have better calculation.

## Related Articles

- Absolute
- Calculate Result
- Concatenate Two Strings
- Convert Boolean to Value
- Convert Null to Value
- Convert String to Upper Case
- Convert String to Value
- Convert Value to Boolean
- Current Period
- Equals (Ignore Case)
- Is Null and IsDateNull
- Is In Range
- Max and Min
- Other Position’s Quota or Fixed Value
- Participant.Version() and Position.Version() Functions
- Round
- Set Unit Type
- Transaction.Payee Pre-Assignment () Functions
- Transaction.Classifier()
- Trim String
- Trunc

**Related Articles**

- About Date Functions
- Add Time to Date
- Calendar Start Date and Calendar End Date
- Convert Date to String
- Convert Number to Date
- Convert String to Date
- Fiscal Date
- Fiscal Period Start Date and Fiscal Period End Date
- Measure Time Between Dates
- Measure Time Overlap
- Measure Period Overlap Percentage
- Measure Periods Between Dates
- Measure Period Overlap
- Measure Period Overlap Percentage

## Related Articles

- Sum Prior Quotas or Fixed Values
- Sum Prior Measurements
- Sum Measurements to Date by Participant
- Sum Prior Measurements by Participant
- Sum Prior Incentives
- Sum Incentives to Date by Participant
- Sum Quotas or Fixed Values to Date
- Sum Measurements to Date
- Sum Incentives to DateSum Deposits to Date and Sum Deposits to Date with Status

**Conclusion**

Hopefully, this article gave you an insight into the benefits of functions composition and how you can introduce it in your everyday work, **if you have any questions leave a comment!**

I hope it helped you learn something new!

Hello Yogananda and thanks for the articles!

how can I calculate if the Compensation Date is included in a range of six months calculated starting from another date present on a lookup table?

is it feasible in your opinion?

Thank you in advance.

Daniele Antonioli

yes possible to pass the date into function. you can use Plugin function to get the date from lookup table.