cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_MATERIAL_SAVEDATA error requiried field

RicardoRomero_1
Active Contributor
0 Kudos
624

Hello, there.

I'm using the BAPI_MATERIAL_SAVEDATA to change some materials. (Just want to change a unique field MARC-MFRGR).

The problem is the BAPI returns an error:

"The field MARC-MTVFP/BAPI_MARC-AVAILCHECK is defined as a required field; it does not contain an entry"

Strange things:

- The material is modified correctly despite the error.

- The material doesn't have created the view where this field (MARC-MTVFP) is located. 

If I go to MM02 and change the material it's ok, no error is showed. If I create the view where the field is located then I see the error in MM02. 

Why the bapi is returning an error message asking for a required field in a view that doesnt exist in the material?

The code I'm using is prety simple: 

 


  ls_headdata-material p_ls_datos-matnr.

  ls_plantdata-plant      p_ls_datos-werks.
  ls_plantdata-matfrgtgrp p_ls_datos-mfrgr.

  ls_plantdatax-plant      p_ls_datos-werks.
  ls_plantdatax-matfrgtgrp abap_true.

  CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
      headdata       ls_headdata
      plantdata      ls_plantdata
      plantdatax     ls_plantdatax
    IMPORTING
      return         ls_return
    TABLES
      returnmessages lt_returnmessages.

Thanks in advance.

PS: We are using SAP ECC 6.0

Accepted Solutions (0)

Answers (0)