SAP BF_STOCK_DETERMINATION Function Module for NOTRANSL: Allgemeiner Funktionsbaustein Bestandsfindung
BF_STOCK_DETERMINATION is a standard bf stock determination 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: Allgemeiner Funktionsbaustein Bestandsfindung 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 bf stock determination FM, simply by entering the name BF_STOCK_DETERMINATION into the relevant SAP transaction such as SE37 or SE38.
Function Group: MDBF
Program Name: SAPLMDBF
Main Program: SAPLMDBF
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BF_STOCK_DETERMINATION 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 'BF_STOCK_DETERMINATION'"NOTRANSL: Allgemeiner Funktionsbaustein Bestandsfindung.
CHANGING
X_BFCOM = "DE-EN-LANG-SWITCH-NO-TRANSLATION
TABLES
* I_BFSTOCK = "
E_BFSTOCK = "
* I_MDVA = "
* E_MDVA = "
* E_DB_MDBF = "
* I_MCHA_KEY = "
* I_ATPCSX = "
* E_ATPCSX = "
* E_MDVEX = "
EXCEPTIONS
NO_MATERIAL = 1 CONVERSION_NOT_FOUND = 10 CONVERSION_OVERFLOW = 11 MISSING_ENTRY_T156C = 12 CONVERSION_TYPE_INVALID = 13 DIVISION_BY_ZERO = 14 DATA_MISMATCH = 15 MATERIAL_NOT_FOUND = 16 NO_QUANTITY = 17 NO_PLANT = 2 NO_APPLICATION = 3 FUNCTION_NOT_POSSIBLE = 4 CONDITION_NOT_FOUND = 5 CLASSTYPE_NOT_FOUND = 6 CLASSTYPE_NOT_ACTIVE = 7 NO_BASE_UNIT = 8 NO_UNIT = 9
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_SAPLMDBF_001 Customer Exit for Stock Determination Rule
EXIT_SAPLMDBF_002 Customer Exit for Stock Determination Item Table
CHANGING Parameters details for BF_STOCK_DETERMINATION
X_BFCOM - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type: BFCOMOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BF_STOCK_DETERMINATION
I_BFSTOCK -
Data type: BFSTOCKOptional: Yes
Call by Reference: No ( called with pass by value option)
E_BFSTOCK -
Data type: BFSTOCKOptional: No
Call by Reference: No ( called with pass by value option)
I_MDVA -
Data type: MDVAOptional: Yes
Call by Reference: No ( called with pass by value option)
E_MDVA -
Data type: MDVAOptional: Yes
Call by Reference: No ( called with pass by value option)
E_DB_MDBF -
Data type: MDBFOptional: Yes
Call by Reference: No ( called with pass by value option)
I_MCHA_KEY -
Data type: MCHAOptional: Yes
Call by Reference: No ( called with pass by value option)
I_ATPCSX -
Data type: ATPCSOptional: Yes
Call by Reference: No ( called with pass by value option)
E_ATPCSX -
Data type: ATPCSOptional: Yes
Call by Reference: No ( called with pass by value option)
E_MDVEX -
Data type: MDVEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_MATERIAL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CONVERSION_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CONVERSION_OVERFLOW -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_ENTRY_T156C -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CONVERSION_TYPE_INVALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DIVISION_BY_ZERO -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DATA_MISMATCH -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MATERIAL_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_QUANTITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PLANT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_APPLICATION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FUNCTION_NOT_POSSIBLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CONDITION_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASSTYPE_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CLASSTYPE_NOT_ACTIVE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BASE_UNIT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_UNIT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BF_STOCK_DETERMINATION 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_x_bfcom | TYPE BFCOM, " | |||
| lt_i_bfstock | TYPE STANDARD TABLE OF BFSTOCK, " | |||
| lv_no_material | TYPE BFSTOCK, " | |||
| lv_conversion_not_found | TYPE BFSTOCK, " | |||
| lv_conversion_overflow | TYPE BFSTOCK, " | |||
| lv_missing_entry_t156c | TYPE BFSTOCK, " | |||
| lv_conversion_type_invalid | TYPE BFSTOCK, " | |||
| lv_division_by_zero | TYPE BFSTOCK, " | |||
| lv_data_mismatch | TYPE BFSTOCK, " | |||
| lv_material_not_found | TYPE BFSTOCK, " | |||
| lv_no_quantity | TYPE BFSTOCK, " | |||
| lv_no_plant | TYPE BFSTOCK, " | |||
| lt_e_bfstock | TYPE STANDARD TABLE OF BFSTOCK, " | |||
| lt_i_mdva | TYPE STANDARD TABLE OF MDVA, " | |||
| lv_no_application | TYPE MDVA, " | |||
| lt_e_mdva | TYPE STANDARD TABLE OF MDVA, " | |||
| lv_function_not_possible | TYPE MDVA, " | |||
| lt_e_db_mdbf | TYPE STANDARD TABLE OF MDBF, " | |||
| lv_condition_not_found | TYPE MDBF, " | |||
| lt_i_mcha_key | TYPE STANDARD TABLE OF MCHA, " | |||
| lv_classtype_not_found | TYPE MCHA, " | |||
| lt_i_atpcsx | TYPE STANDARD TABLE OF ATPCS, " | |||
| lv_classtype_not_active | TYPE ATPCS, " | |||
| lt_e_atpcsx | TYPE STANDARD TABLE OF ATPCS, " | |||
| lv_no_base_unit | TYPE ATPCS, " | |||
| lt_e_mdvex | TYPE STANDARD TABLE OF MDVE, " | |||
| lv_no_unit | TYPE MDVE. " |
|   CALL FUNCTION 'BF_STOCK_DETERMINATION' "NOTRANSL: Allgemeiner Funktionsbaustein Bestandsfindung |
| CHANGING | ||
| X_BFCOM | = lv_x_bfcom | |
| TABLES | ||
| I_BFSTOCK | = lt_i_bfstock | |
| E_BFSTOCK | = lt_e_bfstock | |
| I_MDVA | = lt_i_mdva | |
| E_MDVA | = lt_e_mdva | |
| E_DB_MDBF | = lt_e_db_mdbf | |
| I_MCHA_KEY | = lt_i_mcha_key | |
| I_ATPCSX | = lt_i_atpcsx | |
| E_ATPCSX | = lt_e_atpcsx | |
| E_MDVEX | = lt_e_mdvex | |
| EXCEPTIONS | ||
| NO_MATERIAL = 1 | ||
| CONVERSION_NOT_FOUND = 10 | ||
| CONVERSION_OVERFLOW = 11 | ||
| MISSING_ENTRY_T156C = 12 | ||
| CONVERSION_TYPE_INVALID = 13 | ||
| DIVISION_BY_ZERO = 14 | ||
| DATA_MISMATCH = 15 | ||
| MATERIAL_NOT_FOUND = 16 | ||
| NO_QUANTITY = 17 | ||
| NO_PLANT = 2 | ||
| NO_APPLICATION = 3 | ||
| FUNCTION_NOT_POSSIBLE = 4 | ||
| CONDITION_NOT_FOUND = 5 | ||
| CLASSTYPE_NOT_FOUND = 6 | ||
| CLASSTYPE_NOT_ACTIVE = 7 | ||
| NO_BASE_UNIT = 8 | ||
| NO_UNIT = 9 | ||
| . " BF_STOCK_DETERMINATION | ||
ABAP code using 7.40 inline data declarations to call FM BF_STOCK_DETERMINATION
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.Search for further information about these or an SAP related objects