Load Current Source Code in New ABAP Debugger
Very interesting and useful tip.
While debugging if you found that any statement is missing or need to make any changes in the source code, we can do the changes in the editor without ending the debugger session and the new source code can be loaded in the debugger.
Place the break-point wherever you want within program then execute (F8)
Before load the current source code
User can edit the code in program using SE38
User can load the current source code from the following path:
Miscellaneous -> Load Current source code.
Thanks,
Syam
Thanks for sharing Syam. useful info
Thanks Shakeeluddin 🙂
Yes, very useful
Thanks Jorge 🙂
Simple but very useful.......... It is possible to change the select statement conditions without editing program I need to change in debug mode only because if it is analyse kind of work we are not allowed to change the program in that cases if any option is there it is very useful thanks in advance for reply......
Hi Ravi,
Thanks a lot.
I am not sure that feature is not available in debugger. 😐
Thanks,
Syam
nice one..sure it will be helpful. 🙂
Thanks Priya 🙂
Cool !
Thanks Shankar 🙂
gud..document
Thanks Bharath 🙂
excellent tip.....
Thanks Abilash 🙂
Hi Syambabu Allu,
In my system source code is updated, but the logic of the program remains the same, whats wrong?
Hi Mike,
Have you activated the program before going to load the current source code 😉
Thanks,
Syam.
Of course, I activated the program (ABAP 7.02, SAP GUI 7300.2.4.1084 Patch level 4), but the problem is not resolved
Hi Mike,
I am not sure.what you have missed 😕
Please activate the program.............
Good Job 🙂
Thanks for sharing 🙂
Cheers,
Akberhusain
Syambabu Allu
its really helpful. 🙂
Rgrds,
Jitendra
Hi Jitendra,
Thanks a lot 😉
Hello Syambabu Allu,
Even if the system reloads the current updated source code but the logic will not trigger.
To Check just change the IF condition to
If sy-subrc <> 0.
Loop...
endloop.
endif.
Here even the condition got failed but the program will print records.
Check this Problem with Load current Source code in Debugger 🙂
Hi Jitendra,
Have you activated the program before going to load the current source code 😉
Thanks,
Syam.
Hello Syambabu,
Without code activation "load the current source code" won't work 🙂
No.It won't work 😉
Hi Syam,
I am not sure what is missing in my system. It didn't work for me. When I use Miscellaneous->Load current Source code... I can see the updated code on screen of debugger but functionality wise it behaves like old code.
Looks like Jitendra Soni also had the similar issue as mentioned in below link.
http://scn.sap.com/thread/1945182
Actual code:
I have executed the program in other session.
Debug mode:
When the control is in debug mode I have done the code in change in the other session where the program was in edit mode and activated the program.
After code change:
After load current source code in debug session:
Changed code is visible on debug screen. Further debugging is actually executing the commented code too !
Let me know if something wrong with settings.
Rgds,
Somu
Hi,
It works wrong to all not only for you there is the problem in that functionality. 😕
Regards,
Ravi Shankar L
For me it's the the same, it does not use the "new" code.
Yes, did activation etc...
dats surely a useful piece of information.
Thanks for sharing 🙂
Regads,
Priyanka
Hi Priya,
Thanks a lot 🙂
very cool! Thanks for sharing. I am sure it helps in my daily work 🙂
Hi Jerry,
Thanks a lot 🙂 .
Even it will for my daily work also. 😉
Very good option...How come so many people missed out this option ...Simply we can change code in run time itself and we can continue our work....Time saving concept..Thanks for into
Hi Rajesh,
Thanks a lot 🙂
Thanks,
Syam
Hi syambabu Allu,
This Document is Very help full.
Thanks a Lot.
This will help me a lot in by day to day development work.
Hi Kranthi,
Thanks a lot 🙂
Thanks,
Syam
Hi ,
Thanks for sharing , Intresting one.
Regards,
Aditya.
Hi Aditya,
Thanks a lot 🙂
Thanks,
Syam
Hi Syam,
Nice One.... 🙂
Thanks,
Arun
Hi Arun,
Thanks a lot 🙂
Thanks,
Syam
Helpful INFO thanks For sharing with Screen Shots 🙂 🙂 🙂
Hi Giri,
Thanks a lot 🙂
Thanks,
Syam
Nice Tip! 🙂 Thanks for sharing it. Keep learning and sharing.
Hi Syam ,
Thanks for sharing valuable information.But it adding the current source code and there is no functionality of newly added lines.If you run second time it will add to functionality.
Regards
Ashok P
Very helpful point Syambabu Allu , i have faced this issue so many times. Always i use to restrat the debugger again. It will definetly will save the time.
Nice one. Thank you for sharing syam ...
Hello Syam,
I am using ECC 6.0 enh pck 4, in this, if we are in debug mode & change the code and do load source code, it will show the changed code but can't go to that changed code as it is not activated.
Cheers,
Bharat
Hi Syam,
I have searched many blogs and tried as said above, the changes done are physically reflecting in Debug mode but when exe(F8) it gives old code logic.
Any suggestions.... ?
Hi Syam,
It's an evidence that "load current source code" does not load the lately "program's load" (i.e. the byte code, resulting from the compilation of the program), it's just actualizing the source code in the debugger's screen. You could even debug the debugger's code to see by yourself that there is no magic code to reload the ABAP byte code.
You could answer "why this feature then?" and I don't have the answer.
Maybe it's a feature of "ancient times" (but can still happen today) when the program's load could be removed temporarily from the "PXA" (program buffer for loaded programs) and reloaded when needed, then reloading the source is needed.
I suggest you to add a warning at the beginning of your blog post, to say that this feature is NOT about correcting the program's code at runtime.
Cheers.
Sandra
this feature is NOT about correcting the program’s code at runtime
This feature is implemented in ADT though 🙂
I do all my developments in ADT, but when i comes to debugging i fallback to the good ol' UI Debugger. IMHO it has many powerful features compared to the Eclipse debugger.
Do you say you can change the code while the program is running, really?
Yes, you can edit the source code while debugging.
Cf. Basics of debugging in ADT
Oh, I see what you mean, it's possible to edit the source code within the debugger.
But it's all about this blog post and questions "it doesn't work "as you say", how did you make it work": you can change the source code, but you cannot change the current byte code while running.
You must compile it and run again from the starting point. It's different from an interpreted language.
Super info syam, But i think we cant able to execute our newly added code in runtime unless we re execute the total code.
correct??
Praneeth Ch. 🙂