SAP ME_CHECK_DOCUMENT_FOR_MATERIAL Function Module for NOTRANSL: Existenzprüfung auf Einkaufsbelege zum Material









ME_CHECK_DOCUMENT_FOR_MATERIAL is a standard me check document for material 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: Existenzprüfung auf Einkaufsbelege zum Material 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 check document for material FM, simply by entering the name ME_CHECK_DOCUMENT_FOR_MATERIAL 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_CHECK_DOCUMENT_FOR_MATERIAL 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_CHECK_DOCUMENT_FOR_MATERIAL'"NOTRANSL: Existenzprüfung auf Einkaufsbelege zum Material
EXPORTING
* EXISTENCE_CHECK = ' ' "Indicator: check re existence only (for reorganization)
* MPROF = "
* IF_SOBKZ = "Special Stock Indicator
* IF_VBELN = "Sales and Distribution Document Number
* IF_VBELP = "Sales document item
* IF_PSPNR = "Work Breakdown Structure Element (WBS Element)
MATNR = "Material number
* PLANT_INITIAL = ' ' "Indicator: search explicitly without plant
WERKS = "Plant
* PLANT_INFO = ' ' "
* BWART = "Valuation Type
* BWKEY = "Valuation Area
* NO_ACCOUNT_ASSIGNED = ' ' "
* BMATN = "

IMPORTING
CONTRACT_FLAG = "Indicator: contracts exist
DELPLAN_FLAG = "Indicator: scheduling agreements exist
INFO_FLAG = "Indicator: info records exist
PO_FLAG = "Indicator: purchase orders exist
REQ_FLAG = "Indicator: purchase requisitions exist
RFQ_FLAG = "Indicator: requests for quotation exist

TABLES
XEKDOC = "
.




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_CHECK_DOCUMENT_FOR_MATERIAL

EXISTENCE_CHECK - Indicator: check re existence only (for reorganization)

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

MPROF -

Data type: EKPO-MPROF
Optional: Yes
Call by Reference: No ( called with pass by value option)

IF_SOBKZ - Special Stock Indicator

Data type: EKPO-SOBKZ
Optional: Yes
Call by Reference: No ( called with pass by value option)

IF_VBELN - Sales and Distribution Document Number

Data type: EBKN-VBELN
Optional: Yes
Call by Reference: No ( called with pass by value option)

IF_VBELP - Sales document item

Data type: EBKN-VBELP
Optional: Yes
Call by Reference: No ( called with pass by value option)

IF_PSPNR - Work Breakdown Structure Element (WBS Element)

Data type: EBKN-PS_PSP_PNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

MATNR - Material number

Data type: EKPO-MATNR
Optional: No
Call by Reference: No ( called with pass by value option)

PLANT_INITIAL - Indicator: search explicitly without plant

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

WERKS - Plant

Data type: EKPO-WERKS
Optional: No
Call by Reference: No ( called with pass by value option)

PLANT_INFO -

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

BWART - Valuation Type

Data type: MBEW-BWTAR
Optional: Yes
Call by Reference: No ( called with pass by value option)

BWKEY - Valuation Area

Data type: MBEW-BWKEY
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_ACCOUNT_ASSIGNED -

Data type:
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

BMATN -

Data type: EKPO-MATNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for ME_CHECK_DOCUMENT_FOR_MATERIAL

CONTRACT_FLAG - Indicator: contracts exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DELPLAN_FLAG - Indicator: scheduling agreements exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INFO_FLAG - Indicator: info records exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PO_FLAG - Indicator: purchase orders exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

REQ_FLAG - Indicator: purchase requisitions exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

RFQ_FLAG - Indicator: requests for quotation exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for ME_CHECK_DOCUMENT_FOR_MATERIAL

XEKDOC -

Data type: EKDOC
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for ME_CHECK_DOCUMENT_FOR_MATERIAL 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_xekdoc  TYPE STANDARD TABLE OF EKDOC, "   
lv_contract_flag  TYPE EKDOC, "   
lv_existence_check  TYPE EKDOC, "   ' '
lv_mprof  TYPE EKPO-MPROF, "   
lv_if_sobkz  TYPE EKPO-SOBKZ, "   
lv_if_vbeln  TYPE EBKN-VBELN, "   
lv_if_vbelp  TYPE EBKN-VBELP, "   
lv_if_pspnr  TYPE EBKN-PS_PSP_PNR, "   
lv_matnr  TYPE EKPO-MATNR, "   
lv_delplan_flag  TYPE EKPO, "   
lv_info_flag  TYPE EKPO, "   
lv_plant_initial  TYPE EKPO, "   ' '
lv_werks  TYPE EKPO-WERKS, "   
lv_po_flag  TYPE EKPO, "   
lv_req_flag  TYPE EKPO, "   
lv_plant_info  TYPE EKPO, "   ' '
lv_bwart  TYPE MBEW-BWTAR, "   
lv_rfq_flag  TYPE MBEW, "   
lv_bwkey  TYPE MBEW-BWKEY, "   
lv_no_account_assigned  TYPE MBEW, "   ' '
lv_bmatn  TYPE EKPO-MATNR. "   

  CALL FUNCTION 'ME_CHECK_DOCUMENT_FOR_MATERIAL'  "NOTRANSL: Existenzprüfung auf Einkaufsbelege zum Material
    EXPORTING
         EXISTENCE_CHECK = lv_existence_check
         MPROF = lv_mprof
         IF_SOBKZ = lv_if_sobkz
         IF_VBELN = lv_if_vbeln
         IF_VBELP = lv_if_vbelp
         IF_PSPNR = lv_if_pspnr
         MATNR = lv_matnr
         PLANT_INITIAL = lv_plant_initial
         WERKS = lv_werks
         PLANT_INFO = lv_plant_info
         BWART = lv_bwart
         BWKEY = lv_bwkey
         NO_ACCOUNT_ASSIGNED = lv_no_account_assigned
         BMATN = lv_bmatn
    IMPORTING
         CONTRACT_FLAG = lv_contract_flag
         DELPLAN_FLAG = lv_delplan_flag
         INFO_FLAG = lv_info_flag
         PO_FLAG = lv_po_flag
         REQ_FLAG = lv_req_flag
         RFQ_FLAG = lv_rfq_flag
    TABLES
         XEKDOC = lt_xekdoc
. " ME_CHECK_DOCUMENT_FOR_MATERIAL




ABAP code using 7.40 inline data declarations to call FM ME_CHECK_DOCUMENT_FOR_MATERIAL

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_existence_check) = ' '.
 
"SELECT single MPROF FROM EKPO INTO @DATA(ld_mprof).
 
"SELECT single SOBKZ FROM EKPO INTO @DATA(ld_if_sobkz).
 
"SELECT single VBELN FROM EBKN INTO @DATA(ld_if_vbeln).
 
"SELECT single VBELP FROM EBKN INTO @DATA(ld_if_vbelp).
 
"SELECT single PS_PSP_PNR FROM EBKN INTO @DATA(ld_if_pspnr).
 
"SELECT single MATNR FROM EKPO INTO @DATA(ld_matnr).
 
 
 
DATA(ld_plant_initial) = ' '.
 
"SELECT single WERKS FROM EKPO INTO @DATA(ld_werks).
 
 
 
DATA(ld_plant_info) = ' '.
 
"SELECT single BWTAR FROM MBEW INTO @DATA(ld_bwart).
 
 
"SELECT single BWKEY FROM MBEW INTO @DATA(ld_bwkey).
 
DATA(ld_no_account_assigned) = ' '.
 
"SELECT single MATNR FROM EKPO INTO @DATA(ld_bmatn).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!