More flexible aging analysis key date: create a custom analytical query using CDS view and publish it as an app

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.

Business Context

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%20of%20predefined%20key%20date

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.

Procedure

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.

Create%20a%20query

Create a query

On the General tab, specify a label for the query and choose Next.

Specify%20a%20label

Specify a label

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.

Select%20from%20available%20fields

Select from available fields

Update Display of the Fields

Go to the Display tab, select a row, and make the following configurations for it.

  1. choose if you want to display it or not
  2. specify which axis it should show up
  3. specify if sorting is enabled or not
  4. Choose Up and Down to adjust the sequence of the fields

Update display

Update Filter

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.

Update%20filter%20for%20Key%20Date

Update filter for Key Date

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.

Preview%20of%20the%20query

Preview of the query

Publish the query as an app

Go to the View Browser app and find for the query (YY1_DEMO) I just created.

Find%20the%20query

Find the query

Go to the details page, and create application for the query.

Create application

The query now has got an application ID. Copy the ID for later use.

Application%20ID

Application ID

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.

Add%20app%20into%20business%20catalog

Add app into business catalog

It would be shown as an app on the Fiori Launchpad when you use the corresponding user to log on the launchpad.

App%20in%20launchpad

App in launchpad