Zum Hauptinhalt springen

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.

Reference time Layout
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 DateUse Layout
Year2006 or 06
MonthJan, January, 01 or 1
Day of the weekMon or Monday
Day of the month2 _2 or 02
Day of the year__2 or 002
Hour15, 3 or 03 (PM or AM)
Minute4 or 04
Second5 or 05
AM/PM markPM

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:

Layout for SAP dates
20060102

Use the following Format() function: Format("20060102", value); where value is the Date object.