During the discussions about writing ABAP code for proxy communication
there was always a little bit of confusion who should be doing that,
should it be an interface developer (as I like to do it), who knows
how to write ABAP proxies but in some cases may know ABAP a little bit less then
a pure ABAP developer or should be an ABAP developer who’s ABAP skills
are in most cases better then an interface consultant but on the other hand
he may not know how (or understand) the proxy framework as he does not use it
as often as an interface developer.
I’m not going to discuss which approach is better in this article I’ll just show
a simple way on how to check if both type of those developers did a good work.
ABAP environment has an excellent tool for checking ABAP code – called Code Inspector.
This tool has many standard checks which offer a way to check the performance of the code,
check for some wrong habits when writing the code, etc. There is however also
a pretty easy way to enhance this Code Inspector with our own checks
and this is the part when we can implement some ABAP Proxy specific checks.
A simple list of ABAP proxy implementation considerations can be found
in SAP course BIT420 and some of them are for example:
– never invoke commit work for server proxies
(even for sync it’s better to use CL_SOAP_COMMIT_ROLLBACK=>COMMIT() )
– don’t use statements like: CALL TRANSACTION, SUBMIT REPORT, etc.
– don’t invoke any screens
(you can find the full list in BIT420)
Let me show you how this can be easily implemented.
The guide for implementing new checks for Code Inspector is already on SDN:
so we just needs to enhance it so it will work with ABAP proxy checks.
In my example I implemented check for “commit work” statement for proxy classes
and now in transaction SCII (Code inspector) I can select my ABAP proxy class:
and then I just need to select the category that does my ABAP proxy checks
(created according to the weblog shown above)
Next when I run the check and if my proxy contains wrong statements I will see
it in the log:
You can of course also use ABAP proxy check available in SPROXY transaction
which checks and compares the metadata between ABAP stack and ESR.
Hope this blog will give you some new ideas on how you can make sure
the code written by ABAP developers will be implemented correctly
according to the ABAP Proxy rules.