SAP MB_ADD_TRANSFER_QUANTITY Function Module for Reading and adding cross-company-code stocks in transfer
MB_ADD_TRANSFER_QUANTITY is a standard mb add transfer quantity SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Reading and adding cross-company-code stocks in transfer 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 add transfer quantity FM, simply by entering the name MB_ADD_TRANSFER_QUANTITY into the relevant SAP transaction such as SE37 or SE38.
Function Group: MBBS
Program Name: SAPLMBBS
Main Program: SAPLMBBS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MB_ADD_TRANSFER_QUANTITY 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_ADD_TRANSFER_QUANTITY'"Reading and adding cross-company-code stocks in transfer.
EXPORTING
* CUMULATE = 'X' "DE-EN-LANG-SWITCH-NO-TRANSLATION
* I_CROSS_COMPANY = "Checkbox
* I_NON_CROSS_COMPANY = "Checkbox
TABLES
* XMATNR = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XLGORT = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XRESBI = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XRESLO = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XWERKS = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XRESWK = "
* XSOBKZ = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XPSTYP = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XELIKZ = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XLOEKZ = "DE-EN-LANG-SWITCH-NO-TRANSLATION
XTAB6 = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* XBERID = "DE-EN-LANG-SWITCH-NO-TRANSLATION
IMPORTING Parameters details for MB_ADD_TRANSFER_QUANTITY
CUMULATE - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Default: 'X'
Optional: Yes
Call by Reference: Yes
I_CROSS_COMPANY - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NON_CROSS_COMPANY - Checkbox
Data type: XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MB_ADD_TRANSFER_QUANTITY
XMATNR - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XLGORT - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: Yes
XRESBI - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: Yes
XRESLO - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: Yes
XWERKS - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XRESWK -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XSOBKZ - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XPSTYP - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XELIKZ - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XLOEKZ - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
XTAB6 - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
XBERID - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for MB_ADD_TRANSFER_QUANTITY 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_xmatnr | TYPE STANDARD TABLE OF STRING, " | |||
| lv_cumulate | TYPE STRING, " 'X' | |||
| lt_xlgort | TYPE STANDARD TABLE OF STRING, " | |||
| lt_xresbi | TYPE STANDARD TABLE OF STRING, " | |||
| lt_xreslo | TYPE STANDARD TABLE OF STRING, " | |||
| lt_xwerks | TYPE STANDARD TABLE OF STRING, " | |||
| lv_i_cross_company | TYPE XFELD, " | |||
| lt_xreswk | TYPE STANDARD TABLE OF XFELD, " | |||
| lv_i_non_cross_company | TYPE XFELD, " | |||
| lt_xsobkz | TYPE STANDARD TABLE OF XFELD, " | |||
| lt_xpstyp | TYPE STANDARD TABLE OF XFELD, " | |||
| lt_xelikz | TYPE STANDARD TABLE OF XFELD, " | |||
| lt_xloekz | TYPE STANDARD TABLE OF XFELD, " | |||
| lt_xtab6 | TYPE STANDARD TABLE OF XFELD, " | |||
| lt_xberid | TYPE STANDARD TABLE OF XFELD. " |
|   CALL FUNCTION 'MB_ADD_TRANSFER_QUANTITY' "Reading and adding cross-company-code stocks in transfer |
| EXPORTING | ||
| CUMULATE | = lv_cumulate | |
| I_CROSS_COMPANY | = lv_i_cross_company | |
| I_NON_CROSS_COMPANY | = lv_i_non_cross_company | |
| TABLES | ||
| XMATNR | = lt_xmatnr | |
| XLGORT | = lt_xlgort | |
| XRESBI | = lt_xresbi | |
| XRESLO | = lt_xreslo | |
| XWERKS | = lt_xwerks | |
| XRESWK | = lt_xreswk | |
| XSOBKZ | = lt_xsobkz | |
| XPSTYP | = lt_xpstyp | |
| XELIKZ | = lt_xelikz | |
| XLOEKZ | = lt_xloekz | |
| XTAB6 | = lt_xtab6 | |
| XBERID | = lt_xberid | |
| . " MB_ADD_TRANSFER_QUANTITY | ||
ABAP code using 7.40 inline data declarations to call FM MB_ADD_TRANSFER_QUANTITY
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_cumulate) | = 'X'. | |||
Search for further information about these or an SAP related objects