SAP READ_MAT_ANKER Function Module for NOTRANSL: Lesen MARA sowie notwendige Prüfungen
READ_MAT_ANKER is a standard read mat anker 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: Lesen MARA sowie notwendige Prüfungen 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 mat anker FM, simply by entering the name READ_MAT_ANKER into the relevant SAP transaction such as SE37 or SE38.
Function Group: MG02
Program Name: SAPLMG02
Main Program: SAPLMG02
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function READ_MAT_ANKER 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_MAT_ANKER'"NOTRANSL: Lesen MARA sowie notwendige Prüfungen.
EXPORTING
* KZRFB = ' ' "
* AENNR = "
* HERKUNFT = ' ' "
* MAXTZ = 0 "
AKTYP = "Activity category
* FLG_MATNR_RES = ' ' "Ind.: 'Material no. previously reserved internally'
* SPERRMODUS = ' ' "Lock mode (' ', shared, or exclusive)
* VERARB = ' ' "
* FLG_RETAIL = ' ' "
* WMMUE1 = "
* WMMUER1 = "
IMPORTING
FLGNUMINT = "Ind.: 'Internal no. must still be determined'
NEUFLAG = "Ind.: Create
WMARA = "Work area MARA
RMMG2_MANBR = "Authorization for key data
CHANGING
* MATERIAL = "Material number
* DLINE = "
* AEDAT = "
EXCEPTIONS
NOT_FOUND = 1 VERSION_INCONSISTENT = 10 RESERVED_MATNR_EXISTS = 2 RESERVED_MATNR_MISSING = 3 SPEC_SIGN_IN_MATNR = 4 WRONG_CALL = 5 LOCK_ON_MATERIAL = 6 LOCK_SYSTEM_ERROR = 7 MATERIAL_EXISTS = 8 NO_AUTHORITY = 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_SAPLMG02_001 Customer Exit: Internal Material Number Assignment
EXIT_SAPLMG02_002 Customer Exit: External Material Number Assignment
IMPORTING Parameters details for READ_MAT_ANKER
KZRFB -
Data type: MTCOM-KZRFBDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
AENNR -
Data type: RMMG1-AENNROptional: Yes
Call by Reference: No ( called with pass by value option)
HERKUNFT -
Data type: T130R-TBHERDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
MAXTZ -
Data type: MTCOM-MAXTZOptional: Yes
Call by Reference: No ( called with pass by value option)
AKTYP - Activity category
Data type: T130M-AKTYPOptional: No
Call by Reference: No ( called with pass by value option)
FLG_MATNR_RES - Ind.: 'Material no. previously reserved internally'
Data type: T130F-KZREFDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPERRMODUS - Lock mode (' ', shared, or exclusive)
Data type: TVGVI-SPERADefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
VERARB -
Data type: T130M-VERARDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_RETAIL -
Data type: RMMG2-FLG_RETAILDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WMMUE1 -
Data type: MMUE1Optional: Yes
Call by Reference: No ( called with pass by value option)
WMMUER1 -
Data type: MMUER1Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for READ_MAT_ANKER
FLGNUMINT - Ind.: 'Internal no. must still be determined'
Data type: T130F-KZREFOptional: No
Call by Reference: No ( called with pass by value option)
NEUFLAG - Ind.: Create
Data type: T130F-KZREFOptional: No
Call by Reference: No ( called with pass by value option)
WMARA - Work area MARA
Data type: MARAOptional: No
Call by Reference: No ( called with pass by value option)
RMMG2_MANBR - Authorization for key data
Data type: RMMG2-MANBROptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for READ_MAT_ANKER
MATERIAL - Material number
Data type: MARA-MATNROptional: Yes
Call by Reference: No ( called with pass by value option)
DLINE -
Data type: RMMG1-DLINEOptional: Yes
Call by Reference: No ( called with pass by value option)
AEDAT -
Data type: RMMG1-AEDATOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - Material does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VERSION_INCONSISTENT -
Data type:Optional: No
Call by Reference: Yes
RESERVED_MATNR_EXISTS - Material for reserved material number already exists
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RESERVED_MATNR_MISSING - Reserved material number not specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SPEC_SIGN_IN_MATNR - Material number contains disallowed special characters
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_CALL - Activity category is empty
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCK_ON_MATERIAL - Material is already locked (MARA)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCK_SYSTEM_ERROR - System error while locking the material
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MATERIAL_EXISTS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for READ_MAT_ANKER 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_material | TYPE MARA-MATNR, " | |||
| lv_flgnumint | TYPE T130F-KZREF, " | |||
| lv_not_found | TYPE T130F, " | |||
| lv_aennr | TYPE RMMG1-AENNR, " | |||
| lv_version_inconsistent | TYPE RMMG1, " | |||
| lv_herkunft | TYPE T130R-TBHER, " ' ' | |||
| lv_dline | TYPE RMMG1-DLINE, " | |||
| lv_maxtz | TYPE MTCOM-MAXTZ, " 0 | |||
| lv_neuflag | TYPE T130F-KZREF, " | |||
| lv_reserved_matnr_exists | TYPE T130F, " | |||
| lv_aedat | TYPE RMMG1-AEDAT, " | |||
| lv_aktyp | TYPE T130M-AKTYP, " | |||
| lv_wmara | TYPE MARA, " | |||
| lv_reserved_matnr_missing | TYPE MARA, " | |||
| lv_rmmg2_manbr | TYPE RMMG2-MANBR, " | |||
| lv_flg_matnr_res | TYPE T130F-KZREF, " ' ' | |||
| lv_spec_sign_in_matnr | TYPE T130F, " | |||
| lv_sperrmodus | TYPE TVGVI-SPERA, " ' ' | |||
| lv_wrong_call | TYPE TVGVI, " | |||
| lv_verarb | TYPE T130M-VERAR, " ' ' | |||
| lv_lock_on_material | TYPE T130M, " | |||
| lv_flg_retail | TYPE RMMG2-FLG_RETAIL, " ' ' | |||
| lv_lock_system_error | TYPE RMMG2, " | |||
| lv_wmmue1 | TYPE MMUE1, " | |||
| lv_material_exists | TYPE MMUE1, " | |||
| lv_wmmuer1 | TYPE MMUER1, " | |||
| lv_no_authority | TYPE MMUER1. " |
|   CALL FUNCTION 'READ_MAT_ANKER' "NOTRANSL: Lesen MARA sowie notwendige Prüfungen |
| EXPORTING | ||
| KZRFB | = lv_kzrfb | |
| AENNR | = lv_aennr | |
| HERKUNFT | = lv_herkunft | |
| MAXTZ | = lv_maxtz | |
| AKTYP | = lv_aktyp | |
| FLG_MATNR_RES | = lv_flg_matnr_res | |
| SPERRMODUS | = lv_sperrmodus | |
| VERARB | = lv_verarb | |
| FLG_RETAIL | = lv_flg_retail | |
| WMMUE1 | = lv_wmmue1 | |
| WMMUER1 | = lv_wmmuer1 | |
| IMPORTING | ||
| FLGNUMINT | = lv_flgnumint | |
| NEUFLAG | = lv_neuflag | |
| WMARA | = lv_wmara | |
| RMMG2_MANBR | = lv_rmmg2_manbr | |
| CHANGING | ||
| MATERIAL | = lv_material | |
| DLINE | = lv_dline | |
| AEDAT | = lv_aedat | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| VERSION_INCONSISTENT = 10 | ||
| RESERVED_MATNR_EXISTS = 2 | ||
| RESERVED_MATNR_MISSING = 3 | ||
| SPEC_SIGN_IN_MATNR = 4 | ||
| WRONG_CALL = 5 | ||
| LOCK_ON_MATERIAL = 6 | ||
| LOCK_SYSTEM_ERROR = 7 | ||
| MATERIAL_EXISTS = 8 | ||
| NO_AUTHORITY = 9 | ||
| . " READ_MAT_ANKER | ||
ABAP code using 7.40 inline data declarations to call FM READ_MAT_ANKER
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 MATNR FROM MARA INTO @DATA(ld_material). | ||||
| "SELECT single KZREF FROM T130F INTO @DATA(ld_flgnumint). | ||||
| "SELECT single AENNR FROM RMMG1 INTO @DATA(ld_aennr). | ||||
| "SELECT single TBHER FROM T130R INTO @DATA(ld_herkunft). | ||||
| DATA(ld_herkunft) | = ' '. | |||
| "SELECT single DLINE FROM RMMG1 INTO @DATA(ld_dline). | ||||
| "SELECT single MAXTZ FROM MTCOM INTO @DATA(ld_maxtz). | ||||
| "SELECT single KZREF FROM T130F INTO @DATA(ld_neuflag). | ||||
| "SELECT single AEDAT FROM RMMG1 INTO @DATA(ld_aedat). | ||||
| "SELECT single AKTYP FROM T130M INTO @DATA(ld_aktyp). | ||||
| "SELECT single MANBR FROM RMMG2 INTO @DATA(ld_rmmg2_manbr). | ||||
| "SELECT single KZREF FROM T130F INTO @DATA(ld_flg_matnr_res). | ||||
| DATA(ld_flg_matnr_res) | = ' '. | |||
| "SELECT single SPERA FROM TVGVI INTO @DATA(ld_sperrmodus). | ||||
| DATA(ld_sperrmodus) | = ' '. | |||
| "SELECT single VERAR FROM T130M INTO @DATA(ld_verarb). | ||||
| DATA(ld_verarb) | = ' '. | |||
| "SELECT single FLG_RETAIL FROM RMMG2 INTO @DATA(ld_flg_retail). | ||||
| DATA(ld_flg_retail) | = ' '. | |||
Search for further information about these or an SAP related objects