Entering content frame

Function documentationDate Functions Locate the document in its SAP Library structure

Refer to the following table to find the function of your choice. The functions are listed in alphabetical order.

Function

Explanation

ALERT_BDATE()

ALERT_BDATE( ALERT ) returns the start date of the earliest valid alert/status of the alert/status type specified by ALERT for the current selection. The argument of this function is an alert/status element.

ALERT_EDATE()

ALERT_EDATE( ALERT ) returns the finish date of the latest valid alert/status of the alert/status type specified by ALERT for the current selection. The argument of this function is an alert/status element.

BUCKET_BDATE()

BUCKET_BDATE( X1 ; ... ; Xn ) returns the earliest start date of the periods given by the cell(s), row(s), and/or column(s) (not areas) X1 through Xn of the planning table or the auxiliary table. This date is expressed in whole numbers with reference to the date 0001/01/01. In the attributes of the argument elements, you must specify Period data as the data source.

BUCKET_DATE_IN()

BUCKET_DATE_IN( X ; Y1 ; ... ; Yn ) returns 1 if date X falls within the periods given by the cell(s), row(s), and/or column(s) (not areas) Y1 through Yn. Otherwise, 0 is returned. The date X (for example, the function TODAY or DATE()) is expressed in whole numbers with reference to the date 0001/01/01. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row, or column from the planning table or the auxiliary table. In the attributes of the argument elements Y1 through Yn, you must specify Period data as the data source.

BUCKET_DAYS()

BUCKET_DAYS( X1 ; ... ; Xn ) returns the number of Gregorian calendar days of the periods given by the cell(s), row(s), and/or column(s) (not areas) X1 through Xn. In the attributes of the argument elements, you must specify Period data as the data source.

BUCKET_EDATE()

BUCKET_EDATE( X1 ; ... ; Xn ) returns the latest finish date of the periods given by the cell(s), row(s) and/or column(s) (not areas) X1 through Xn. This date is expressed in whole numbers with reference to the date 0001/01/01. In the attributes of the argument elements, you must specify Period data as the data source.

BUCKET_FISCAL_PERIOD()

see FISCAL_PERIOD()

BUCKET_WDAYS()

BUCKET_WDAYS( <calendar> ; X1 ; ... ; Xn) returns the number of workdays in the periods given by the cell(s), row(s), and/or column(s) (not areas) X1 through Xn. In the attributes of the argument elements, you must specify Period data as the data source. The specification of a calendar as the first argument is optional. If you do not specify a calendar, the system reads the calendar given by the time stream in the storage buckets profile. If no time stream is defined, the system uses calendar days.

CALENDAR_WDAYS()

CALENDAR_WDAYS( ‘calendar’ ; from date ; <to date> ) returns the number of workdays between the from-date and the to-date in the calendar specified. The calendar is the timestream ID.

DATE()

DATE( YYYYMMDD ) returns the integer value which corresponds to the number of days between 0001/01/01 and the specified date. You enter the date YYYYMMDD in the format YYYYMMDD in an Operator/function dialog box. For example, DATE( 19990101 ) = 729756. Use this function in order to include a fixed, known date in a macro.

DATE_TO_CHAR ()

Syntax

DATE_TO_CHAR ( Number of days )

Number of days: Number of days since 0001/01/01.

Description

DATE_TO_CHAR () returns the date as a string.  The function calculates the date starting at 0001/01/01 and adding the Number of days. The system uses the date format that is saved in user master data.

DAY()

DAY( X ) returns the day in a date that is expressed in whole numbers with reference to the date 0001/01/01. Example: DAY( DATE( 19990220)) = 20. The argument can either be a number you enter in an Operator/Function dialog box or one of the macro elements cell, row, or column from the planning table or auxiliary table.

FISCAL_BDATE()

FISCAL_BDATE( X, 'fiscal year variant' ) returns the start of the posting period that contains the date X (expressed in whole numbers with reference to the date 0001/01/01). You can enter the date as DATE ( 19990101 ) or use other date functions such as BUCKET_EDATE(). The second argument specifies the fiscal year variant.

FISCAL_EDATE()

