SAP CDS TIME FUNCTIONS V2



Get Example source ABAP code based on a different SAP table
  


• TIMS_IS_VALID ABAP_CDS_FUNCTION

ABAP_CDS_DDL - CDS View Entity, Time Functions

ABAP_SYNTAX
... TIMS_IS_VALID(time) ...

What does it do?
In a CDS view entity, the function TIMS_IS_VALID determines whether the positional parameter time contains a valid time in the format HHMMSS. The actual parameter must have the built-in data type TIMS. time can be specified as literal, field of a data source, parameter, path expression, reuse expression using $projection, an SQL-based scalar function, or built-in function. The result has the data type INT4. A valid date produces the value 1 and all other input values (including the null value) produce the value 0.



Latest notes:

It is not currently possible to access the current system time directly in a CDS view entity. Instead, a CDS view entity can be given an appropriate input parameter. The special annotation @Environment.systemField makes it possible to pass the value of the ABAP system field sy-uzeit to this parameter.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
The following CDS view entity demonstrates how to use the time function TIMS_IS_VALID. The class CL_DEMO_CDS_TIME_FUNC_VE uses SELECT to access the view. You can assign any value to the column TIMS1 of the DDIC database table DEMO_EXPRESSIONS.
DDLS DEMO_CDS_TIME_FUNC_VE
ABAP_EXAMPLE_END