Register Login

Mass Change MRP Indicator

Updated Jul 09, 2018

When you change the MRP indicator ( transaction SM30 - V_T001L_D ), SAP does not mass update all the material Sloc MRP Indicator in MRP View 4. It assume that the change are for newly created material and storage location starting from the changed date onwards.

The MRP indicator for storage location does not change the MRP indicator in the material master that have already been saved before the change. This ABAP BAPI (Business Application Programming Interfaces) program was created to mass change all the material master MRP indicator whenever the user want to.

REPORT ZMRPIND. 

TABLES: T001L, 

        MARD. 

DATA: BAPI_HEAD   LIKE BAPIMATHEAD, 

      BAPI_MARD1  LIKE BAPI_MARD, 

      BAPI_MARDX1 LIKE BAPI_MARDX, 

      BAPI_RETURN LIKE BAPIRET2. 

SELECT-OPTIONS: 

            PLANT    FOR  MARD-WERKS OBLIGATORY MEMORY ID M01, 

            MATERIAL FOR  MARD-MATNR MEMORY ID M02. 

SELECT * FROM T001L WHERE WERKS IN PLANT. 

   SELECT * FROM MARD WHERE WERKS  = T001L-WERKS 

                        AND LGORT  = T001L-LGORT 

                        AND MATNR IN MATERIAL. 

    IF T001L-DISKZ = MARD-DISKZ. 

       CONTINUE. 

    ENDIF. 

    BAPI_HEAD-MATERIAL   = MARD-MATNR. 

    BAPI_HEAD-MRP_VIEW   = 'X'. 

    BAPI_MARD1-PLANT     = MARD-WERKS. 

    BAPI_MARD1-STGE_LOC  = MARD-LGORT. 

    BAPI_MARD1-MRP_IND   = T001L-DISKZ. 

    BAPI_MARDX1-PLANT    = MARD-WERKS. 

    BAPI_MARDX1-STGE_LOC = MARD-LGORT. 

    BAPI_MARDX1-MRP_IND  = 'X'. 

    WRITE:/ BAPI_HEAD, BAPI_MARD1. 

    call function 'BAPI_MATERIAL_SAVEDATA' 

      exporting 

        headdata                   = BAPI_HEAD 

*       CLIENTDATA                 = 

*       CLIENTDATAX                = 

*       PLANTDATA                  = 

*       PLANTDATAX                 = 

*       FORECASTPARAMETERS         = 

*       FORECASTPARAMETERSX        = 

*       PLANNINGDATA               = 

*       PLANNINGDATAX              = 

        STORAGELOCATIONDATA        = BAPI_MARD1 

        STORAGELOCATIONDATAX       = BAPI_MARDX1 

*       VALUATIONDATA              = 

*       VALUATIONDATAX             = 

*       WAREHOUSENUMBERDATA        = 

*       WAREHOUSENUMBERDATAX       = 

*       SALESDATA                  = 

*       SALESDATAX                 = 

*       STORAGETYPEDATA            = 

*       STORAGETYPEDATAX           = 

      IMPORTING 

        RETURN                     = BAPI_RETURN 

*     TABLES 

*       MATERIALDESCRIPTION        = 

*       UNITSOFMEASURE             = 

*       UNITSOFMEASUREX            = 

*       INTERNATIONALARTNOS        = 

*       MATERIALLONGTEXT           = 

*       TAXCLASSIFICATIONS         = 

*       RETURNMESSAGES             = 

*       PRTDATA                    = 

*       PRTDATAX                   = 

*       EXTENSIONIN                = 

*       EXTENSIONINX               = 

          . 
IF BAPI_RETURN-TYPE = 'E'. 

   WRITE:/ BAPI_RETURN. 

ENDIF. 

   ENDSELECT. 

ENDSELECT.

 


×