SAP ME_PREPARE_STATISTICS Function Module for NOTRANSL: Vorbereiten Statistikfortschreibung aus Einkauf
ME_PREPARE_STATISTICS is a standard me prepare statistics 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: Vorbereiten Statistikfortschreibung aus Einkauf 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 me prepare statistics FM, simply by entering the name ME_PREPARE_STATISTICS into the relevant SAP transaction such as SE37 or SE38.
Function Group: EINS
Program Name: SAPLEINS
Main Program: SAPLEINS
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ME_PREPARE_STATISTICS 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 'ME_PREPARE_STATISTICS'"NOTRANSL: Vorbereiten Statistikfortschreibung aus Einkauf.
EXPORTING
I_EKKO = "Purchasing document header
I_LFA1 = "Vendor master
* I_NO_NAVNW = ' ' "
TABLES
T_EKET = "Schedule lines
T_EKKN = "Account assignments
T_EKPO = "Items
T_KOMV = "Conditions
* T_EKPV = "
* T_EKBES = "Purchase order history totals
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_SAPLEINS_001 User Exit to Populate Communication Structure, Purchasing Info. System
IMPORTING Parameters details for ME_PREPARE_STATISTICS
I_EKKO - Purchasing document header
Data type: EKKOOptional: No
Call by Reference: No ( called with pass by value option)
I_LFA1 - Vendor master
Data type: LFA1Optional: No
Call by Reference: No ( called with pass by value option)
I_NO_NAVNW -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
TABLES Parameters details for ME_PREPARE_STATISTICS
T_EKET - Schedule lines
Data type: EKETOptional: No
Call by Reference: No ( called with pass by value option)
T_EKKN - Account assignments
Data type: EKKNOptional: No
Call by Reference: No ( called with pass by value option)
T_EKPO - Items
Data type: BEKPOOptional: No
Call by Reference: No ( called with pass by value option)
T_KOMV - Conditions
Data type: KOMVOptional: No
Call by Reference: No ( called with pass by value option)
T_EKPV -
Data type: CEKPVOptional: Yes
Call by Reference: No ( called with pass by value option)
T_EKBES - Purchase order history totals
Data type: EKBESOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for ME_PREPARE_STATISTICS 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_i_ekko | TYPE EKKO, " | |||
| lt_t_eket | TYPE STANDARD TABLE OF EKET, " | |||
| lv_i_lfa1 | TYPE LFA1, " | |||
| lt_t_ekkn | TYPE STANDARD TABLE OF EKKN, " | |||
| lt_t_ekpo | TYPE STANDARD TABLE OF BEKPO, " | |||
| lv_i_no_navnw | TYPE C, " SPACE | |||
| lt_t_komv | TYPE STANDARD TABLE OF KOMV, " | |||
| lt_t_ekpv | TYPE STANDARD TABLE OF CEKPV, " | |||
| lt_t_ekbes | TYPE STANDARD TABLE OF EKBES. " |
|   CALL FUNCTION 'ME_PREPARE_STATISTICS' "NOTRANSL: Vorbereiten Statistikfortschreibung aus Einkauf |
| EXPORTING | ||
| I_EKKO | = lv_i_ekko | |
| I_LFA1 | = lv_i_lfa1 | |
| I_NO_NAVNW | = lv_i_no_navnw | |
| TABLES | ||
| T_EKET | = lt_t_eket | |
| T_EKKN | = lt_t_ekkn | |
| T_EKPO | = lt_t_ekpo | |
| T_KOMV | = lt_t_komv | |
| T_EKPV | = lt_t_ekpv | |
| T_EKBES | = lt_t_ekbes | |
| . " ME_PREPARE_STATISTICS | ||
ABAP code using 7.40 inline data declarations to call FM ME_PREPARE_STATISTICS
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.| DATA(ld_i_no_navnw) | = ' '. | |||
Search for further information about these or an SAP related objects