FISCAL_EDATE( X, 'fiscal year variant' ) returns the end of the posting period that contains the date X (expressed in whole numbers with reference to the date 0001/01/01). You can enter the date as DATE ( 19990101 ) or use other date functions such as BUCKET_EDATE(). The second argument specifies the fiscal year variant.

FISCAL_PERIOD()

FISCAL_PERIOD(X) returns the number of the posting period specified by column X.

FISCAL_YEAR

FISCAL_YEAR (X) returns the fiscal year of the period specified by column X.

MONTH()

MONTH( X ) returns the month in a date that is expressed in whole numbers with reference to the date 01/01/0001. Example: MONTH( DATE( 19990220 )) = 2. The argument can either be a number you enter in an Operator/Function dialog box or one of the macro elements cell, row, or column from the planning table or auxiliary table.

MONTH_BDATE()

MONTH_BDATE( X ) returns the start date of the month given in the argument in integer format with reference to the date 0001/01/01.

MONTH_EDATE()

MONTH_EDATE( X ) returns the finish date of the month given in the argument in integer format with reference to the date 0001/01/01.

PRODUCT_PHIN_END or PRODUCT_PHIN_END()

PRODUCT_PHIN_END( <'GRID=2'> ;  <'product'> ) returns the end date of the specified product's launch phase as maintained for the phase-in profile in the product master record. The arguments for grid 2 and product are optional. If you do not specify a product, the system returns the end date of the phase-in time span of the currently planned product. However, for performance reasons, we recommend that you use the function ACT_PRODUCT to represent the current product.

PRODUCT_PHIN_START or PRODUCT_PHIN_START()

PRODUCT_PHIN_START( <'GRID=2'> ;  <'product'> ) returns the start date of the specified product's launch phase as maintained for the phase-in profile in the product master record. The arguments for grid 2 and product are optional. If you do not specify a product, the system returns the start date of the phase-in time span of the currently planned product. However, for performance reasons, we recommend that you use the function ACT_PRODUCT to represent the current product.

PRODUCT_PHOUT_END or PRODUCT_PHOUT_END()

PRODUCT_PHOUT_END( <'GRID=2'> ;  <'product'> ) returns the end date of the specified product's decline phase as maintained for the phase-out profile in the product master record. The arguments for grid 2 and product are optional. If you do not specify a product, the system returns the end date of the phase-out time span of the currently planned product. However, for performance reasons, we recommend that you use the function ACT_PRODUCT to represent the current product.

PRODUCT_PHOUT_START or PRODUCT_PHOUT_START()

PRODUCT_PHOUT_START( <'GRID=2'> ;  <'product'> ) returns the start date of the specified product's decline phase as maintained for the phase-out profile in the product master record. The arguments for grid 2 and product are optional. If you do not specify a product, the system returns the start date of the phase-out time span of the currently planned product. However, for performance reasons, we recommend that you use the function ACT_PRODUCT to represent the current product.

QUARTER()

Syntax

QUARTER ( Number of days )

Number of days: Number of days since 0001/01/01.

Description

QUARTER() returns the quarter (as a number 1 to 4) in which the date, expressed as the number of days since 0001/01/01, lies. You can convert a date in the normal format to the number of days format by using functions DATE or TODAY.

QUARTER_BDATE()

Syntax

QUARTER_BDATE ( Number of days )

Number of days: Number of days since 0001/01/01.

Description

QUARTER_BDATE() returns the first date of the quarter in which the date, expressed as the number of days since 0001/01/01, lies. You can convert a date in the normal format to the number of days format by using functions DATE or TODAY.

QUARTER_EDATE()

Syntax

QUARTER_EDATE ( Number of days )

Number of days: Number of days since 0001/01/01.

Description

QUARTER_EDATE() returns the last date of the quarter in which the date, expressed as the number of days since 0001/01/01, lies. You can convert a date in the normal format to the number of days format by using functions DATE or TODAY.

SEASON_BDATE

Syntax

SEASON_BDATE ( Column ) 

Column: Row, column, or cell element (data source = column attributes)

Description

The SEASON_BDATE function determines the start date of a season if all the characteristic values combinations selected for the planning object have the same start date.

