I have a requirement to update AFS MRP safety stock quantity in material master. For this purpose i am using BAPI '/AFS/BAPI_MATERIAL_SAVEDATA'.
This BAPI is able to update successfully with any quantity except zero quantity (0). Not sure why i am not able to update safety stock quantity to zero.
Is there anything else that i am missing out? Please advice.
lwa_headdata-material = 12345678.
lwa_headdata-afs_mrp_view = 'X'.
lwa_plantdata-plant = MY01.
lwa_plantdata-coverage_strtgy = CVS01.
lwa_plantdatax-plant = MY01.
lwa_plantdatax-coverage_strtgy = 'X'.
lwa_sku_plantdata_mrp-plant = MY01.
lwa_sku_plantdata_mrp-safety_stk = 0.
lwa_sku_plantdata_mrp-grid_value = 28.
lwa_sku_plantdata_mrp-stock_category = 1AA.
APPEND lwa_sku_plantdata_mrp TO lt_sku_plantdata_mrp.
* Call BAPI to update safety stock in material master
CALL FUNCTION '/AFS/BAPI_MATERIAL_SAVEDATA'
headdata = lwa_headdata
plantdata = lwa_plantdata
plantdatax = lwa_plantdatax
return = lwa_return
sku_plantdata_mrp = lt_sku_plantdata_mrp.