Skip to Content
avatar image
Former Member

Extending Material Inspection Setup in Quality Management View

HI

I want to extend the material master data from one plant to the other plant. I am new to MM Module.

I am using BAPI_MATERIAL_SAVEDATA to extend the material and working fine. However, the bapi do not extend the inspection data, hence i am using BAPI_MATINSPCTRL_SAVEREPLICA for extending data after material data extended using BAPI_MATERIAL_SAVEDATA.

While saving the Inspection data it is showing error "No Quality Management view has been created for material GMA000015". I guess in table MARC field QMATV should have value 'X' to copy the data. Please correct me if i m wrong. or i am using the wrong function code as '023'. I have tried using '009' as well but it give diff. error.

SELECT * INTO TABLE lt_qmat
         FROM qmat
         WHERE matnr = ls_clientdata-material AND
               werks EQ plant-low.

       LOOP AT lt_qmat INTO ls_qmat.
         CLEAR : ls_bapi_qmat.
         MOVE-CORRESPONDING ls_qmat TO ls_bapi_qmat.
         ls_bapi_qmat-function = '023'.
         ls_bapi_qmat-INSPTYPE = ls_qmat-ART.
         ls_bapi_qmat-MATERIAL = ls_qmat-matnr.
         ls_bapi_qmat-PLANT    = to_plant-low.
         ls_bapi_qmat-IND_INSPTYPE_MAT_ACTIVE = ls_qmat-AKTIV.

         APPEND ls_bapi_qmat TO bapi_qmat.
       ENDLOOP. "AT lt_qmat INTO ls_qmat.

CALL FUNCTION 'BAPI_MATINSPCTRL_SAVEREPLICA'
         TABLES
           return         = lt_bapi_return
           inspectionctrl = bapi_qmat.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 21, 2012 at 12:32 PM

    You have to analyze BAPI_MATERIAL_SAVEDATA why the Quality managment view was not created.

    It is usually the case if you do not submit a Q in PSTAT fields

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member stallone christian

      Any Idea on how to copy Localization data as well using BAPI_MATERIAL_SAVEDATA. I am working on SIN(india) Localization where i need to copy Excise Data as well for the material.

      Thanks,

      Janisar

  • Mar 21, 2012 at 09:52 AM

    Hey,

    1st Please Check your Material Type Configuration in SPRO.

    Is your Material GMA000015 has Quality Management View ,

    If not then Configure for this Material's Type.  Then Execute your code.

    Add comment
    10|10000 characters needed characters exceeded

    • I got it.

      I have created same situation and done it.

      1st see that QM in Procurement is Active or not for that Plant in Quality Management View,

      Pass QM Control Key Also.

      2. Code Change,

      Do not Pass  ls_bapi_qmat-function = '023'. Leave it Blank.

      SELECT * INTO TABLE LT_QMAT
                FROM QMAT
                WHERE MATNR = 'NY01'  AND "Material
                      WERKS EQ '1000'. "Ref Plant

      LOOP AT LT_QMAT INTO LS_QMAT.

         CLEAR : LS_BAPI_QMAT.

         CALL FUNCTION 'MAP2E_QMAT_TO_BAPI1001004_QMAT'
           EXPORTING
             QMAT             = LS_QMAT
           CHANGING
             BAPI1001004_QMAT = LS_BAPI_QMAT.
         LS_BAPI_QMAT-PLANT    = '2000'. "Your Plant to be Extended, can be same as ref
        "Clear Etc fields from LS_BAPI_QMAT, or change
         APPEND LS_BAPI_QMAT TO BAPI_QMAT.
      ENDLOOP.

      CALL FUNCTION 'BAPI_MATINSPCTRL_SAVEREPLICA'
         TABLES
           RETURN         = LT_BAPI_RETURN
           INSPECTIONCTRL = BAPI_QMAT.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          = 'X'.