‎2008 Oct 30 8:57 AM
Hi,
We have the following:
PERFORM run_bapi ON COMMIT.
FORM run_bapi.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE' IN BACKGROUND TASK
EXPORTING
goodsmvt_header = l_goods
goodsmvt_code = l_code
TABLES
goodsmvt_item = l_item
return = l_return.
* Error handling work here????
ENDFORM.
If the bapi fails to carry out the goods movement, we want to see the error somewhere (WF, application log....wherever).
Obviously, if I had control of inside the bapi I could do it but is there another way?
And I don't think any checks for the error after the function call will be reached.
Any suggestions?
Thanks.
‎2008 Oct 30 8:59 AM
Normally has every bapi a return structure or return internal table like BAPIRET. It gives the result of the call.
regards,
hans
‎2008 Oct 30 8:59 AM
Normally has every bapi a return structure or return internal table like BAPIRET. It gives the result of the call.
regards,
hans
‎2008 Oct 30 9:04 AM
thanks Hans,
yes the lx_return will be populated when the FM is actually run but the function is being run in background so my question is if I check that table after the call function will that code be reached? I am doing a test now to see.....
‎2008 Nov 03 1:19 PM
Hi,
if I don't call the function in background task, the error table is populated but this means that there could be locking issues.
Is there any way to still call it in background but force the FM to populate the error table?
thanks.