Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
JWiseman
Active Contributor
0 Kudos

You have a report that is grouped...let's use a group on customer name as an example. The end user has a parameter / prompt where they enter customer names. The report is also filtered on the customers entered.

 

The available options for a group are Ascending, Descending, Original Order, Specified Order, or by using a formula. The original order however does not give you the results you want as this done by original order from the database query.

 

This blog post will show you how to order the groups based on the order of values entered by the end user.

 

Steps:

 

1) create a new formula named GroupingFormula with syntax similar to below.

 

dim i as number
do
i = i + 1
loop until {Customer.Customer Name} = {?Group}(i)
formula = i

 

2) change the formula syntax type to Basic Syntax.

 

3) replace the "customer name" field with the field that you want to use for your group.

 

4) replace the "group" parameter with the parameter that you want to use for the filter and grouping order.

 

5) save the formula and then go to the Change Group dialogue for the group on your report.

 

6) change your existing group to the new GroupingFormula you created.

 

7) go to the Options tab and select Customize Group Name Field. select the field that your report was previously grouped on.

 

😎 press the OK button and your report will not be grouped in order of the values entered by the end user.