BAPI are RFC enabled function modules used in interfaces. no hard errors are possible and one shouldnt code hard errors in RFC function modules. Error messages should be captured in bapireturn table.
When hen we use BaPi for update in workflow background task, we should check the BapI return tables for errors and set a flag and raise an exception in the method itself. If method is BOR based we can define exception in SWO1 and if method is class based then we can use class exception CX_SWF_RUN_WIM
Usually it is better to notify someone via email or sending a dailog workitem to fix the errors than sending the WF to error.
regards
sandy
Message was edited by: Sandy Singh