Financial Management Blogs by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
Showing results for 
Search instead for 
Did you mean: 

Hello everyone, I want to share how to create a simple row id number using a calculation function in SAP Profitability and Performance Management.

In order to solve this, I’ve come with a solution that creates a consecutive number (1,2,3,4…) using SAP HANA database function ROWNUMBER() that is calculated in a key figure field (List #) using a calculation function.

In the following example I will detail how to create step by step:

For the example I created two environment fields:

Owner Name: This fields stores a person name

List #: This field will store the ID


Then I created a model table (Sample Input Data), this will have both fields, then I filled manually it with the following sample data:

To calculate the ID number, I used a calculation function (List Number Calculation) where the model table (Sample Input Data) is our input function and defining the "List #" field as an action field.


Using the formula function, the field “List #” has a formula with the following code:

When I run the function, the result sorts by the field “Owner Name” and calculates a consecutive for the input data.

As you can see, the "List #" has been filled with a consecutive ID number, no matter if registers are repeated

In the end, you will have your input data (model table) and your result data (calculation) as shown:

Hope it comes useful in your projects. You can also try even more complex IDs using the rest of SAP  HANA functionalities through the calculation function formula.

If you want to know more about SAP Profitability and Performance Management and SAP HANA functions, you can consult the following SAP Help links:

SAP HANA SQL functions:

SAP Profitability and Performance Management functions:

Let me know if there are any questions