Show TOC

 Calculation of Time Intervals and Dates Locate this document in the navigation structure

Use

If you have entered the duration, start or end dates of time intervals in the PI sheet, you can use a function call to calculate the missing data from this (for example, calculate the end date from the start and duration).

The calculation is carried out on the basis of the valid calendar, that is weekends and public holidays are not included in the duration. They are, however, used to calculate the start and end dates.

Features

Calculating the Duration from the Start and End Date

You can use function call C_DURAT (function module COPF_DETERMINE_DURATION) for this.

The function module contains the following export parameters:

  • Start and end dates (date and time)

You transfer these values from a preceding process instruction using variables; see Use of Variables in Process Instructions .

  • The time unit of the duration if it is not to be calculated in days

  • If required, a factory calendar

If you do not assign a calendar, the Gregorian calendar is used.

The duration is defined as an import parameter in the function call. It is calculated by the function module and transferred to the PI sheet in the time unit you have specifies. It is displayed after the corresponding pushbutton.

Calculating the End Date from the Duration and Start Date

You can use function call C_END_T (function module COPF_DETERMINE_END_TIME) for this.

The function call contains the following export parameters:

  • Start date (date and time) and duration (without weekends and public holidays)

You transfer these values from a preceding process instruction using variables; see Use of Variables in Process Instructions .

  • The time unit of the duration if it is not specified in days

  • If required, a factory calendar

If you do not assign a calendar, the Gregorian calendar is used.

The end date and time are defined as import parameters in the function call. They are calculated by the function module and transferred to the PI sheet. They are displayed after the corresponding pushbutton.

Calculating the Start Date from the Duration and End Date

You can use function call C_STRT_T (function module COPF_DETERMINE_START_TIME) for this.

The function call contains the following export parameters:

  • End date (date and time) and duration (without weekends and public holidays)

You transfer these values from a preceding process instruction using variables; see Use of Variables in Process Instructions .

  • The time unit of the duration if it is not to be specified in days

  • f required, a factory calendar

If you do not assign a calendar, the Gregorian calendar is used.

The start date and time are defined as import parameters in the function call. They are calculated by the function module and transferred to the PI sheet. They are displayed after the corresponding pushbutton.