Skip to Content
0
Former Member
Jun 29, 2006 at 07:54 AM

BAPI_MATERIAL_SAVEDATA to update material master

2046 Views

Hi,

I am using BAPI_MATERIAL_SAVEDATA to update a material. I am updating only one field i.e MARA-MSTAE(X-plant material status on basic data 1 view) But when i excecute the BAPI its giving an error message "The field MARA-TRAGR/BAPI_MARA-TRANS_GRP is defined as a required field; it does not contain an entry" but in MARA its updating MSTAE field.

I am pasting here my code. Please help me how to solve this problem.

REPORT ZTEST1 no standard page heading.

data: headdata type bapimathead,

client_data type bapi_mara,

client_datax type bapi_marax,

return like bapiret2,

headdata-material = '000000000190000195'.

client_data-PUR_STATUS = '10'.

client_datax-PUR_STATUS = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

HEADDATA = headdata

CLIENTDATA = client_data

CLIENTDATAX = CLIENT_DATAX

  • PLANTDATA =

  • PLANTDATAX =

  • FORECASTPARAMETERS =

  • FORECASTPARAMETERSX =

  • PLANNINGDATA =

  • PLANNINGDATAX =

  • STORAGELOCATIONDATA =

  • STORAGELOCATIONDATAX =

  • VALUATIONDATA =

  • VALUATIONDATAX =

  • WAREHOUSENUMBERDATA =

  • WAREHOUSENUMBERDATAX =

  • SALESDATA =

  • SALESDATAX =

  • STORAGETYPEDATA =

  • STORAGETYPEDATAX =

  • FLAG_ONLINE = ' '

  • FLAG_CAD_CALL = ' '

  • NO_DEQUEUE = ' '

IMPORTING

RETURN = return

  • TABLES

  • MATERIALDESCRIPTION =

  • UNITSOFMEASURE =

  • UNITSOFMEASUREX =

  • INTERNATIONALARTNOS =

  • MATERIALLONGTEXT =

  • TAXCLASSIFICATIONS =

  • RETURNMESSAGES =

  • PRTDATA =

  • PRTDATAX =

  • EXTENSIONIN =

  • EXTENSIONINX =

.

if return-type = 'S'.

commit WORK.

endif.

In material 190000195 there are only 2 views basic data1 and basic data2. Initially MARA-MSTAE is '00' and i am trying to update it as '10'. My code is updating the field but giving return parameter as Error.

I also checked in Value range table of TRAGR we can have blank value i.e Generic value.

Thanks in Advance.

Rajesh.