Finding Source Code of SAP Standard Adapter Modules
While writing this blog I myself get this feeling that I am doing something really outdated and makes we wonder why I or someone has not written yet. May be it was too obvious for the people. But then is it really so obvious?
I happened to see few questions around it on SCN Q&A, also I myself had to read code of some standard modules for getting to know certain parameters. I happened to go through this blog too. And then I realized for whom it is not so obvious,
- People with limited knowledge to access the OS level of SAP servers and with limited knowledge of how the server structure looks like (Hardly anyone gets the access).
- People really not pro in Java and EJBs in SAP AS Java servers.
So it made me land up here writing an outdated blog which I or anyone should(could) have written half a decade back. I am showing a sample for the popular MessageTransformBean module. So here’s how do we do it in a non-pro way
- Navigate to NWA-> Configuration->Infrastructure->Application Modules
- Filter on Type=EJB Module, search for jar starting with com.sap.aii and look JNDI names. By JNDI names you will come to know which module you are looking at
Just another example
- Once you copy the name of jar as shown in screenshot navigate to – Navigate to NWA-> Configuration->Infrastructure->Java Class Loader Viewer
- Type the name (copy) com.sap.aii.af.mod.trans in component name and hit enter
- Go to the Resources tab and you have located the physical location of the jar file for the module
- If you have access to the OS level then great. If you don’t simply ask basis team to download and give you this jar file
- Once you have the jar file you can go for java decompiler tool. I go for jd-gui requires no installation and no hustle from below link
download the zip version for windows
- Extract and Run
- You and simply drag and drop the jar or open jar with it and you will see the code.
That is all it was a short and sweet blog (not for the experts out there). I tried searching for contents related to this to be sure I am not violating the rules of engagement 😉 ;).
Hope it helps few folks!
No worries, you’ve violated the EULA of SAP products and you are encouraging others to make the same thing
“6.2 Protection of Rights. Licensee is not entitled to copy, translate, disassemble, decompile nor reverse engineer the Software or other SAP Materials. Licensee must not create or attempt to create the source code from the object code of the Software or other SAP Materials. Licensee is permitted to back up data in accordance with good information technology practice and for this purpose to create the necessary backup copies of the Software. Backup copies on transportable discs or other data media must be marked as backup copies and bear the same copyright and authorship notice as the original discs or other data media, unless technically infeasible. Licensee must not change or remove SAP’s copyright and authorship notices.”
Thanks a lot for letting that information known to me and everyone else, much appreciated. All the fellow scn members do consider the terms mentioned above by Max.
Blog's purpose is to make everyone more informative at the end to the day it will be licensee's responsibility to keep the code intact.
To be honest, SAP documentation is often times so bad that there is indeed the need to decompile adapter modules etc. in order to understand how to effectively use them! If code is not copied and otherwise used, I don’t see a risk when decompiling it if it’s just for understanding how to use the software.
Thanks for the Blog, Max.
I came up with this information after a very similar incident where sometime back I was not able to find no documentations about a parameter of MessageTransformBean, and thus thought of just checking the code.
I strongly recommend to follow EULA codes as there are strong contractual implications involved and take this blog as an information gathering mechanism.
The issue here is not what do you think or not, the EULA of SAP products is very clear “it is not allowed to decompile it”, If I were the owner of this blog I would removed words like “decompile” SAP products.