‎2007 Nov 21 7:14 AM
Hi All,
I need some help with the <b>BAPI_MATERIAL_SAVEDATA</b>.
We are defaulting fields dynamically from a table according to material types.
My problem is when the users only want to update a specific view during creation e.g. Basic view, then there are other fields that where populated by the defaulting e.g. plant, then it gives me a error that the storage location ect. is not populated, I have created the following code, but I am not sure if the view mappings to structures is correct. I have searched the WEB and SAP SDN but can not find the mapping between the structures and the views.
IF st_bapi-mathead-basic_view <> 'X'
AND st_bapi-mathead-mrp_view <> 'X'
AND st_bapi-mathead-purchase_view <> 'X'.
CLEAR: st_bapi-mara, st_bapi-marax.
ENDIF.
IF st_bapi-mathead-storage_view <> 'X'
AND st_bapi-mathead-mrp_view <> 'X'
AND st_bapi-mathead-purchase_view <> 'X'.
CLEAR: st_bapi-marc, st_bapi-marcx.
ENDIF.
IF st_bapi-mathead-forecast_view <> 'X'.
CLEAR: st_bapi-mpop, st_bapi-mpopx.
ENDIF.
IF st_bapi-mathead-mrp_view <> 'X'.
CLEAR: st_bapi-mpgd, st_bapi-mpgdx.
ENDIF.
IF st_bapi-mathead-mrp_view <> 'X'
AND st_bapi-mathead-warehouse_view <> 'X'.
CLEAR: st_bapi-mard, st_bapi-mardx.
ENDIF.
IF st_bapi-mathead-account_view <> 'X'
AND st_bapi-mathead-cost_view <> 'X'.
CLEAR: st_bapi-mbew, st_bapi-mbewx.
ENDIF.
IF st_bapi-mathead-warehouse_view <> 'X'.
CLEAR: st_bapi-mlgn, st_bapi-mlgnx.
ENDIF.
IF st_bapi-mathead-sales_view <> 'X'.
CLEAR: st_bapi-mvke, st_bapi-mvkex.
ENDIF.
IF st_bapi-mathead-warehouse_view <> 'X'.
CLEAR: st_bapi-mlgt, st_bapi-mlgtx.
ENDIF.
IF st_bapi-makt-matl_desc IS INITIAL.
CLEAR st_bapi-makt.
ENDIF.
‎2008 Mar 18 6:53 AM
I am sorry to have to close this question as it seems ther is nobody out there that can help me.