Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
akashkannan22
Explorer
0 Kudos

Introduction

In SAP HANA - CDS views need some customization to have the feature of Date Function in Parameter.
In this blog, we will learn on how to add date functions in custom cds views.

Environment
HANA Studio/ Eclipse

Solution
Let’s assume that you have a view with Posting Date and you need to Implement Date function on Posting Date, then follow below steps-
 

  1. There is a Standard CDS view - C_SglGregorianCalDateFunction which is based on datefunction_val transparent table.
 

akashkannan22_7-1712034584520.png

This table contains precalculated Start Date & End Date for respective date with date functions.

  1. C_SglGregorianCalDateFunction - Views need input parameter as Date Function & Language
 

akashkannan22_8-1712034627192.png

  1. Let’s join this CDS view with our view on posting date-

akashkannan22_9-1712034673677.png

  1. In your consumption query use below code for value help on date function parameter
 

akashkannan22_10-1712034722383.png

  1. Report output will be as below-
  • Date Function Prompt Screen-
 

akashkannan22_11-1712034748320.png

  • Previous Year To Date - Date Function
 

akashkannan22_12-1712034771745.png

  • Previous Year Date Function
 

akashkannan22_13-1712034798504.png

 

 

 

 

1 Comment
junwu
Active Contributor
0 Kudos

it is adt, not hana studio

your screenshot is too small, not really visible...

Labels in this area