SAP FRE_READ_CONSUMPTION Function Module for Consumption data read for F&R
FRE_READ_CONSUMPTION is a standard fre read consumption SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Consumption data read for F&R 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 fre read consumption FM, simply by entering the name FRE_READ_CONSUMPTION into the relevant SAP transaction such as SE37 or SE38.
Function Group: FRE_TS_DB
Program Name: SAPLFRE_TS_DB
Main Program: SAPLFRE_TS_DB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FRE_READ_CONSUMPTION 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 'FRE_READ_CONSUMPTION'"Consumption data read for F&R.
EXPORTING
I_MATNR = "Material number
* I_INITLOAD = "'X' when Initload
I_WERKS = "Plant
I_TZONE = "Timezone for site
I_LOCTYPE = "Location type
I_MEINS = "Base unit of measure
I_ISOCD = "ISO code for unit of measurement
I_SENDER = "Logical system
I_REFID = "Identifier
I_PERIODS = "Number of Periods for Consumption initial load
TABLES
T_CDATA = "Structure for selection of Time Series data
EXCEPTIONS
NO_MARC = 1 ERROR_ON_PROVB = 2 NO_ENTRY_FOUND = 3 BADI_IMPL_MISSING = 4
IMPORTING Parameters details for FRE_READ_CONSUMPTION
I_MATNR - Material number
Data type: MARA-MATNROptional: No
Call by Reference: Yes
I_INITLOAD - 'X' when Initload
Data type: XFLAGOptional: Yes
Call by Reference: Yes
I_WERKS - Plant
Data type: MARC-WERKSOptional: No
Call by Reference: Yes
I_TZONE - Timezone for site
Data type: FRE_DB_SITE-TZONEOptional: No
Call by Reference: Yes
I_LOCTYPE - Location type
Data type: FRE_LOCTYPEOptional: No
Call by Reference: Yes
I_MEINS - Base unit of measure
Data type: MARA-MEINSOptional: No
Call by Reference: Yes
I_ISOCD - ISO code for unit of measurement
Data type: T006-ISOCODEOptional: No
Call by Reference: Yes
I_SENDER - Logical system
Data type: LOGSYSTEMOptional: No
Call by Reference: Yes
I_REFID - Identifier
Data type: FRE_BIF_IDOptional: No
Call by Reference: Yes
I_PERIODS - Number of Periods for Consumption initial load
Data type: FRE_SEND_OPTION-TS_PER_INITOptional: No
Call by Reference: Yes
TABLES Parameters details for FRE_READ_CONSUMPTION
T_CDATA - Structure for selection of Time Series data
Data type: FRE_BIF_TSD_EXPOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_MARC - No entry found in MARC
Data type:Optional: No
Call by Reference: Yes
ERROR_ON_PROVB - No value found for field PROVB in table T438A
Data type:Optional: No
Call by Reference: Yes
NO_ENTRY_FOUND - No entry found in MVER
Data type:Optional: No
Call by Reference: Yes
BADI_IMPL_MISSING - Corresponding BADI Implementation is missing
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FRE_READ_CONSUMPTION 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, " | |||
| lv_no_marc | TYPE MARA, " | |||
| lt_t_cdata | TYPE STANDARD TABLE OF FRE_BIF_TSD_EXP, " | |||
| lv_i_initload | TYPE XFLAG, " | |||
| lv_i_werks | TYPE MARC-WERKS, " | |||
| lv_error_on_provb | TYPE MARC, " | |||
| lv_i_tzone | TYPE FRE_DB_SITE-TZONE, " | |||
| lv_no_entry_found | TYPE FRE_DB_SITE, " | |||
| lv_i_loctype | TYPE FRE_LOCTYPE, " | |||
| lv_badi_impl_missing | TYPE FRE_LOCTYPE, " | |||
| lv_i_meins | TYPE MARA-MEINS, " | |||
| lv_i_isocd | TYPE T006-ISOCODE, " | |||
| lv_i_sender | TYPE LOGSYSTEM, " | |||
| lv_i_refid | TYPE FRE_BIF_ID, " | |||
| lv_i_periods | TYPE FRE_SEND_OPTION-TS_PER_INIT. " |
|   CALL FUNCTION 'FRE_READ_CONSUMPTION' "Consumption data read for F&R |
| EXPORTING | ||
| I_MATNR | = lv_i_matnr | |
| I_INITLOAD | = lv_i_initload | |
| I_WERKS | = lv_i_werks | |
| I_TZONE | = lv_i_tzone | |
| I_LOCTYPE | = lv_i_loctype | |
| I_MEINS | = lv_i_meins | |
| I_ISOCD | = lv_i_isocd | |
| I_SENDER | = lv_i_sender | |
| I_REFID | = lv_i_refid | |
| I_PERIODS | = lv_i_periods | |
| TABLES | ||
| T_CDATA | = lt_t_cdata | |
| EXCEPTIONS | ||
| NO_MARC = 1 | ||
| ERROR_ON_PROVB = 2 | ||
| NO_ENTRY_FOUND = 3 | ||
| BADI_IMPL_MISSING = 4 | ||
| . " FRE_READ_CONSUMPTION | ||
ABAP code using 7.40 inline data declarations to call FM FRE_READ_CONSUMPTION
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 WERKS FROM MARC INTO @DATA(ld_i_werks). | ||||
| "SELECT single TZONE FROM FRE_DB_SITE INTO @DATA(ld_i_tzone). | ||||
| "SELECT single MEINS FROM MARA INTO @DATA(ld_i_meins). | ||||
| "SELECT single ISOCODE FROM T006 INTO @DATA(ld_i_isocd). | ||||
| "SELECT single TS_PER_INIT FROM FRE_SEND_OPTION INTO @DATA(ld_i_periods). | ||||
Search for further information about these or an SAP related objects