SAP MY_AVERAGE_CONSUMPTION_GET Function Module for
MY_AVERAGE_CONSUMPTION_GET is a standard my average consumption get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 my average consumption get FM, simply by entering the name MY_AVERAGE_CONSUMPTION_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: NIW1
Program Name: SAPLNIW1
Main Program: SAPLNIW1
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MY_AVERAGE_CONSUMPTION_GET 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 'MY_AVERAGE_CONSUMPTION_GET'".
EXPORTING
I_MATNR = "
* I_BWKEY = "
* I_BWTAR = "
I_SNIWE = "
* I_SNIWE1 = "
* I_EXPTL = "
CHANGING
* CT_EXPTOOL = "
* CT_CRELN = "
* CT_CWDTH = "
TABLES
TRA_WERKS = "
T_BEW = "
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_SAPLNIW1_001
EXIT_SAPLNIW1_002
IMPORTING Parameters details for MY_AVERAGE_CONSUMPTION_GET
I_MATNR -
Data type: MARA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
I_BWKEY -
Data type: MBEW-BWKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BWTAR -
Data type: MBEW-BWTAROptional: Yes
Call by Reference: No ( called with pass by value option)
I_SNIWE -
Data type: SNIWEOptional: No
Call by Reference: No ( called with pass by value option)
I_SNIWE1 -
Data type: SNIWE1Optional: Yes
Call by Reference: No ( called with pass by value option)
I_EXPTL -
Data type: EXPTOOLOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for MY_AVERAGE_CONSUMPTION_GET
CT_EXPTOOL -
Data type: MRY_EXPTOOL_TBLOptional: Yes
Call by Reference: Yes
CT_CRELN -
Data type: MRY_CRELN_TBLOptional: Yes
Call by Reference: Yes
CT_CWDTH -
Data type: MRY_CWDTH_TBLOptional: Yes
Call by Reference: Yes
TABLES Parameters details for MY_AVERAGE_CONSUMPTION_GET
TRA_WERKS -
Data type: RANGE_C4Optional: No
Call by Reference: Yes
T_BEW -
Data type: SNIWEBEWOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MY_AVERAGE_CONSUMPTION_GET 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_matnr | TYPE MARA-MATNR, " | |||
| lt_tra_werks | TYPE STANDARD TABLE OF RANGE_C4, " | |||
| lv_ct_exptool | TYPE MRY_EXPTOOL_TBL, " | |||
| lt_t_bew | TYPE STANDARD TABLE OF SNIWEBEW, " | |||
| lv_i_bwkey | TYPE MBEW-BWKEY, " | |||
| lv_ct_creln | TYPE MRY_CRELN_TBL, " | |||
| lv_i_bwtar | TYPE MBEW-BWTAR, " | |||
| lv_ct_cwdth | TYPE MRY_CWDTH_TBL, " | |||
| lv_i_sniwe | TYPE SNIWE, " | |||
| lv_i_sniwe1 | TYPE SNIWE1, " | |||
| lv_i_exptl | TYPE EXPTOOL. " |
|   CALL FUNCTION 'MY_AVERAGE_CONSUMPTION_GET' " |
| EXPORTING | ||
| I_MATNR | = lv_i_matnr | |
| I_BWKEY | = lv_i_bwkey | |
| I_BWTAR | = lv_i_bwtar | |
| I_SNIWE | = lv_i_sniwe | |
| I_SNIWE1 | = lv_i_sniwe1 | |
| I_EXPTL | = lv_i_exptl | |
| CHANGING | ||
| CT_EXPTOOL | = lv_ct_exptool | |
| CT_CRELN | = lv_ct_creln | |
| CT_CWDTH | = lv_ct_cwdth | |
| TABLES | ||
| TRA_WERKS | = lt_tra_werks | |
| T_BEW | = lt_t_bew | |
| . " MY_AVERAGE_CONSUMPTION_GET | ||
ABAP code using 7.40 inline data declarations to call FM MY_AVERAGE_CONSUMPTION_GET
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 MATNR FROM MARA INTO @DATA(ld_i_matnr). | ||||
| "SELECT single BWKEY FROM MBEW INTO @DATA(ld_i_bwkey). | ||||
| "SELECT single BWTAR FROM MBEW INTO @DATA(ld_i_bwtar). | ||||
Search for further information about these or an SAP related objects