SAP READ_MASE Function Module for MASE update and allocation of next, purely numeric serial numbers
READ_MASE is a standard read mase SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for MASE update and allocation of next, purely numeric serial numbers 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 read mase FM, simply by entering the name READ_MASE into the relevant SAP transaction such as SE37 or SE38.
Function Group: IMS1
Program Name: SAPLIMS1
Main Program: SAPLIMS1
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function READ_MASE 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 'READ_MASE'"MASE update and allocation of next, purely numeric serial numbers.
EXPORTING
* ANZAHL_NEU = 0 "Serial number to be reassigned to number
* MATERIAL_NR = ' ' "Material
* SERNR = ' ' "Serial number entered externally
* NO_SER_ENQ = ' ' "
TABLES
* IMASE = "Table of all current MASE changes
* ISERNR = "Table of the assigned serial numbers
EXCEPTIONS
ERR_LOCK_SERMAT = 1 ERR_LOCK_SYSTEM = 2
IMPORTING Parameters details for READ_MASE
ANZAHL_NEU - Serial number to be reassigned to number
Data type: SER01-ANZSNOptional: Yes
Call by Reference: No ( called with pass by value option)
MATERIAL_NR - Material
Data type: MASE-MATNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERNR - Serial number entered externally
Data type: EQSE-SERNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_SER_ENQ -
Data type: NO_SER_ENQDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for READ_MASE
IMASE - Table of all current MASE changes
Data type: MASEOptional: Yes
Call by Reference: No ( called with pass by value option)
ISERNR - Table of the assigned serial numbers
Data type: RISERNROptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERR_LOCK_SERMAT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERR_LOCK_SYSTEM - System error while locking
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for READ_MASE 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_imase | TYPE STANDARD TABLE OF MASE, " | |||
| lv_anzahl_neu | TYPE SER01-ANZSN, " 0 | |||
| lv_err_lock_sermat | TYPE SER01, " | |||
| lt_isernr | TYPE STANDARD TABLE OF RISERNR, " | |||
| lv_material_nr | TYPE MASE-MATNR, " SPACE | |||
| lv_err_lock_system | TYPE MASE, " | |||
| lv_sernr | TYPE EQSE-SERNR, " SPACE | |||
| lv_no_ser_enq | TYPE NO_SER_ENQ. " SPACE |
|   CALL FUNCTION 'READ_MASE' "MASE update and allocation of next, purely numeric serial numbers |
| EXPORTING | ||
| ANZAHL_NEU | = lv_anzahl_neu | |
| MATERIAL_NR | = lv_material_nr | |
| SERNR | = lv_sernr | |
| NO_SER_ENQ | = lv_no_ser_enq | |
| TABLES | ||
| IMASE | = lt_imase | |
| ISERNR | = lt_isernr | |
| EXCEPTIONS | ||
| ERR_LOCK_SERMAT = 1 | ||
| ERR_LOCK_SYSTEM = 2 | ||
| . " READ_MASE | ||
ABAP code using 7.40 inline data declarations to call FM READ_MASE
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 ANZSN FROM SER01 INTO @DATA(ld_anzahl_neu). | ||||
| "SELECT single MATNR FROM MASE INTO @DATA(ld_material_nr). | ||||
| DATA(ld_material_nr) | = ' '. | |||
| "SELECT single SERNR FROM EQSE INTO @DATA(ld_sernr). | ||||
| DATA(ld_sernr) | = ' '. | |||
| DATA(ld_no_ser_enq) | = ' '. | |||
Search for further information about these or an SAP related objects