SAP READ_MATERIALTYPE Function Module for NOTRANSL: Materialart prüfen und weiterverarbeiten









READ_MATERIALTYPE is a standard read materialtype 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: Materialart prüfen und weiterverarbeiten 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 materialtype FM, simply by entering the name READ_MATERIALTYPE 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_MATERIALTYPE 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_MATERIALTYPE'"NOTRANSL: Materialart prüfen und weiterverarbeiten
EXPORTING
* KZRFB = ' ' "
* KZ_BERPRF = ' ' "Indicator: Authorization check required
* AKTYP = "Required only for authorization check
* CALL_MODE = "
* FLG_RETAIL = ' ' "
* WMARA_MSTAE = "
* CALL_MODE2 = ' ' "
* FLGNUMINT = ' ' "Indicator: 'Internal no. must still be determined'
* FLG_MATNR_RES = ' ' "Indicator: 'Material no. previously reserved internally'
* FLG_UEBERNAHME = ' ' "Indicator: 'Data transfer'
* MATERIAL = "Material number
* MTART_INPUT = "Specified material type
* MTART_MARA = "Material type MARA (particularly with initial data creation)
* NEUFLAG = ' ' "Indicator: 'Create'
WMARA_KZKFG = "

IMPORTING
IT134 = "Work area for T134
IT134T = "Work area for T134T
KZ_DIFF_MTART_INPUT = "Indicator: 'MTART_entry different to MTART_MARA'
MTART_MARA = "Material type MARA (particularly with initial data creation)
MTART_BESKZ = "Procurement indicator as per material type
RMMG2_KZKFG = "
RMMG2_KZMPN = "
WMARA_KZKFG = "
WMARA_MSTAE = "

EXCEPTIONS
EXT_NUMBER_NOT_ALLOWED = 1 MPN_NOT_ALLOWED = 10 EXT_NUMBER_NOT_IN_RANGE = 2 EXT_NUMBER_WO_CHECK_ERROR = 3 INTERNAL_NUMBER_NOT_ALLOWED = 4 MATERIALTYPE_MISSING = 5 EXT_MATNR_MISSING = 6 MTART_NOT_FOUND = 7 NUMBER_CHECK_ERROR = 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_MATERIALTYPE

KZRFB -

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

KZ_BERPRF - Indicator: Authorization check required

Data type: SY-DATAR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

AKTYP - Required only for authorization check

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

CALL_MODE -

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

FLG_RETAIL -

Data type: RMMG2-FLG_RETAIL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

WMARA_MSTAE -

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

CALL_MODE2 -

Data type: RMMG2-CALL_MODE2
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

FLGNUMINT - Indicator: 'Internal no. must still be determined'

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

FLG_MATNR_RES - Indicator: 'Material no. previously reserved internally'

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

FLG_UEBERNAHME - Indicator: 'Data transfer'

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

MATERIAL - Material number

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

MTART_INPUT - Specified material type

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

MTART_MARA - Material type MARA (particularly with initial data creation)

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

NEUFLAG - Indicator: 'Create'

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

WMARA_KZKFG -

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

EXPORTING Parameters details for READ_MATERIALTYPE

IT134 - Work area for T134

Data type: T134
Optional: No
Call by Reference: Yes

IT134T - Work area for T134T

Data type: T134T
Optional: No
Call by Reference: Yes

KZ_DIFF_MTART_INPUT - Indicator: 'MTART_entry different to MTART_MARA'

Data type: T130F-KZREF
Optional: No
Call by Reference: Yes

MTART_MARA - Material type MARA (particularly with initial data creation)

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

MTART_BESKZ - Procurement indicator as per material type

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

RMMG2_KZKFG -

Data type: RMMG2-KZKFG
Optional: No
Call by Reference: Yes

RMMG2_KZMPN -

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

WMARA_KZKFG -

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

WMARA_MSTAE -

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

EXCEPTIONS details

EXT_NUMBER_NOT_ALLOWED - External number assignment not allowed for material type

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

MPN_NOT_ALLOWED -

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

EXT_NUMBER_NOT_IN_RANGE - External material number not in number range

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

EXT_NUMBER_WO_CHECK_ERROR - Ext. no. assignment w/o check, but num. matl no.

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

INTERNAL_NUMBER_NOT_ALLOWED - Int. number assignment not allowed for matl type

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

MATERIALTYPE_MISSING - Material type not specified (initial data creation)

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

EXT_MATNR_MISSING - External material number not specified

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

MTART_NOT_FOUND - Material type does not exist

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

