Hello Experts,
I have requirement to incorporate certain logic by creating an implementation in BADI "workorder_update" . I have coded the logic but i get a runtime error stating that "Invalid COMMIT WORK in an update function module." When i explored further I found that this error is arising from function module " BAPI_MATERIAL_PLANNING " for which I have coded as below ,
CALL FUNCTION 'BAPI_MATERIAL_PLANNING'
EXPORTING
material = it1-matnr
plant = it1-werks
* MRP_AREA =
* PLAN_SCENARIO =
MRP_PLAN_PARAM = it_mrp_list
* MATERIAL_EVG =
IMPORTING
* MRP_STATISTIC =
return = t_return
* TABLES
* mrp_lists = iit_mrp_list
* EXTENSIONOUT =
.
*checking if return result from BAPI_MATERIAL_PLANNING was success.
IF l1_return-type = 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
RETURN = t_return
.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
RETURN = t_return
.
endif.
Thanks & regards ,
Prakrita Kapoor.