In this blog post, I would like to show you how to adjust the key date for aging analysis (for accounts payable) with more flexibility. I will use an example to demonstrate the process.
Aging Analysis is an app that can be used for displaying payable amount by aging, suppliers, company code, etc. You can view aging analysis of different periods by adjusting the key date. However, the current situation is that the key date options are predefined with limited flexibility for selection.
List of predefined key date
What if you want to view the aging analysis based on the key date that is out of the scope of the predefined date list?
This blog post provides a possible solution—you can create a custom analytical query using CDS view, publish it as an app, and use this custom app to make aging analysis.
Create Custom Analytical Query
In the app Custom Analytical Queries, choose Create to create a new query, or choose Copy to copy a query from an existing one. Fill in the query name, select a data source, and choose OK.
On the General tab, specify a label for the query and choose Next.
In Field Selection, select the checkbox after the the available fields and the selected fields will start showing on the Free section on the right side.
Update Display of the Fields
Go to the Display tab, select a row, and make the following configurations for it.
- choose if you want to display it or not
- specify which axis it should show up
- specify if sorting is enabled or not
- Choose Up and Down to adjust the sequence of the fields
Go to the Filter tab, select a row for a specific field and set filter values for it.
To enable a date picker for the Key Date field, I specify user input values for the field, and define the relative date TODAY as the start value. The lookup entity is defined by default for the user input value.
After saving the query, I can have a preview of it. This is how it looks like. I can see that a date picker which starts from Today (the day I create this query) is enabled for the Key Date field.
Publish the query as an app
Go to the View Browser app and find for the query (YY1_DEMO) I just created.
Go to the details page, and create application for the query.
The query now has got an application ID. Copy the ID for later use.
Go to the Custom Catalog Extensions app and search for the app by the ID. Add the app into the business catalog in which you would like to see it.
It would be shown as an app on the Fiori Launchpad when you use the corresponding user to log on the launchpad.