NUMBER_CHECK_ERROR - Internal error while checking ext. matl no.

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_MATERIALTYPE 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_it134  TYPE T134, "   
lv_kzrfb  TYPE MTCOM-KZRFB, "   ' '
lv_ext_number_not_allowed  TYPE MTCOM, "   
lv_kz_berprf  TYPE SY-DATAR, "   SPACE
lv_mpn_not_allowed  TYPE SY, "   
lv_aktyp  TYPE T130M-AKTYP, "   
lv_call_mode  TYPE MMDCMODE-CALL_MODE, "   
lv_flg_retail  TYPE RMMG2-FLG_RETAIL, "   SPACE
lv_wmara_mstae  TYPE MARA-MSTAE, "   
lv_call_mode2  TYPE RMMG2-CALL_MODE2, "   SPACE
lv_it134t  TYPE T134T, "   
lv_flgnumint  TYPE T130F-KZREF, "   ' '
lv_ext_number_not_in_range  TYPE T130F, "   
lv_flg_matnr_res  TYPE T130F-KZREF, "   ' '
lv_kz_diff_mtart_input  TYPE T130F-KZREF, "   
lv_ext_number_wo_check_error  TYPE T130F, "   
lv_mtart_mara  TYPE MARA-MTART, "   
lv_flg_uebernahme  TYPE T130F-KZREF, "   ' '
lv_internal_number_not_allowed  TYPE T130F, "   
lv_material  TYPE MARA-MATNR, "   
lv_mtart_beskz  TYPE RMMG2-BESKZ, "   
lv_materialtype_missing  TYPE RMMG2, "   
lv_mtart_input  TYPE T134-MTART, "   
lv_rmmg2_kzkfg  TYPE RMMG2-KZKFG, "   
lv_ext_matnr_missing  TYPE RMMG2, "   
lv_mtart_mara  TYPE MARA-MTART, "   
lv_rmmg2_kzmpn  TYPE RMMG2-KZMPN, "   
lv_mtart_not_found  TYPE RMMG2, "   
lv_neuflag  TYPE T130F-KZREF, "   ' '
lv_wmara_kzkfg  TYPE MARA-KZKFG, "   
lv_number_check_error  TYPE MARA, "   
lv_wmara_kzkfg  TYPE MARA-KZKFG, "   
lv_wmara_mstae  TYPE MARA-MSTAE, "   
lv_no_authority  TYPE MARA. "   

  CALL FUNCTION 'READ_MATERIALTYPE'  "NOTRANSL: Materialart prüfen und weiterverarbeiten
    EXPORTING
         KZRFB = lv_kzrfb
         KZ_BERPRF = lv_kz_berprf
         AKTYP = lv_aktyp
         CALL_MODE = lv_call_mode
         FLG_RETAIL = lv_flg_retail
         WMARA_MSTAE = lv_wmara_mstae
         CALL_MODE2 = lv_call_mode2
         FLGNUMINT = lv_flgnumint
         FLG_MATNR_RES = lv_flg_matnr_res
         FLG_UEBERNAHME = lv_flg_uebernahme
         MATERIAL = lv_material
         MTART_INPUT = lv_mtart_input
         MTART_MARA = lv_mtart_mara
         NEUFLAG = lv_neuflag
         WMARA_KZKFG = lv_wmara_kzkfg
    IMPORTING
         IT134 = lv_it134
         IT134T = lv_it134t
         KZ_DIFF_MTART_INPUT = lv_kz_diff_mtart_input
         MTART_MARA = lv_mtart_mara
         MTART_BESKZ = lv_mtart_beskz
         RMMG2_KZKFG = lv_rmmg2_kzkfg
         RMMG2_KZMPN = lv_rmmg2_kzmpn
         WMARA_KZKFG = lv_wmara_kzkfg
         WMARA_MSTAE = lv_wmara_mstae
    EXCEPTIONS
        EXT_NUMBER_NOT_ALLOWED = 1
        MPN_NOT_ALLOWED = 10
        EXT_NUMBER_NOT_IN_RANGE = 2
        EXT_NUMBER_WO_CHECK_ERROR = 3
        INTERNAL_NUMBER_NOT_ALLOWED = 4
        MATERIALTYPE_MISSING = 5
        EXT_MATNR_MISSING = 6
        MTART_NOT_FOUND = 7
        NUMBER_CHECK_ERROR = 8
        NO_AUTHORITY = 9
. " READ_MATERIALTYPE




ABAP code using 7.40 inline data declarations to call FM READ_MATERIALTYPE

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 DATAR FROM SY INTO @DATA(ld_kz_berprf).
DATA(ld_kz_berprf) = ' '.
 
 
"SELECT single AKTYP FROM T130M INTO @DATA(ld_aktyp).
 
"SELECT single CALL_MODE FROM MMDCMODE INTO @DATA(ld_call_mode).
 
"SELECT single FLG_RETAIL FROM RMMG2 INTO @DATA(ld_flg_retail).
DATA(ld_flg_retail) = ' '.
 
"SELECT single MSTAE FROM MARA INTO @DATA(ld_wmara_mstae).
 
"SELECT single CALL_MODE2 FROM RMMG2 INTO @DATA(ld_call_mode2).
DATA(ld_call_mode2) = ' '.
 
 
"SELECT single KZREF FROM T130F INTO @DATA(ld_flgnumint).
DATA(ld_flgnumint) = ' '.
 
 
"SELECT single KZREF FROM T130F INTO @DATA(ld_flg_matnr_res).
DATA(ld_flg_matnr_res) = ' '.
 
"SELECT single KZREF FROM T130F INTO @DATA(ld_kz_diff_mtart_input).
 
 
"SELECT single MTART FROM MARA INTO @DATA(ld_mtart_mara).
 
"SELECT single KZREF FROM T130F INTO @DATA(ld_flg_uebernahme).
DATA(ld_flg_uebernahme) = ' '.
 
 
"SELECT single MATNR FROM MARA INTO @DATA(ld_material).
 
"SELECT single BESKZ FROM RMMG2 INTO @DATA(ld_mtart_beskz).
 
 
"SELECT single MTART FROM T134 INTO @DATA(ld_mtart_input).
 
"SELECT single KZKFG FROM RMMG2 INTO @DATA(ld_rmmg2_kzkfg).
 
 
"SELECT single MTART FROM MARA INTO @DATA(ld_mtart_mara).
 
"SELECT single KZMPN FROM RMMG2 INTO @DATA(ld_rmmg2_kzmpn).
 
 
"SELECT single KZREF FROM T130F INTO @DATA(ld_neuflag).
DATA(ld_neuflag) = ' '.
 
"SELECT single KZKFG FROM MARA INTO @DATA(ld_wmara_kzkfg).
 
 
"SELECT single KZKFG FROM MARA INTO @DATA(ld_wmara_kzkfg).
 
"SELECT single MSTAE FROM MARA INTO @DATA(ld_wmara_mstae).
 
 


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!