2007 Mar 08 3:20 AM
hi,
please comment.
may i know if FM raise exception, the sy-subrc will not be zero whereas bapi bapiret2 wouldn't set sy-subrc value to non zero.
if yes, which means we use bapi bapiret2 if we still want the program to continue processing even has error?
thanks
hi,
please comment.
may i know if FM raise exception, the sy-subrc will not be zero whereas bapi bapiret2 wouldn't set sy-subrc value to non zero.
if yes, which means we use bapi bapiret2 if we still want the program to continue processing even has error?
thanks
2007 Mar 08 3:25 AM
Hi,
In F.M if it throws an exception it is an error and sy-subrc is set greater than zero,
but in BAPI, bapiret2 handles all the messages , status, warning, error messages..
So, we hve o check in ordrer to continue the processing,
It provides greater flexibility whether to proceed or stop...
Cheers,
Simha.
2007 Mar 08 3:27 AM
Hi,
You are right in this sense.
The very difference between normal FM and BAPI is we do not have exceptions in BAPI, as error capteruing mechanism works thro' BAPI RETURN structure.
So for deciding whether error has occured or not, you need to read this structure and see if there is any record pertaining to error.
Regds,
Akshay Bhagwat
2007 Mar 08 3:30 AM
hi, thanks for reply.
which means in bapi, if error, it still can continue processing?
thanks
2007 Mar 08 3:35 AM
Hi,
How ever if there is a error for particular record, it doesn't proceed processing with that record..
it starts with the next record...
But u need to know what the error or problem that's been occured..
So u need to go to the bapiret2 structure and check the messages what the problem is been...
Cheers,
Simha.
Reward all the helpful answers...
2007 Mar 08 12:08 PM
after BAPI fun module use bapiret2 structure
ie
BAPI_PO_CREATE1
EXP
IMP
.
IF BAPIRET2-TYP ='E' ORBAPIRET2-TYP = 'A'.
MOVE RECORDS TO ERROR INTERNAL TABLE
ELSE.
CALL FM BAPI_TRANSACTION_COMMIT
OK THIS WILL DEFINETLY WORKS OK
2007 Mar 08 12:39 PM
Hi,
When sy-subrc is set to a non zero number in bapi as exception, U can have still options to raise an error or process further, depending upon how u react (write the code) with exception value.
Thanks.