‎2019 Sep 13 1:05 PM
FORM bapi USING pv_exidv.
CALL FUNCTION 'BAPI_HU_DELETE'
EXPORTING
hukey = pv_exidv
ifpacked = 'X'
TABLES
return = it_return.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
wa_final-comments = 'Deleted Successfully'.
ELSE.
wa_final-comments = 'BAPI Failed'.
ENDIF.
ENDFORM. " BAPI
I am calling the above mentioned FMs in a LOOP. Suprisingly both the FMs return sy-subrc as zero but failing to update the table (vekp-status) when we are running this for multiple HUs.If we run for a single HU it is working but not for multiple.Kindly let me know where I am going wrong.
‎2019 Sep 13 1:25 PM
Evaluation of SY-SUBRC is only meaningful if you call the function module with exception handling (with option EXCEPTIONS).
As a convention BAPI's do not raise exceptions. Instead the content of parameter RETURN can be used to determine whether the call was successful (by checking if any messages with type error are returned).
‎2019 Sep 13 1:25 PM
Evaluation of SY-SUBRC is only meaningful if you call the function module with exception handling (with option EXCEPTIONS).
As a convention BAPI's do not raise exceptions. Instead the content of parameter RETURN can be used to determine whether the call was successful (by checking if any messages with type error are returned).
‎2019 Sep 13 1:28 PM
Hi, I checked the return table from BAPI and it doesn't have any type E messge.
If I run for single HU, it is working but not for multiple.
‎2019 Sep 13 1:58 PM
Refreshing the IT_RETURN table from the BAPI, for every iteration solved the issue.Thanks.