SAP PERIODE_ZUM_DATUM Function Module for NOTRANSL: Ermittelt zu einem Datum und Offset die Periode









PERIODE_ZUM_DATUM is a standard periode zum datum SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Ermittelt zu einem Datum und Offset die Periode processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for periode zum datum FM, simply by entering the name PERIODE_ZUM_DATUM into the relevant SAP transaction such as SE37 or SE38.

Function Group: PROM
Program Name: SAPLPROM
Main Program: SAPLPROM
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function PERIODE_ZUM_DATUM pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'PERIODE_ZUM_DATUM'"NOTRANSL: Ermittelt zu einem Datum und Offset die Periode
EXPORTING
IDATE = "Date for public holiday and factory calendars
IPERKZ = "Period Indicator
* IPERIV = "Fiscal Year Variant
* IFABKL = "Factory calendar key
* IOFFSET = 0 "Number of forecast periods
* INEGOFF = "Indicator: forecast is possible

IMPORTING
EPERIOD = "'From' period specification
EPERIOP = "'From' period specification
EFIRSTDAY = "'From' period specification
ELASTDAY = "'From' period specification
EPERNR = "Number of forecast periods

EXCEPTIONS
PERIV_REQUIRED = 1 PERIV_NOT_FOUND = 2 PERKZ_INVALID = 3 DATE_INVALID = 4 FACTORY_CALENDAR_NOT_FOUND = 5
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLPROM_022 User Exit for Displaying Forecast Results

IMPORTING Parameters details for PERIODE_ZUM_DATUM

IDATE - Date for public holiday and factory calendars

Data type: SCAL-DATE
Optional: No
Call by Reference: No ( called with pass by value option)

IPERKZ - Period Indicator

Data type: IPRWA-PERKZ
Optional: No
Call by Reference: No ( called with pass by value option)

IPERIV - Fiscal Year Variant

Data type: IPRWA-PERIV
Optional: Yes
Call by Reference: No ( called with pass by value option)

IFABKL - Factory calendar key

Data type: IPRWA-FABKL
Optional: Yes
Call by Reference: No ( called with pass by value option)

IOFFSET - Number of forecast periods

Data type: RMCP2-ANZPR
Optional: Yes
Call by Reference: No ( called with pass by value option)

INEGOFF - Indicator: forecast is possible

Data type: RMCP6-FLGFC
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for PERIODE_ZUM_DATUM

EPERIOD - 'From' period specification

Data type: RMCP2-PEDVU
Optional: No
Call by Reference: No ( called with pass by value option)

EPERIOP - 'From' period specification

Data type: RMCP2-PERVU
Optional: No
Call by Reference: No ( called with pass by value option)

EFIRSTDAY - 'From' period specification

Data type: RMCP2-PEDVU
Optional: No
Call by Reference: No ( called with pass by value option)

ELASTDAY - 'From' period specification

Data type: RMCP2-PEDVU
Optional: No
Call by Reference: No ( called with pass by value option)

EPERNR - Number of forecast periods

Data type: RMCP2-ANZPR
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

PERIV_REQUIRED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PERIV_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PERKZ_INVALID -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DATE_INVALID -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FACTORY_CALENDAR_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for PERIODE_ZUM_DATUM Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_idate  TYPE SCAL-DATE, "   
lv_eperiod  TYPE RMCP2-PEDVU, "   
lv_periv_required  TYPE RMCP2, "   
lv_iperkz  TYPE IPRWA-PERKZ, "   
lv_eperiop  TYPE RMCP2-PERVU, "   
lv_periv_not_found  TYPE RMCP2, "   
lv_iperiv  TYPE IPRWA-PERIV, "   
lv_efirstday  TYPE RMCP2-PEDVU, "   
lv_perkz_invalid  TYPE RMCP2, "   
lv_ifabkl  TYPE IPRWA-FABKL, "   
lv_elastday  TYPE RMCP2-PEDVU, "   
lv_date_invalid  TYPE RMCP2, "   
lv_epernr  TYPE RMCP2-ANZPR, "   
lv_ioffset  TYPE RMCP2-ANZPR, "   0
lv_factory_calendar_not_found  TYPE RMCP2, "   
lv_inegoff  TYPE RMCP6-FLGFC. "   

  CALL FUNCTION 'PERIODE_ZUM_DATUM'  "NOTRANSL: Ermittelt zu einem Datum und Offset die Periode
    EXPORTING
         IDATE = lv_idate
         IPERKZ = lv_iperkz
         IPERIV = lv_iperiv
         IFABKL = lv_ifabkl
         IOFFSET = lv_ioffset
         INEGOFF = lv_inegoff
    IMPORTING
         EPERIOD = lv_eperiod
         EPERIOP = lv_eperiop
         EFIRSTDAY = lv_efirstday
         ELASTDAY = lv_elastday
         EPERNR = lv_epernr
    EXCEPTIONS
        PERIV_REQUIRED = 1
        PERIV_NOT_FOUND = 2
        PERKZ_INVALID = 3
        DATE_INVALID = 4
        FACTORY_CALENDAR_NOT_FOUND = 5
. " PERIODE_ZUM_DATUM




ABAP code using 7.40 inline data declarations to call FM PERIODE_ZUM_DATUM

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single DATE FROM SCAL INTO @DATA(ld_idate).
 
"SELECT single PEDVU FROM RMCP2 INTO @DATA(ld_eperiod).
 
 
"SELECT single PERKZ FROM IPRWA INTO @DATA(ld_iperkz).
 
"SELECT single PERVU FROM RMCP2 INTO @DATA(ld_eperiop).
 
 
"SELECT single PERIV FROM IPRWA INTO @DATA(ld_iperiv).
 
"SELECT single PEDVU FROM RMCP2 INTO @DATA(ld_efirstday).
 
 
"SELECT single FABKL FROM IPRWA INTO @DATA(ld_ifabkl).
 
"SELECT single PEDVU FROM RMCP2 INTO @DATA(ld_elastday).
 
 
"SELECT single ANZPR FROM RMCP2 INTO @DATA(ld_epernr).
 
"SELECT single ANZPR FROM RMCP2 INTO @DATA(ld_ioffset).
 
 
"SELECT single FLGFC FROM RMCP6 INTO @DATA(ld_inegoff).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!