SAP APO_BAPI_PERIOD_GET_DATES Function Module for Determine Start and End Date of Period
APO_BAPI_PERIOD_GET_DATES is a standard apo bapi period get dates SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine Start and End Date of Period 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 apo bapi period get dates FM, simply by entering the name APO_BAPI_PERIOD_GET_DATES into the relevant SAP transaction such as SE37 or SE38.
Function Group: APO_BAPI_GEN
Program Name: SAPLAPO_BAPI_GEN
Main Program: SAPLAPO_BAPI_GEN
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function APO_BAPI_PERIOD_GET_DATES 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 'APO_BAPI_PERIOD_GET_DATES'"Determine Start and End Date of Period.
EXPORTING
IV_PERIOD_TYPE = "Eingabeart Auswertungszeitraum
IV_PERIOD_TYPE_FROM = "Eingabeart Auswertungszeitraum
IV_PERIOD_TYPE_TO = "Eingabeart Auswertungszeitraum
IV_FROM = "Characterfeld der Länge 10
IV_TO = "Characterfeld der Länge 10
IMPORTING
EV_FROM = "Characterfeld der Länge 10
EV_TO = "Characterfeld der Länge 10
EV_START_DATE = "Feld vom Typ DATS
EV_END_DATE = "Feld vom Typ DATS
EV_START_DATE_C = "Characterfeld der Länge 10
EV_END_DATE_C = "Characterfeld der Länge 10
EXCEPTIONS
INVALID_PARAMETERS = 1
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_SAPLAPO_BAPI_GEN_001 User Exit for Method 'ReceivePlanningResults' of Object IF10506
IMPORTING Parameters details for APO_BAPI_PERIOD_GET_DATES
IV_PERIOD_TYPE - Eingabeart Auswertungszeitraum
Data type: /SAPAPO/CDPS_EVAL_TYPEOptional: No
Call by Reference: Yes
IV_PERIOD_TYPE_FROM - Eingabeart Auswertungszeitraum
Data type: /SAPAPO/CDPS_EVAL_TYPEOptional: No
Call by Reference: Yes
IV_PERIOD_TYPE_TO - Eingabeart Auswertungszeitraum
Data type: /SAPAPO/CDPS_EVAL_TYPEOptional: No
Call by Reference: Yes
IV_FROM - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
IV_TO - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
EXPORTING Parameters details for APO_BAPI_PERIOD_GET_DATES
EV_FROM - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
EV_TO - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
EV_START_DATE - Feld vom Typ DATS
Data type: DATSOptional: No
Call by Reference: Yes
EV_END_DATE - Feld vom Typ DATS
Data type: DATSOptional: No
Call by Reference: Yes
EV_START_DATE_C - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
EV_END_DATE_C - Characterfeld der Länge 10
Data type: CHAR10Optional: No
Call by Reference: Yes
EXCEPTIONS details
INVALID_PARAMETERS - Übergabeparameter sind fehlerhaft
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for APO_BAPI_PERIOD_GET_DATES 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_ev_from | TYPE CHAR10, " | |||
| lv_iv_period_type | TYPE /SAPAPO/CDPS_EVAL_TYPE, " | |||
| lv_invalid_parameters | TYPE /SAPAPO/CDPS_EVAL_TYPE, " | |||
| lv_ev_to | TYPE CHAR10, " | |||
| lv_iv_period_type_from | TYPE /SAPAPO/CDPS_EVAL_TYPE, " | |||
| lv_ev_start_date | TYPE DATS, " | |||
| lv_iv_period_type_to | TYPE /SAPAPO/CDPS_EVAL_TYPE, " | |||
| lv_iv_from | TYPE CHAR10, " | |||
| lv_ev_end_date | TYPE DATS, " | |||
| lv_iv_to | TYPE CHAR10, " | |||
| lv_ev_start_date_c | TYPE CHAR10, " | |||
| lv_ev_end_date_c | TYPE CHAR10. " |
|   CALL FUNCTION 'APO_BAPI_PERIOD_GET_DATES' "Determine Start and End Date of Period |
| EXPORTING | ||
| IV_PERIOD_TYPE | = lv_iv_period_type | |
| IV_PERIOD_TYPE_FROM | = lv_iv_period_type_from | |
| IV_PERIOD_TYPE_TO | = lv_iv_period_type_to | |
| IV_FROM | = lv_iv_from | |
| IV_TO | = lv_iv_to | |
| IMPORTING | ||
| EV_FROM | = lv_ev_from | |
| EV_TO | = lv_ev_to | |
| EV_START_DATE | = lv_ev_start_date | |
| EV_END_DATE | = lv_ev_end_date | |
| EV_START_DATE_C | = lv_ev_start_date_c | |
| EV_END_DATE_C | = lv_ev_end_date_c | |
| EXCEPTIONS | ||
| INVALID_PARAMETERS = 1 | ||
| . " APO_BAPI_PERIOD_GET_DATES | ||
ABAP code using 7.40 inline data declarations to call FM APO_BAPI_PERIOD_GET_DATES
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.Search for further information about these or an SAP related objects