2013 Nov 03 9:37 AM
As known, when you call a BAPI, it does not work at first at most times and needs to be find out where the problem is.
Usually, I debug the BAPI, but it is not easy to find the place where the error happens because SAP standard programs are very complicated.
So my question is, does BAPI provide some kind of functionalities from which you can get the function name and line NO where error raises
inside the BAP.
I think that it is technically possible, but I am not quite sure if SAP has this.
2013 Nov 03 10:50 AM
Hello Ming,
Definitely, you can find the exact problem with BAPI call by analyzing 'Return' table of BAPI.
Try to get the return type of Return table of BAPI, if erro exists: get the message of Return table.
Use Return table of BAPI to get the error or success detail of BAPI.
Hope your problem get resolved.
Regards,
Chandan
2013 Nov 03 11:31 AM
If you debug the BAPI in the new debugger, you can press 'F9' and create dynamic break-points. If you type 'RAISE EXCEPTION', just 'RAISE' or 'MESSAGE', and then execute the source, you probably bump into the error raised by standard SAP. It can be usefull, but you can bump into many other messages and issues as well.
Best,
Sander
2013 Nov 03 11:50 AM
Dear Ming yu,
Every bapi have a Return table or structure which will show you the exact error which has been coming due to some short falls. If the same message is coming on the standard then you will get it in the bapi RETURN table or structure as well. I think the message calsses has been maitained for the standard errors. So no need to debug the whole bapi where the error is coming. if you really want to see the error then i think the only way is to put a watch point for the error message which is coming and the debugger will definetly stop at that error no, message no or exception no.
regards,
2013 Nov 03 12:48 PM
Hi Ming yu,
BAPI will have a return table it has all the details like error message description, Message ID, Message Class.
While debugging the BAPI if you put a break point at message ID & Message Class if will take to you the line where you are getting error.
Thanks.
2013 Nov 03 3:09 PM
Hi Ming Yu,
Return Parameter will store the BAPI all kinds of messages. You can try to use the below method to analyze the error messages in BAPI or any other transactions.
Go to the SE91 ( Message Class) - Enter the details and go to the Where used list. Place the break point on the relevant message and debug the BAPI function module again.
Thanks,
Kiran
2013 Nov 04 2:51 AM
Hi, all
But there could be lots of same error messages that come from different subroutines or functions inside the BAPI.
If you just know the return error message ID and contents, I do not think that you can position the place where error occurs at every time.
So what I mean is, it could be better if I can get the PROGRAM NAME where raises an error in the BAPI.
2013 Nov 04 2:58 AM
Hi,
You can create a break point in debugger via menu Breakpoints->Break point at->Break point at message. For Exceptions, you can use "Break point at exception".
Thanks.
Jim
2013 Nov 04 3:38 AM
Hi,
First Of all, you need to bare in mind , When you are updateing your information, you have to use together with BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK.
Secondly, I will create a wrapper function to obtian the feedback message from BAPI and display them all in a dialog, thus It bring better user experiences , meanwhile easy for you to troubleshoot. http://scn.sap.com/docs/DOC-48519