/FRE/DB_TS_GENERATE - module for generating time series

Addresses (Business Address Services)   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Functionality

This function module generates time series and additional information concerning time series.

A time series is a range of successive periods defined by imported start and end limiters. Those limiters can be days, weeks or months. For periodicity, days, weeks or months can also be used.

The periods of the time series will be written to an internal table.

  • For daily time series, an internal table with three formats is exported:
  • Date in date type dats, for example "20020501",

  • Date as character(10), for example "01.05.2002",

  • Date as character(13) with day name, for example "WE 01.05.2002".

  • For weekly time series, an internal table with two formats is exported:
  • Week in type ACCP, for example "200223",

  • Week as character(10), for example "CW 23.2002".

  • For monthly time series, an internal table with three formats is exported:
  • Month in type ACCP, for example "200205"

  • Month as character(9), for example "M 05.2002"

  • Month as character(6), for example "MAY 2002"

The function module can be used with two different parameter combinations (but can be combined with additional parameters):

  • Creating a time series from the imported start period to the imported end period
The time stream is divided into the required target periodicity. As start and end limiters dates, weeksor months can be imported. As target periodicity, days (= D), weeks (= W) or months (= M) can be required. When the time series is to be divided into days, the day type must be specified as well:
  • 1 = Calendar days

  • 2 = Weekdays

  • 3 = Workdays

To generate a time series for a target periodicity, any period type (date, week or month) can be importedas a limiter, but the imported start and end limiter must be of the same type. For example, to generate a daily time series (i_target_periodicity = D), the following import parameters are allowed:
  • i_start_date / i_end_date

  • i_start_week / i_end_week

  • i_start_month / i_end_month

  • Creating a time series via imported start date and an imported border period
Border periods may be weeks or months. The system calculates the appropriate border from the start dateand then splits it into the target periodicity (days, weeks or months). The allowed target periodicity depends on the border period:
border period target periodicity
Week Calendar days
 Weekdays
 Workdays
Month Calendar days
 Weekdays
 Workdays
 Weeks

Te following table shows the allowed combinations:

 I_TARGET_PERIODICITYI_DAY_TYPEI_FACTORY_CALENDARI_CALC_PERIOD_DATAI_INCL_BORDER_PERIOD_START/END
I_START_DATEI_END_DATE
start dateend dateD = days1, 2 or 31: not necessary; 2 or 3: necessary--
start dateend dateW = weeks--optionaloptional (related to target periodicity)
start dateend dateM = months--optional-
I_START_WEEKI_END_WEEK
start weekend weekD = days1, 2 or 31: not necessary; 2 or 3:necessary--
start weekend weekW = weeks--optional-
start weekend weekM = months--optionaloptional (related to target periodicity)
I_START_MONTHI_END_MONTH
start monthend monthD = days1, 2 or 31: not necessary; 2 or 3: necessary--
start monthend monthW = weeks--optionaloptional (related totarget periodicity)
start monthend monthM = months--optional-
I_START_DATEI_BORDER_INTERVAL
start dateW = weekD = days1, 2 or 31: not necessary; 2 or 3: necessary-
start dateM = monthD = days1, 2 or 31: not necessary; 2 or 3: necessary--
start dateM = monthW = weeks1, 2 or 3;1: not necessary; 2 or 3: necessaryoptionaloptional (related to target periodicity)

The possible day types are

  • 1 = Calendar days
  • 2 = Weekdays
  • 3 = Workdays

The parameter I_CALC_PERIOD_DATAcan only be set in combination with an imported factory calendar.

The import of the factory calendar is always necessary for day types 2 and 3, or when additional period data is required.

For the combinations, the day type is necessary in order to decide whether a week is to be included or not:

  • Start date, border interval = M, target periodicity = W
  • Start month, end month, target periodicity = W

Example

Notes

Further information


Parameters

ET_PERIOD_DATA
ET_TS_DAILY
ET_TS_MONTHLY
ET_TS_WEEKLY
I_BORDER_INTERVAL
I_CALC_PERIOD_DATA
I_DAY_TYPE
I_END_DATE
I_END_MONTH
I_END_WEEK
I_INCL_BORDER_PERIOD_END
I_INCL_BORDER_PERIOD_START
I_NUM_FUTURE_PERIODS
I_NUM_PAST_PERIODS
I_PLANNING_CALENDAR
I_START_DATE
I_START_MONTH
I_START_WEEK
I_TARGET_PERIODICITY
I_TZONE

Exceptions

/FRE/CX_DB
/FRE/CX_DB_CALENDAR_NOT_FOUND
/FRE/CX_DB_TS_CALL_MODULE
/FRE/CX_DB_TS_INTERNAL_ERROR
/FRE/CX_DB_TS_WRONG_PARAM
CX_STATIC_CHECK

Function Group

/SAPLDB_TS

PERFORM Short Reference   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.


Length: 10946 Date: 20120524 Time: 122833     triton ( 222 ms )