In this post let’s traverse through the Time Functions. The 4 functions listed below shall be very handy to maneuver with Time.
Single Parameter needs to be passed. The field type should and must be TIMESTAMP – DEC – Length 15. Same goes with the rest of the functions in this blog.
- UTC TIME
Best part of this is there is no parameter that needs to given. By default returns us the Coordinated Universal Time (UTC).
- ADD SECONDS
As name suggests we add the seconds to the timestamp and the output is the sum of the numbers.
- SECONDS BETWEEN
Remember our last edition had DAYS BETWEEN. Now here we have seconds between.
Customs are not to be broken. How can we not provide the Code and sample output?
If this is not interesting, we have a bonus segment. This segment shall connect to different worlds : SAP and all other.
OData: Many of you have heard and worked on this beautiful concept. But how about connecting CDS with outer world (other than SAP) through OData service???
Also Take : ABAP on HANA Training
But, before that you need to hang on and bear with us since there was a special request from one of our followers (Ishan @guptism) from Twitter ( BTW our twitter handle is twitter/sapyard. Do follow us).
Ishan (@guptism), here you go:
@EndUserText.label:'Type Casting Examples'
So effectively two things needs to be kept in mind.
- Apply Type casting only when changing from one data type to other. If it is done within same data type the very purpose is not served.
- Need to be very careful such that no harm is done to data.
Another good learning for me !!! I tried to put non primary key castedConn before fldate. But SAP did not allow me. ?
This is the end of the functions series and the special request from Ishan.
Back to CDS View exposing through OData. We already have couple of article on OData from CDS Annotations at SAPYard. But, our next article on OData from CDS would be different and interesting. Well you need to wait for some more time as there is sparse space here. We promise to get it in just two days of time without bugging too much. Please stay Tuned.
Your feedback is most welcome. Please, please leave your comments below.
We have a very active Telegram (App) SAP Technical Group with more than 4900+ SAP Technical Practitioners from 6 Continents of the SAP World. Please join it using below link.
Telegram SAP Technical Discuss Group. You need to install the Telegram App first on your mobile device. Once you have it on your mobile, you can join the group and also access it from the Web on your computer and laptop.
Free Step by Step Core Data Services Exercises
- CDS Part 1. Core Data Services – Introduction
- CDS Part 2. Core Data Services – Deep Dive
- ABAP on SAP HANA. Part XII. Open SQL, CDS or AMDP, which Code to Data Technique to use?
- CDS Part 3. Expose CDS Views as OData Service through Annotation
- CDS Part 4. Data Access in S/4HANA Cloud – CDS View Introduction
- CDS Part 5. ABAP CDS Views With Authorization
- CDS Part 6. Basic Expressions & Operations Available for CDS View – I
- CDS Part 7. Basic Expressions & Operations Available for CDS View – II
- CDS Part 8. Usage of Built-In Functions in CDS – I
- CDS Part 9. Usage of Built-In Functions in CDS – II
- CDS Part 10. Usage of Built-In Functions in CDS – III
- CDS Part 11. How to Consume CDS View in Smart Business Service KPI Fiori Apps?
- CDS Part 12. Useful 6 CDS Related Tools in ADT
- CDS Part 13. Key Definition in CDS Views
- CDS Part 14. ABAP Annotations for Translatable Texts in CDS Views
- CDS Part 15. Associations in CDS Views – I
- OData Service from CDS Annotation Not Working in Browser Mode
- CDS Part 16. Usage of Built-In Functions in CDS – IV
- CDS Part 17. How to Overcome GUID Mismatch Linking Problem in ABAP CDS?