Home ABAP CDS Views Date Functions in ABAP CDS Views

Date Functions in ABAP CDS Views


Hello everyone,

In this ABAP CDS View tutorial, you will learn how to use Date Functions in ABAP CDS view.


  • You have installed Eclipse IDE( Mars version )on your local machine.Click here to know more about.
  • You have installed ABAP Development Tools in Eclipse IDE.
  • You have access to minimum ABAP Netweaver 7.5 on HANA.
  • You have created ABAP Project in eclipse to connect to ABAP Netweaver 7.4 system.Click here to know how to create ABAP Project.

Please be note that Date and Time Functions are introduced in SAP NW ABAP 7.5

Below are the list of Date and Time Functions in ABAP CDS views.


1. DATE_IS_VALID(date)

The date function DATE_IS_VALID is used to validate the date contains the valid SAP date format “YYYYMMDD“. It returns “1” if the date is in valid date format else “0“. If the date is blank it returns “0“.

@AbapCatalog.sqlViewName: 'ZCDS_DATE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Date Functions'
define view zcds_date_functions
            with parameters p_from_date:abap.dats
            as select from snwd_so
  // returns 1 - Valid Date
  // returns 0 - Invalid Date
  DATS_IS_VALID(:p_from_date) as from_date

WordPress database error: [Table 'saplearn_wp1.wp_nsex_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_nsex_comments.comment_ID FROM wp_nsex_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2716 AND comment_parent = 0 ORDER BY wp_nsex_comments.comment_date_gmt ASC, wp_nsex_comments.comment_ID ASC


Comments are closed.