Pages

Monday 3 January 2022

Enter dates in your SAP Fiori Elements App without actually entering dates

Do you know you can use words like ‘now’, ‘tomorrow’, ‘today’, ‘yesterday’, ‘next month’, ‘next year’ etc. in a Fiori Element App Preview while entering values for date and timestamp fields without any additional implementation. This may come handy while testing RAP generated oData services through Preview Tool URLs.

Here is the list of all the words and how you can use these:

Open your Service Binding in ADT and select the entity which has date/timestamp fields enabled for CREATE mode. Hit Preview button in ADT to launch Fiori Elements App preview and then hit Create button in Fiori App Preview

Please note that all the screenshots were captured on April 5th, 2021 so all the next/previous dates are with reference to April 5th, 2021.

Enter ‘today’ in your date field

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter to see it picking today’s date automatically

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Similarly, input ‘yesterday’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘tomorrow’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘now’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next week’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next month’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next year’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last week’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last month’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last year’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Same also applies even to the Timestamp fields i.e. it adds respective date value and appends ‘current’ time value to it

Input ‘today’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘yesterday’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘tomorrow’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘now’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next week’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next month’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘next year’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last week’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last month’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Input ‘last year’

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Hit Enter

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Data Element behind attribute ‘Last Changed At’:

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Data Element behind attribute ‘End Date’:

SAP ABAP RESTful Application Programming Model, SAP BTP, SAP ABAP Environment, SAP ABAP Development, SAP ABAP Career, SAP ABAP Tutorial and Material, SAP ABAP Certification, SAP ABAP Guides

Screenshots attached are from ABAP Cloud trial environment, but same is also supported on On-Premise systems.

So, here is a quick summary of what have we learned – In order to enter some random/generic values in data/timestamp values in your SAP Fiori Elements App, you can also enter some generic keywords like ‘now’, ‘next week’, ‘last year’, ‘yesterday’ etc. Framework is intelligent enough to pick respective date and time as per the word entered, and this is in built and does not require any additional implementation. It usually saves time while we are testing our app, we won’t need to click each time on date/time picker to select a date/time.

Source: sap.com

No comments:

Post a Comment