SAP MB_CHECK_MATERIAL_STOCKS Function Module for Material Availability Check









MB_CHECK_MATERIAL_STOCKS is a standard mb check material stocks SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Material Availability Check 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 mb check material stocks FM, simply by entering the name MB_CHECK_MATERIAL_STOCKS into the relevant SAP transaction such as SE37 or SE38.

Function Group: MBMV
Program Name: SAPLMBMV
Main Program: SAPLMBMV
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MB_CHECK_MATERIAL_STOCKS 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 'MB_CHECK_MATERIAL_STOCKS'"Material Availability Check
EXPORTING
DM07M = "
MSEG = "
MBEQU = "

CHANGING
VM07M = "

TABLES
XEKPO = "
XMSKA = "
XMSKU = "
XMSLB = "
XMSPR = "
XMSSA = "
XMSSL = "
XMSSQ = "
XXISEG = "
* XEKLA = "
* XMSTB = "
XEKPK = "
* XMSTE = "
* XMSTQ = "
XFAUP = "
XMARC = "
XMARD = "
XMCHA = "
XMCHB = "
XMKOL = "
XMRES = "

EXCEPTIONS
NO_QUANTITY = 1
.



IMPORTING Parameters details for MB_CHECK_MATERIAL_STOCKS

DM07M -

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

MSEG -

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

MBEQU -

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

CHANGING Parameters details for MB_CHECK_MATERIAL_STOCKS

VM07M -

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

TABLES Parameters details for MB_CHECK_MATERIAL_STOCKS

XEKPO -

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

XMSKA -

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

XMSKU -

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

XMSLB -

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

XMSPR -

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

XMSSA -

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

XMSSL -

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

XMSSQ -

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

XXISEG -

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

XEKLA -

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

XMSTB -

Data type: SMSTB
Optional: Yes
Call by Reference: Yes

XEKPK -

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

XMSTE -

Data type: SMSTE
Optional: Yes
Call by Reference: Yes

XMSTQ -

Data type: SMSTQ
Optional: Yes
Call by Reference: Yes

XFAUP -

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

XMARC -

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

XMARD -

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

XMCHA -

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

XMCHB -

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

XMKOL -

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

XMRES -

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

EXCEPTIONS details

NO_QUANTITY -

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

Copy and paste ABAP code example for MB_CHECK_MATERIAL_STOCKS 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_dm07m  TYPE DM07M, "   
lv_vm07m  TYPE VM07M, "   
lt_xekpo  TYPE STANDARD TABLE OF SEKPO, "   
lv_no_quantity  TYPE SEKPO, "   
lt_xmska  TYPE STANDARD TABLE OF SMSKA, "   
lt_xmsku  TYPE STANDARD TABLE OF SMSKU, "   
lt_xmslb  TYPE STANDARD TABLE OF SMSLB, "   
lt_xmspr  TYPE STANDARD TABLE OF SMSPR, "   
lt_xmssa  TYPE STANDARD TABLE OF SMSSA, "   
lt_xmssl  TYPE STANDARD TABLE OF SMSSL, "   
lt_xmssq  TYPE STANDARD TABLE OF SMSSQ, "   
lt_xxiseg  TYPE STANDARD TABLE OF SISEG, "   
lt_xekla  TYPE STANDARD TABLE OF SEKLA, "   
lt_xmstb  TYPE STANDARD TABLE OF SMSTB, "   
lv_mseg  TYPE MSEG, "   
lt_xekpk  TYPE STANDARD TABLE OF SEKPK, "   
lt_xmste  TYPE STANDARD TABLE OF SMSTE, "   
lt_xmstq  TYPE STANDARD TABLE OF SMSTQ, "   
lv_mbequ  TYPE TCURM-MBEQU, "   
lt_xfaup  TYPE STANDARD TABLE OF SFAUP, "   
lt_xmarc  TYPE STANDARD TABLE OF SMARC, "   
lt_xmard  TYPE STANDARD TABLE OF SMARD, "   
lt_xmcha  TYPE STANDARD TABLE OF SMCHA, "   
lt_xmchb  TYPE STANDARD TABLE OF SMCHB, "   
lt_xmkol  TYPE STANDARD TABLE OF SMKOL, "   
lt_xmres  TYPE STANDARD TABLE OF SMRES. "   

  CALL FUNCTION 'MB_CHECK_MATERIAL_STOCKS'  "Material Availability Check
    EXPORTING
         DM07M = lv_dm07m
         MSEG = lv_mseg
         MBEQU = lv_mbequ
    CHANGING
         VM07M = lv_vm07m
    TABLES
         XEKPO = lt_xekpo
         XMSKA = lt_xmska
         XMSKU = lt_xmsku
         XMSLB = lt_xmslb
         XMSPR = lt_xmspr
         XMSSA = lt_xmssa
         XMSSL = lt_xmssl
         XMSSQ = lt_xmssq
         XXISEG = lt_xxiseg
         XEKLA = lt_xekla
         XMSTB = lt_xmstb
         XEKPK = lt_xekpk
         XMSTE = lt_xmste
         XMSTQ = lt_xmstq
         XFAUP = lt_xfaup
         XMARC = lt_xmarc
         XMARD = lt_xmard
         XMCHA = lt_xmcha
         XMCHB = lt_xmchb
         XMKOL = lt_xmkol
         XMRES = lt_xmres
    EXCEPTIONS
        NO_QUANTITY = 1
. " MB_CHECK_MATERIAL_STOCKS




ABAP code using 7.40 inline data declarations to call FM MB_CHECK_MATERIAL_STOCKS

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 MBEQU FROM TCURM INTO @DATA(ld_mbequ).
 
 
 
 
 
 
 
 


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!