SEASON_EDATE

Syntax

SEASON_EDATE ( Column ) 

Column: Row, column, or cell element (data source = column attributes) 

Description

The SEASON_EDATE function determines the end date of a season if all the characteristic values combinations selected for the planning object have the same end date.

TIMESHIFT_BACKWARDS()

Syntax

TIMESHIFT_BACKWARDS( <’E’;> Area 1 ; Area 2 )

'E': optional parameter for controlling the behavior at the end of the period

Area 1: Name of the area that contains the data to be moved

Area 2:Name of the area that contains the offsets

The two areas should have the same length and consist of only one line.

Description

TIMESHIFT_BACKWARDS() moves the values of the time series in area 1 back by the number of periods specified in area 2. If you set the optional parameter 'E', values that are moved back beyond the first period in area 1, are either lost or are added to the first period.

For example:

the time series look like this:

Area 1           10         20       30       40       50

Area 2            1          2         1         3         1.

The result looks like this if parameter E was set:

Results         40         30       0         50       0

If E is not set, the result is as follows:

Result           70         30       0         50       0

TIMESHIFT_FORWARDS()

Syntax

TIMESHIFT_ FORWARDS ( <’E’;> Area 1 ; Area 2 )

'E': optional parameter for controlling the behavior at the end of the period

Area 1: Name of the area that contains the data to be moved

Area 2:Name of the area that contains the offsets

The two areas should have the same length and consist of only one line.

Description

TIMESHIFT_FORWARDS() moves the values of the time series in area 1 forward by the number of periods specified in area 2. If you set the optional parameter 'E', values that are moved forward beyond the last period in area 1, are either lost or are added to the last period.

TODAY

TODAY returns today's date in integer format with reference to the date 0001/01/01. For example, you can use this function as the argument of another function:

DAY ( TODAY )

WEEK ( TODAY )

MONTH ( TODAY )

PRODUCT_LIFE ( TODAY )

WEEKDAY ( TODAY )

WEEK_BDATE( TODAY )

WEEK_EDATE( TODAY )

YEAR ( TODAY )

YEAR_BDATE( TODAY )

YEAR_EDATE( TODAY )

BUCKET_DATE_IN ( TODAY ; ... )

WEEK()

WEEK( X ) returns the week in a date X that is expressed in whole numbers with reference to the date 0001/01/01. Example: WEEK( DATE( 20001220)) = 51. The argument can either be a number you enter in an Operator/Function dialog box or one of the macro elements cell, row, or column from the planning table or auxiliary table.

WEEK_BDATE()

WEEK_BDATE( X ) returns the start date of the week in which the specified day X falls. For example, if today's date is Wednesday, December 20th in the year 2000, WEEK_BDATE( TODAY ) returns 20001218.

WEEK_EDATE()

WEEK_EDATE( X ) returns the end date of the week in which the specified day X falls. For example, if today's date is Wednesday, December 20th in the year 2000, WEEK_EDATE( TODAY ) returns 20001224.

YEAR_BDATE()

YEAR_BDATE( X ) returns the start date of the year in which the specified day X falls. For example, if today's date is Wednesday, December 20th in the year 2000, YEAR_BDATE( TODAY ) returns 20000101.

YEAR_EDATE()

YEAR_EDATE( X ) returns the end date of the year in which the specified day X falls. For example, if today's date is Wednesday, December 20th in the year 2000, YEAR_EDATE( TODAY ) returns 20001231.

WEEKDAY()

WEEKDAY( X ) returns as a number between 1 and 7 the weekday of a date that is expressed in integer format with reference to the date 0001/01/01, where 1 = Monday and 7 = Sunday. For example, for January 20th 1999 WEEKDAY( DATE( 19990120 ) ) returns 3. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

YEAR()

YEAR( X ) returns the year of a date that is in whole numbers with reference to the date 0001/01/01. Example: For January 20th 1999 YEAR( DATE( 19990120 ) ) returns 1999. The argument can be either a number that you enter in an Operator/function dialog box, or one of the macro elements cell, row or column from the planning table or the auxiliary table.

 

 

Leaving content frame