SAP MBEW_EXTEND Function Module for Add Information from Previous Period from Mat. Val. Rec. Table









MBEW_EXTEND is a standard mbew extend SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Add Information from Previous Period from Mat. Val. Rec. Table 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 mbew extend FM, simply by entering the name MBEW_EXTEND into the relevant SAP transaction such as SE37 or SE38.

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



Function MBEW_EXTEND 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 'MBEW_EXTEND'"Add Information from Previous Period from Mat. Val. Rec. Table
EXPORTING
* KZRFB = ' ' "Indicator Reset Buffer
* MAXTZ = 0 "Maximum number of table lines
* XVPER = 'X' "Indicator Determine Data for Previous Period
* XVVPR = 'X' "Indicator Determine Data for Period Before Last
* XVJAH = 'X' "Indicator Determine Data for Last Period of Previous Year
* XVVJA = 'X' "Indicator Determine Data for Last Period of Year Before Last

IMPORTING
RMBEWH = "Indicator Mat. Val. Rec. for Previous Period Could Not Be Loaded

TABLES
MBEW_TAB = "Table with Mat. Val. Rec. Segments
* MBEW_EXT_TAB = "Table with More Previous Period Fields
.



IMPORTING Parameters details for MBEW_EXTEND

KZRFB - Indicator Reset Buffer

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

MAXTZ - Maximum number of table lines

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

XVPER - Indicator Determine Data for Previous Period

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

XVVPR - Indicator Determine Data for Period Before Last

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

XVJAH - Indicator Determine Data for Last Period of Previous Year

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

XVVJA - Indicator Determine Data for Last Period of Year Before Last

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

EXPORTING Parameters details for MBEW_EXTEND

RMBEWH - Indicator Mat. Val. Rec. for Previous Period Could Not Be Loaded

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

TABLES Parameters details for MBEW_EXTEND

MBEW_TAB - Table with Mat. Val. Rec. Segments

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

MBEW_EXT_TAB - Table with More Previous Period Fields

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

Copy and paste ABAP code example for MBEW_EXTEND 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_kzrfb  TYPE MTCOM-KZRFB, "   ' '
lv_rmbewh  TYPE MTPER-RMBEWH, "   
lt_mbew_tab  TYPE STANDARD TABLE OF MBEW, "   
lv_maxtz  TYPE MTCOM-MAXTZ, "   0
lt_mbew_ext_tab  TYPE STANDARD TABLE OF MBEW_EXT, "   
lv_xvper  TYPE MTCOM-XVPER, "   'X'
lv_xvvpr  TYPE MTCOM-XVVPR, "   'X'
lv_xvjah  TYPE MTCOM-XVJAH, "   'X'
lv_xvvja  TYPE MTCOM-XVVJA. "   'X'

  CALL FUNCTION 'MBEW_EXTEND'  "Add Information from Previous Period from Mat. Val. Rec. Table
    EXPORTING
         KZRFB = lv_kzrfb
         MAXTZ = lv_maxtz
         XVPER = lv_xvper
         XVVPR = lv_xvvpr
         XVJAH = lv_xvjah
         XVVJA = lv_xvvja
    IMPORTING
         RMBEWH = lv_rmbewh
    TABLES
         MBEW_TAB = lt_mbew_tab
         MBEW_EXT_TAB = lt_mbew_ext_tab
. " MBEW_EXTEND




ABAP code using 7.40 inline data declarations to call FM MBEW_EXTEND

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 KZRFB FROM MTCOM INTO @DATA(ld_kzrfb).
DATA(ld_kzrfb) = ' '.
 
"SELECT single RMBEWH FROM MTPER INTO @DATA(ld_rmbewh).
 
 
"SELECT single MAXTZ FROM MTCOM INTO @DATA(ld_maxtz).
 
 
"SELECT single XVPER FROM MTCOM INTO @DATA(ld_xvper).
DATA(ld_xvper) = 'X'.
 
"SELECT single XVVPR FROM MTCOM INTO @DATA(ld_xvvpr).
DATA(ld_xvvpr) = 'X'.
 
"SELECT single XVJAH FROM MTCOM INTO @DATA(ld_xvjah).
DATA(ld_xvjah) = 'X'.
 
"SELECT single XVVJA FROM MTCOM INTO @DATA(ld_xvvja).
DATA(ld_xvvja) = 'X'.
 


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!