SAP ME_READ_HEADER_INVOICE_FIR Function Module for Document Header
ME_READ_HEADER_INVOICE_FIR is a standard me read header invoice fir SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Document Header 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 read header invoice fir FM, simply by entering the name ME_READ_HEADER_INVOICE_FIR into the relevant SAP transaction such as SE37 or SE38.
Function Group: EINR
Program Name: SAPLEINR
Main Program: SAPLEINR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ME_READ_HEADER_INVOICE_FIR 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_READ_HEADER_INVOICE_FIR'"Document Header.
EXPORTING
* IDISPLAY = ' ' "
IEBELN = "Purchasing Document Number
* IKURS_ABW = 0 "Maximum exchange rate deviation in percent
IRE_KURSF = "Exchange Rate
IRE_WAERS = "Currency Key
* IHS_WAERS = "Currency Key
* IFLEXIBLE_INVOICING = ' ' "Single-Character Indicator
* IDATE = SY-DATUM "Current Date of Application Server
* IIVREL = ' ' "General Indicator
IMPORTING
E_ADDRESS = "Address Return Structure
VBUND = "Partner Company ID
ET_MESSAGE_LOG = "Message Interface
EV_SRM_CONTRACT = "General Indicator
TABLES
ET_EKKO = "Purchasing Document Header
EXCEPTIONS
NOT_ACTIV = 1 NOT_FOUND = 2 WRONG_TYPE = 3 NOT_RELEASED = 4 VALIDATION_ERROR = 5 PARKED_DOCUMENT = 6
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_SAPLEINR_001 Calculation of Default GR Quantity and Over-/Underdelivery Tolerance
EXIT_SAPLEINR_002 Adopt Batch Numbers from Shipping Notification When Posting Goods Receipt
EXIT_SAPLEINR_003 Adjustm. of Qty. and Date for Price Determination, GR Against Sched. Agmt.
EXIT_SAPLEINR_004 Determine Earliest Delivery Date, GR Check (PO Only)
EXIT_SAPLEINR_400 Exit for IS-Oil re-pricing at MM Invoice Verification
IMPORTING Parameters details for ME_READ_HEADER_INVOICE_FIR
IDISPLAY -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: Yes
IEBELN - Purchasing Document Number
Data type: EKKO-EBELNOptional: No
Call by Reference: Yes
IKURS_ABW - Maximum exchange rate deviation in percent
Data type: T001-WAABWOptional: Yes
Call by Reference: Yes
IRE_KURSF - Exchange Rate
Data type: BKPF-KURSFOptional: No
Call by Reference: Yes
IRE_WAERS - Currency Key
Data type: BKPF-WAERSOptional: No
Call by Reference: Yes
IHS_WAERS - Currency Key
Data type: T001-WAERSOptional: Yes
Call by Reference: Yes
IFLEXIBLE_INVOICING - Single-Character Indicator
Data type: CHAR1Default: SPACE
Optional: Yes
Call by Reference: Yes
IDATE - Current Date of Application Server
Data type: SY-DATUMDefault: SY-DATUM
Optional: Yes
Call by Reference: Yes
IIVREL - General Indicator
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for ME_READ_HEADER_INVOICE_FIR
E_ADDRESS - Address Return Structure
Data type: ADDR1_VALOptional: No
Call by Reference: Yes
VBUND - Partner Company ID
Data type: LFA1-VBUNDOptional: No
Call by Reference: Yes
ET_MESSAGE_LOG - Message Interface
Data type: SERVICE_ERRORSOptional: No
Call by Reference: Yes
EV_SRM_CONTRACT - General Indicator
Data type: FLAGOptional: No
Call by Reference: Yes
TABLES Parameters details for ME_READ_HEADER_INVOICE_FIR
ET_EKKO - Purchasing Document Header
Data type: EKKOOptional: No
Call by Reference: Yes
EXCEPTIONS details
NOT_ACTIV - Inactive
Data type:Optional: No
Call by Reference: Yes
NOT_FOUND - Not available
Data type:Optional: No
Call by Reference: Yes
WRONG_TYPE -
Data type:Optional: No
Call by Reference: Yes
NOT_RELEASED -
Data type:Optional: No
Call by Reference: Yes
VALIDATION_ERROR -
Data type:Optional: No
Call by Reference: Yes
PARKED_DOCUMENT -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for ME_READ_HEADER_INVOICE_FIR 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: | ||||
| lt_et_ekko | TYPE STANDARD TABLE OF EKKO, " | |||
| lv_idisplay | TYPE C, " SPACE | |||
| lv_e_address | TYPE ADDR1_VAL, " | |||
| lv_not_activ | TYPE ADDR1_VAL, " | |||
| lv_vbund | TYPE LFA1-VBUND, " | |||
| lv_iebeln | TYPE EKKO-EBELN, " | |||
| lv_not_found | TYPE EKKO, " | |||
| lv_ikurs_abw | TYPE T001-WAABW, " 0 | |||
| lv_wrong_type | TYPE T001, " | |||
| lv_et_message_log | TYPE SERVICE_ERRORS, " | |||
| lv_ire_kursf | TYPE BKPF-KURSF, " | |||
| lv_not_released | TYPE BKPF, " | |||
| lv_ev_srm_contract | TYPE FLAG, " | |||
| lv_ire_waers | TYPE BKPF-WAERS, " | |||
| lv_validation_error | TYPE BKPF, " | |||
| lv_ihs_waers | TYPE T001-WAERS, " | |||
| lv_parked_document | TYPE T001, " | |||
| lv_iflexible_invoicing | TYPE CHAR1, " SPACE | |||
| lv_idate | TYPE SY-DATUM, " SY-DATUM | |||
| lv_iivrel | TYPE FLAG. " SPACE |
|   CALL FUNCTION 'ME_READ_HEADER_INVOICE_FIR' "Document Header |
| EXPORTING | ||
| IDISPLAY | = lv_idisplay | |
| IEBELN | = lv_iebeln | |
| IKURS_ABW | = lv_ikurs_abw | |
| IRE_KURSF | = lv_ire_kursf | |
| IRE_WAERS | = lv_ire_waers | |
| IHS_WAERS | = lv_ihs_waers | |
| IFLEXIBLE_INVOICING | = lv_iflexible_invoicing | |
| IDATE | = lv_idate | |
| IIVREL | = lv_iivrel | |
| IMPORTING | ||
| E_ADDRESS | = lv_e_address | |
| VBUND | = lv_vbund | |
| ET_MESSAGE_LOG | = lv_et_message_log | |
| EV_SRM_CONTRACT | = lv_ev_srm_contract | |
| TABLES | ||
| ET_EKKO | = lt_et_ekko | |
| EXCEPTIONS | ||
| NOT_ACTIV = 1 | ||
| NOT_FOUND = 2 | ||
| WRONG_TYPE = 3 | ||
| NOT_RELEASED = 4 | ||
| VALIDATION_ERROR = 5 | ||
| PARKED_DOCUMENT = 6 | ||
| . " ME_READ_HEADER_INVOICE_FIR | ||
ABAP code using 7.40 inline data declarations to call FM ME_READ_HEADER_INVOICE_FIR
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_idisplay) | = ' '. | |||
| "SELECT single VBUND FROM LFA1 INTO @DATA(ld_vbund). | ||||
| "SELECT single EBELN FROM EKKO INTO @DATA(ld_iebeln). | ||||
| "SELECT single WAABW FROM T001 INTO @DATA(ld_ikurs_abw). | ||||
| "SELECT single KURSF FROM BKPF INTO @DATA(ld_ire_kursf). | ||||
| "SELECT single WAERS FROM BKPF INTO @DATA(ld_ire_waers). | ||||
| "SELECT single WAERS FROM T001 INTO @DATA(ld_ihs_waers). | ||||
| DATA(ld_iflexible_invoicing) | = ' '. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_idate). | ||||
| DATA(ld_idate) | = SY-DATUM. | |||
| DATA(ld_iivrel) | = ' '. | |||
Search for further information about these or an SAP related objects