SAP DDIC DATE TIME FUNCTIONS



Get Example source ABAP code based on a different SAP table
  


• DATN_DAYS_BETWEEN ABAP_SQL_FUNC
• DATN_ADD_DAYS ABAP_SQL_FUNC
• DATN_ADD_MONTHS ABAP_SQL_FUNC
• DATS_IS_VALID ABAP_SQL_FUNC
• DATS_DAYS_BETWEEN ABAP_SQL_FUNC
• DATS_ADD_DAYS ABAP_SQL_FUNC
• DATS_ADD_MONTHS ABAP_SQL_FUNC
• UTCL_CURRENT ABAP_SQL_FUNC
• UTCL_ADD_SECONDS ABAP_SQL_FUNC
• UTCL_SECONDS_BETWEEN ABAP_SQL_FUNC
• TIMS_IS_VALID ABAP_SQL_FUNC
• TSTMP_IS_VALID ABAP_SQL_FUNC
• TSTMP_CURRENT_UTCTIMESTAMP ABAP_SQL_FUNC
• TSTMP_SECONDS_BETWEEN ABAP_SQL_FUNC
• TSTMP_ADD_SECONDS ABAP_SQL_FUNC
• ABAP_SYSTEM_TIMEZONE ABAP_SQL_FUNC
• ABAP_USER_TIMEZONE ABAP_SQL_FUNC
• TSTMP_TO_DATS ABAP_SQL_FUNC
• TSTMP_TO_TIMS ABAP_SQL_FUNC
• TSTMP_TO_DST ABAP_SQL_FUNC
• DATS_TIMS_TO_TSTMP ABAP_SQL_FUNC
• TSTMPL_TO_UTCL ABAP_SQL_FUNC
• TSTMPL_FROM_UTCL ABAP_SQL_FUNC
• DATS_TO_DATN ABAP_SQL_FUNC
• DATS_FROM_DATN ABAP_SQL_FUNC
• TIMS_TO_TIMN ABAP_SQL_FUNC
• TIMS_FROM_TIMN ABAP_SQL_FUNC
• ADD_DAYS ABAP_SQL_FUNC
• ADD_MONTHS ABAP_SQL_FUNC
• DAYS_BETWEEN ABAP_SQL_FUNC
• IS_VALID ABAP_SQL_FUNC
• DAYNAME ABAP_SQL_FUNC
• MONTHNAME ABAP_SQL_FUNC
• WEEKDAY ABAP_SQL_FUNC
• EXTRACT_YEAR ABAP_SQL_FUNC
• EXTRACT_MONTH ABAP_SQL_FUNC
• EXTRACT_DAY ABAP_SQL_FUNC
• EXTRACT_HOUR ABAP_SQL_FUNC
• EXTRACT_MINUTE ABAP_SQL_FUNC
• EXTRACT_SECOND ABAP_SQL_FUNC

ABAP_DDIC - Date Functions and Time Functions
The following table shows the date and time functions that can be used by ABAP CDS and AB_SQL . The last three columns indicate where a function can be used. SQL FunctionResult ABAP CDS, DDIC-Based Views ABAP CDS, View Entities AB_SQL
ABAP_SYSTEM_TIMEZONESystem time zone in AS ABAP. x x x
ABAP_USER_TIMEZONEUser time zone in AS ABAP. x x x
ADD_DAYSAdds days to a date. -- x
ADD_MONTHSAdds months to a date. - - x
DATN_ADD_DAYSAdds days to a date. x x x
DATN_ADD_MONTHSAdds months to a date. x x x
DATN_DAYS_BETWEENDifference between two dates. x x x
DATS_ADD_DAYSAdds days to a date. x x x
DATS_ADD_MONTHSAdds months to a date. x xx
DATS_DAYS_BETWEENDifference between two dates. x x x
DATS_FROM_DATNConverts a date from type DATN to type DATS. x x x
DATS_IS_VALIDShows whether the argument is a valid date. x x x
DATS_TIMS_TO_TSTMPTime stamp for a local date and a local time. x x x
DATS_TO_DATNConverts a date from type DATS to type DATN. x x x
DAYNAMEShows the name of a day of a date. - - x
DAYS_BETWEENDifference between two dates. - - x
EXTRACT_DAYExtracts the day of a date. -- x
EXTRACT_HOURExtracts the hour of a time. - - x
EXTRACT_MINUTEExtracts the minute of a time. - - x
EXTRACT_MONTHExtracts the month of a date. - - x
EXTRACT_SECONDExtracts the second of a time. - - x
EXTRACT_YEARExtracts the year of a date. - - x
IS_VALIDShows whether the argument is a valid date, time, or time stamp. - - x
MONTHNAMEShows the name of a month of a date. - - x
TIMS_FROM_TIMNConverts a time from type TIMN to type TIMS. x x x
TIMS_IS_VALIDShows whether the argument is a valid time. x x x
TIMS_TO_TIMNConverts a time from type TIMS to type TIMN. x x x
TSTMP_ADD_SECONDSAdds seconds to a time stamp. x x x
TSTMP_CURRENT_UTCTIMESTAMPCurrent UTC time stamp. x x x
TSTMP_IS_VALIDShows whether the argument is a valid time stamp. x x x
TSTMP_SECONDS_BETWEENDifference between two time stamps in seconds. x x x
TSTMP_TO_DATSLocal date of a time stamp. x x x
TSTMP_TO_DSTLocal daylight saving time marker of a time stamp. x x x
TSTMP_TO_TIMSLocal time of a time stamp. x x x
TSTMPL_FROM_UTCLConverts a time stamp from type UTCLONG to type TIMESTAMPL. x x x
TSTMPL_TO_UTCLConverts a time stamp from type TIMESTAMPL to type UTCLONG. x x x
UTCL_ADD_SECONDSAdds seconds to a UTC time stamp. x x x
UTCL_CURRENTReturns the current UTC time stamp within a SELECT-statement.x x x
UTCL_SECONDS_BETWEENDifference between two UTC time stamps in seconds. x x x
WEEKDAYShows the number of a weekday of a date. - - x
The possible operands and data types are described in the corresponding documentation for ABAP CDS, DDIC-Based Views, ABAP CDS, View Entities and AB_SQL .