Get Example source ABAP code based on a different SAP table
• TIMS_IS_VALID ABAP_CDS_FUNCTION_V1
ABAP_CDS_DDL - DDIC-Based View, Time Functions
ABAP_SYNTAX ... TIMS_IS_VALID(time) ...>
ABAP_VARIANTS: 1 ... TIMS_IS_VALID(time)>
What does it do? In a ABAP_CDS_V1_VIEW >, these functions execute operations with arguments of the built-in data type TIMS>>. The functions have positional parameters> to which actual parameters need to be assigned when called. There are currently no optional parameters. Suitable fields of a data source>, literals>, parameters>, path expressions>, built-in functions, or expressions can all be specified as actual parameters. If an actual parameter contains the null value>, every function except TIMS_IS_VALID> returns a null value.
Latest notes: It is not currently possible to access the current system time directly in a CDS view. Instead, a CDS view 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_VARIANT_1 ... TIMS_IS_VALID(time)>
What does it do? The function TIMS_IS_VALID> determines whether time> (if specified) contains a valid time in the format HHMMSS>. The actual parameter must have the built-in data type TIMS>>. 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.
ABAP_EXAMPLE_VX5 The following CDS view applies time functions in the SELECT> list to columns of the DDIC database table DEMO_EXPRESSIONS>>. The class CL_DEMO_CDS_TIME_FUNCTIONS>> uses SELECT> to access the view. The column TIMS1> of the DDIC database table can be given any values. DDLS DEMO_CDS_TIME_FUNCTIONS ABAP_EXAMPLE_END