Ansicht
Dokumentation
ABENASQL_CDS_SERIES_GENERATORS - ASQL CDS SERIES GENERATORS
Fill RESBD Structure from EBP Component Structure RFUMSV00 - Advance Return for Tax on Sales/PurchasesThis documentation is copyright by SAP AG.
SERIES_GENERATE_, Series Generators
Series generators are a set of CDS system entities realized as CDS table functions that create a table that contains a series of numbers, dates, times or time stamps.
Note
All generic functions enforce strict mode from Release .
Common Parameters and Result
All CDS table functions have the following mandatory parameters:
Parameter | Details |
step | Number that defines the increment value for the series to be generated, for example, numbers, seconds or days depending on the table function used. \lbr \lbr step is of type INT4. It must be greater than 0. If step is greater than the difference of the parameters to_value and from_value, the result is an initial table. |
from_value | Start value of the series. The type depends on the table function used. |
to_value | Final value of the series. However, the value is not included as value in the generated_period_end field in the generated table since the series ends with the step before the to_value is reached. The type depends on the table function used. |
The tables that are created have the following fields:
Field | Details |
generated_period_start | Start value of a generated period of the series. The value of generated_period_end becomes the new value for generated_period_start of the next period. |
generated_period_end | Final value of a generated period of the series. The defined parameter to_value is not included in the table. |
element_number | Number of the period. It is consecutively numbered. |
fraction_of_min_max_range | The calculated value of ( generated_period_end - generated_period_start ) / ( to_value - from_value ). |
SERIES_GENERATE_DATE
The CDS table function SERIES_GENERATE_DATE creates a table with a series of dates. The following types are used:
- Parameters:
- step: INT4
- from_value: DATN
- to_value: DATN
- The table is of type SERIES_GENERATE_DATE and has the following fields:
- generated_period_start: DATN
- generated_period_end: DATN
- element_number: INT8
- fraction_of_min_max_range: FLTP
The following source code demonstrates the creation of a series of dates using the CDS system table function SERIES_GENERATE_DATE.
SERIES_GENERATE_INTEGER
The CDS table function SERIES_GENERATE_INTEGER creates a table with a series of numbers. The following types are used:
- Parameters:
- step: INT4
- from_value: INT4
- to_value: INT4
- The table is of type SERIES_GENERATE_INTEGER and has the following fields:
- generated_period_start: INT4
- generated_period_end: INT4
- element_number: INT8
- fraction_of_min_max_range: FLTP
Example
The following source code demonstrates the creation of a series of numbers using the CDS system table function SERIES_GENERATE_INTEGER.
SERIES_GENERATE_TIME
The CDS table function SERIES_GENERATE_TIME creates a table with a series of times. The following types are used:
- Parameters:
- step: INT4
- from_value: TIMN
- to_value: TIMN
- The table is of type SERIES_GENERATE_TIME and has the following fields:
- generated_period_start: TIMN
- generated_period_end: TIMN
- element_number: INT8
- fraction_of_min_max_range: FLTP
Example
The following source code demonstrates the creation of a series of times using the CDS system table function SERIES_GENERATE_TIME.
SERIES_GENERATE_TIMESTAMP
The CDS table function SERIES_GENERATE_TIMESTAMP creates a table with a series of time stamps. The following types are used:
- Parameters:
- step: INT4
- from_value: UTCLONG
- to_value: UTCLONG
- The table is of type SERIES_GENERATE_TIMESTAMP and has the following fields:
- generated_period_start: UTCLONG
- generated_period_end: UTCLONG
- element_number: INT8
- fraction_of_min_max_range: FLTP
Example
The following source code demonstrates the creation of a series of time stamps using the CDS system table function SERIES_GENERATE_TIMESTAMP.
Exceptions
Catchable Exceptions
- Cause: Increment value must be a positive value.
Runtime Error: DBSQL_SQL_ERROR
BAL Application Log Documentation Addresses (Business Address Services)
This documentation is copyright by SAP AG.
Length: 15218 Date: 20240511 Time: 074213 sap01-206 ( 108 ms )