ABAP Chemistry – Sometimes don’t always react how you expect

Home / Blog / ABAP Chemistry – Sometimes don’t always react how you expect

Well, in my extensive time I’ve been spending working on my Renovation updates (multiple serial number, enhanced return order creation, enhanced repair order creation) I’ve spent quite a bit of time scratching my head.  Not because I couldn’t find functions to do what I needed, but rather because independently the code worked great.  But as soon as I started doing more complicated testing, one or more functions suddenly began throwing errors.  Let me tell you, what a headache.

So let me explain some of the things I’ve discovered.  The first takeaway (and I’m sure you programming types already know this) is that functions and BAPI have this global area of variables.  Which is great, you can re-use things and make life easier.  Where the challenge lies is that you don’t always see that the same function group (global area) may be called many levels deep in different “unrelated” functions.  Especially when you begin to loop through and call multiple functions more than once, the confusion hits.  I was having entire functions throw errors because a previous BAPI set a flag that somehow was looked at in an unrelated function (that one took a couple of hours to dig out).  In some instances, call the BAPI_TRANSACTION_COMMIT function can clear some things…  but it doesn’t work for everything.

The worst part is that there isn’t an easy solution to this.  I’ve resorted to finding different functions to call, or moving certain function calls to different parts of the method.

Anyway, if you find yourself getting weird errors, you may have to look for common variables within the functions you are using.  In my case, it took some creativity to make it work.  I’m finally almost there 🙂

Thanks for reading,

As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike

Leave a Reply

Your email address will not be published. Required fields are marked *