Defining Execution Times with Time Windows 
A time window defines a time interval in which something can occur: for example the time a specific job definition is allowed to run, the opening time of a queue. A time window is made up of time window elements. Each of these elements defines a period of time. These elements can used fixed dates and times, rules such as "the first working day of the month", or a combination of both (dates and times and rules). A set of time window elements does not need be continuous.
The "enabled during" time window restricts the open period of time window to the open period of the "enabled during" time window. The "disabled during" time window restricts the open period of time window to the period where the "disabled during" time window is closed. This holds for both time window and time window element.
Time windows are part of the 'Environment' section in the navigation bar. A number of standard time windows are provided with SAP CPS representing common holiday calendars and time periods. The prefixes used for these are:
System_BE - Belgium specific holidays and fiscal periods.
System_CA - Canada specific holidays and fiscal periods.
System_DE - Germany (and German state) specific holidays and fiscal periods.
System_US - United States of America specific holidays and fiscal periods.
System_GB - Great Britain specific holidays and fiscal periods.
System_NL - Netherlands specific holidays and fiscal periods.
System_Christian - Christian holidays used in some countries.
System_World - World holidays used in some countries.
System_ - other system time windows.
Note
Nesting of time windows should be kept to a minimum. When deep nesting is used, the processing time for the job can increase significantly.
Note
If the specified "day from" is after the last day of the month, it defaults to the last day of the month. This can have consequences for months with only 30 days and especially for February.
Note
When you define a time window that is valid in a single time zone, it is recommended to set that time zone in the time window.
Time windows support the following actions:
Action |
Description |
Export |
Export the time window into a CAR file |
Edit |
Edit the time window |
Edit Security |
Edit the security of the time window |
Delete |
Delete the time window |
Duplicate |
Make a copy of the time window to create a similar one |
Expand All |
Expand all time windows in the current filter |
New |
Create a new time window |
Filter > New Filter |
Create a new time window filter |
Filter > Edit Filter |
Edit current time window filter |
Filter > Delete |
Delete current time window filter |
Time windows allow you to shift the time that a day starts. The Dutch railway company, for example, decided that for their schedule, the night from Friday to Saturday is still Friday. Saturday starts at 6 AM. Therefore, they want to specify that a job that is submitted for Friday 4 AM, actually runs on Saturday 4 AM. This can be achieved by using the OffsetTimeOfDay attribute of time window elements. Note that the start time of jobs will only be modified when . For example, if the Dutch railway schedule a job for execution at midnight with a time window, which has anOffsetTimeOfDay set to 6 AM, the job will actually run the following day at 6AM.
Calendar time windows are normal time windows with the restriction that they do not specify times; they are always open for the whole day. They allow you to shift days forward or backward. This allows you to compensate public holidays or when the last day of the month falls a Sunday, for example. You can compensate for that by shifting a process a few working days forward or backward. This works by comparing two time windows, the reference is the main time window, if an open day of that time window is closed in the Shift time window, then the process is shifted forward or backward according to a third time window. The second (Shift) time window specifies when to shift (when the Shift time window is closed), the third (Stride) time window, defines the stride of the shift (n number of open days), the number of steps to move (n) is defined in the main time window.
For example, your process runs on the last day of the month, when this is a weekday (Mon-Fri). When the last day of the month is a Saturday, Sunday or public holiday, you want to shift that process to the preceding workday.
You create three calendar time windows, the first is closed on Public Holidays and is named TW_Closed, the second is open Monday to Friday and is named TW_WeekDay, the third is your main time window named TW_Cal, it is open on the last day of the month, when an open day in TW_Cal is closed in TW_Closed then we shift the process to the preceding open day in TW_WeekDay.
Another example, your process runs on the 3rd workday of every month according to the FR factory calendar in your SAP system.
You create 3 calendar time windows. A time window that is always closed, named PR1_NEVER. A PR1_FR time window, which is defined by the period function SAP_FactoryCalendar, it will need the following parameters: calendar=PR5 FR. SAP CPS will use that time window to move forward according to the factory calendar. A time window PR1_3RD_WORKDAY with a time window element "on the last day of the month" and the shift condition "If an open day is closed during PR1_NEVER then shift this day forward to the 3rd following open day in PR1_FR". See the step-by-step example below for this.
Calendar time windows have the following restrictions:
On the calendar time window:
All referenced time windows must be calendars.
Time zone cannot be set.
On elements of a calendar time window:
All referenced time windows must be calendars.
Date From and Date To cannot be set.
Time of Day From and Time of Day To cannot be set.
Time zone cannot be set.
Calendar time windows are evaluated in the time zone of the job. The time zone of the job is the time zone specified in the submit wizard. When the job was submitted from RedwoodScript, without specific time zone, the central server time zone is used for the job time zone.
In the preview pane of a time window, a calendar displays the current month and the days and time the currently selected time window is open. It shows the time of the current day by default but different days, months, and years can be selected. It shows a blue bar when a time window is open, a light blue bar when a time window opens and a white bar when the time window is closed. This can help fine tune a time window and can help you make sure you have made no mistakes when you created the time window.
The time scale below the calendar shows the time of the currently selected day the time window is open,
An overview table is displayed on the right-hand side and gives you an overview over all the times and dates of the current month the time window opens and closes.
When you use restrictions, for example from Monday to Tuesday, and the from value comes after the to value, the process server will automatically wrap. The following list illustrates the behavior:
A range of months wraps around a year, for example, from November to February will be interpreted as from November (this year) to February (next year)
A range of days of the month (with an offset) wraps around a month, for example ''from 26
(this month) to 5 (next month)''
A range of weekdays (with an offset) wraps until the following week.
A range of times of day (with an offset allowing to cross midnight) from 23:00 (today) to 2:00 (tomorrow)
Note
Offsets are specified in hours and wrap at 24.
You can search for time windows using filters and the Search Time Windows box on the Time Windows tab. This box is known as the intelliSearch box lndocated under your username on the top right-hand side of the user interface. Filters allow you to specify a list of objects with static criteria. IntelliSearch allows you to specify complex queries in a simple way using prefixes. Prefixes are used to specify which property you are searching in and have short and long syntaxes. For example, if you want to display all time windows with the term import in the comment, you would use the search criteria as follows:
c:import
You can search more than one property, as follows:
c:import n:Bi
Note
No spaces should be entered before or after the colon (:).
See the Advanced Object Search for more information.
The following table illustrates the available prefixes for time windows:
Prefixes |
Description |
n, name |
searches the name property |
c, com, comment |
searches the comment property |
d, desc, description |
searches the description property |
a, app, application |
searches the application property |
You can only delete time windows when no other objects relate to them. For example, if there are jobs that have run with the time window, the time window cannot be deleted until all jobs that ran with it have been deleted. You can see all jobs that relate to the time window in Related Objects in the lower detail pane and on the show page.
The table in related objects contains three columns:
Type - the type of object with a link to it
Related Object - the name of the object with a link to it
Used As - objects can sometimes be used in different roles
Privilege |
Description |
TimeWindow.Create |
Create time windows |
TimeWindow.Delete |
Delete time windows |
TimeWindow.Edit |
Edit time windows |
TimeWindow.View |
Access time windows |
You can grant privileges on two levels, Access and Admin; a privilege granted on Admin level allows the grantee to grant the privilege to other users. These privileges can be granted system-wide, per partition or isolation group.
If you have the security module, which requires the Module.Security license key, you have an additional Security tab on the time window. It allows you to specify which users can access, edit, and delete the time window.
Choose .
Choose Refresh to see all existing time windows.
Choose New to create a time window.
Fill in the details, refer to the section below.
Choose Save and Close to save the time window.
The configuration details for time windows can be found in the Configuration Data for Time Windows section of the documentation.
The BRLN_AIXS4 is going to be upgraded and a time window needs to be created.
Choose in the Navigation bar.
Choose the New button and fill in the values for the Time Window tab.
Choose the Elements tab and choose New and fill in the values for the Elements tab.
Choose Save and Close.
Note
You can choose Calendar to choose a from and until day.
Name: DataWareHouseUpgrade
Description: Data Warehouse Upgrade
Comment: BRLN_AIXS4 will be upgraded and unavailable the 15th of march
from: 15-03-2009 17:30
until: 15-03-2009 20:30
Recommendation
SAP CPS contains many predefined time windows that can be used to create new time windows. However, never remove built-in time windows.
You want to have a job run on every third workday of the month accroding to an SAP Factory Calendar
Choose .
Choose Refresh to see all existing time windows.
Choose New from the context menu to create a time window, fill PR1_Never into the Name field and check the field Is Calendar.
Choose Save & Close and choose New from the context menu.
Fill PR1_FR into the name field and check the field Is Calendar.
On the Elements tab, fill SAP_FactoryCalendar into the and period funciton field, fill calendar=PR5 FR into the with parameters field.
Choose Save & Close and choose New from the context menu.
Fill PR1_3RD_Workday into the Name field, check the Is Calendar field.
Fill PR1_Never into the If an open time window is closed during field.
Choose Forward in the then shift this day field, fill 3 and PR1_FR into the to the and open day in fields.
Choose Save, inspect the open times on the Opens at tab to make sure they are ok.
Choose Save & Close.