Gomplate Layout Templates
When specifying a task, there might be a need to pass dates between the storage and SAP systems, or vice versa.
Because different formats may be required, this can be done using the script parameter in either RFC calls or REST calls in the provided Parse() and Format() functions.
In addition, the layout is also required to format the timeFormat parameter in the logging section of the aqishare.
These functions require a layout as the first argument, which declares the format of the required date.
Mon Jan 2 15:04:05 MST 2006
Below is a reference of all available layouts to be used with both functions:
Required Part of Date | Use Layout |
---|---|
Year | 2006 or 06 |
Month | Jan , January , 01 or 1 |
Day of the week | Mon or Monday |
Day of the month | 2 _2 or 02 |
Day of the year | __2 or 002 |
Hour | 15 , 3 or 03 (PM or AM) |
Minute | 4 or 04 |
Second | 5 or 05 |
AM/PM mark | PM |
Examples
Format Date to SAP standard format
In SAP ABAP, the type for date fields is DATS, which is designed for calendar dates in the format YYYYMMDD
. To format a date to match this definition, use the following layout:
20060102
Use the following Format() function: Format("20060102", value);
where value
is the Date object.