Saturday 15 September 2018

Demystifying Eclipse interaction with ABAP

This Blog is Demystifying Eclipse interaction with ABAP.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials


Where to Start?


First thing which was needed was a test case in order to dig further how eclipse interact with ABAP. As I could not replicate the error as faced by Enno Wulff ,thought of creating a report which is already existing. It will show me the error. So at least i have got an error might be a different one, but good enough to drill down. Lets now dig more.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

First Try

First try was to check if we can get something in SM50, while we were creating the report  via ADT but sadly no good luck, its too quick.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

Second Try

So what next? I thought the most basic thing for a developer to use eclipse is to have the authorization. So without thinking any further i opened the ADT configuration document, a developer must have authorization for S_ADT_RES.  So i did a where used list in SU21 . Set the external breakpoints. Tried again bingo at least it is stopping in debugger is stopping when I am creating something.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

This breakpoint led to the discovery of a very important function module SADT_REST_RFC_ENDPOINT in the call stack. This function module was getting called to handle all eclipse request. Next part for me was to find out from where this message was coming from. Most probably we will have some standard function module being called for the same. So I placed a breakpoint at call function statement. 

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

Bingo found the place from where this message was coming from after few F8’s

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

Now since i have searched earlier also for any existing help on this but did not get any fruitful result. All we got was how to perform debugging in ADT not something like how to debug ADT to ABAP interaction. I thought of searching now with the function module which we have found.

Verifying my findings


Apart from this he has also mentioned about very important eclipse views one is error log and another is ABAP communication log which shows the details of the REST calls being made by the ADT. I was still thinking there must be a simple way to check what all was run in the background in this interaction, this led to the next step.

A General Approach to troubleshoot such issues.


So moving on we were looking for something which can give us call stack of what is being called in the background.  While debugging i could see loads of calls about trace and then it struck me how come i have missed ST12, it should have been the first step:)  Anyway  I switched on the trace, performed some actions and switched it off. The trace clearly shows me what all ABAP code was executed and what SQL’s were triggered in the background.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

So  I then wanted to cross check this trace solution for package creation also.All i need to do was switch on the trace,perform actions and read the trace.

SAP ABAP Development, SAP ABAP Guides, SAP ABAP Certification, SAP ABAP Study Materials

So another way we found out to understand how ADT interact with ABAP is via ST12. Since now we know what all code is being triggered we can put strategic breakpoints to debug further. Looking forward to hear from you what other ways you have used to handle this problem.

No comments:

Post a Comment