SAP MARC_READ_FOR_PM Function Module for Read Plant Segment for Material for the Validation of Header Assembly









MARC_READ_FOR_PM is a standard marc read for pm SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Plant Segment for Material for the Validation of Header Assembly 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 marc read for pm FM, simply by entering the name MARC_READ_FOR_PM into the relevant SAP transaction such as SE37 or SE38.

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



Function MARC_READ_FOR_PM 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 'MARC_READ_FOR_PM'"Read Plant Segment for Material for the Validation of Header Assembly
EXPORTING
MATERIAL_IMP = "Header assembly to be checked
* WERK_IMP = "in combination with this planning plant

IMPORTING
MAKT_EXP = "Material text
MMSTA_EXP = "Material status
SCHGT_EXP = "
RGEKZ_EXP = "
SERNP_EXP = "

EXCEPTIONS
PLANT_NOT_FOUND = 1 TEXT_NOT_FOUND = 2 MATERIAL_NOT_FOUND = 3 OTHER_ERROR = 4 LVORM_SET = 5 CONFIG_NOT_ALLOWED = 6
.



IMPORTING Parameters details for MARC_READ_FOR_PM

MATERIAL_IMP - Header assembly to be checked

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

WERK_IMP - in combination with this planning plant

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

EXPORTING Parameters details for MARC_READ_FOR_PM

MAKT_EXP - Material text

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

MMSTA_EXP - Material status

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

SCHGT_EXP -

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

RGEKZ_EXP -

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

SERNP_EXP -

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

EXCEPTIONS details

PLANT_NOT_FOUND - Combination material - wrong planning plant

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

TEXT_NOT_FOUND -

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

MATERIAL_NOT_FOUND -

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

OTHER_ERROR -

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

LVORM_SET -

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

CONFIG_NOT_ALLOWED -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for MARC_READ_FOR_PM 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_makt_exp  TYPE MAKT, "   
lv_material_imp  TYPE PLKO-ISTRU, "   
lv_plant_not_found  TYPE PLKO, "   
lv_werk_imp  TYPE PLKO-WERKS, "   
lv_mmsta_exp  TYPE MARC-MMSTA, "   
lv_text_not_found  TYPE MARC, "   
lv_schgt_exp  TYPE MARC-SCHGT, "   
lv_material_not_found  TYPE MARC, "   
lv_rgekz_exp  TYPE MARC-RGEKZ, "   
lv_other_error  TYPE MARC, "   
lv_lvorm_set  TYPE MARC, "   
lv_sernp_exp  TYPE MARC-SERNP, "   
lv_config_not_allowed  TYPE MARC. "   

  CALL FUNCTION 'MARC_READ_FOR_PM'  "Read Plant Segment for Material for the Validation of Header Assembly
    EXPORTING
         MATERIAL_IMP = lv_material_imp
         WERK_IMP = lv_werk_imp
    IMPORTING
         MAKT_EXP = lv_makt_exp
         MMSTA_EXP = lv_mmsta_exp
         SCHGT_EXP = lv_schgt_exp
         RGEKZ_EXP = lv_rgekz_exp
         SERNP_EXP = lv_sernp_exp
    EXCEPTIONS
        PLANT_NOT_FOUND = 1
        TEXT_NOT_FOUND = 2
        MATERIAL_NOT_FOUND = 3
        OTHER_ERROR = 4
        LVORM_SET = 5
        CONFIG_NOT_ALLOWED = 6
. " MARC_READ_FOR_PM




ABAP code using 7.40 inline data declarations to call FM MARC_READ_FOR_PM

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 ISTRU FROM PLKO INTO @DATA(ld_material_imp).
 
 
"SELECT single WERKS FROM PLKO INTO @DATA(ld_werk_imp).
 
"SELECT single MMSTA FROM MARC INTO @DATA(ld_mmsta_exp).
 
 
"SELECT single SCHGT FROM MARC INTO @DATA(ld_schgt_exp).
 
 
"SELECT single RGEKZ FROM MARC INTO @DATA(ld_rgekz_exp).
 
 
 
"SELECT single SERNP FROM MARC INTO @DATA(ld_sernp_exp).
 
 


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!