Skip to Content
Author's profile photo Syambabu Allu

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)

11.JPG

Before load the current source code

12.JPG

User can edit the code in program using SE38

13.JPG


User can load the current source code from the following path:

    Miscellaneous -> Load Current source code.

14.JPG

15.JPG

Thanks,

Syam

Assigned Tags

      55 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shakeeluddin Khaja
      Shakeeluddin Khaja

      Thanks for sharing Syam. useful info

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Shakeeluddin 🙂

      Author's profile photo Former Member
      Former Member

      Yes, very useful

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Jorge 🙂

      Author's profile photo Former Member
      Former Member

      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......

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Ravi,

      Thanks a lot.

      I am not sure that feature is not available in debugger. 😐

      Thanks,

      Syam

      Author's profile photo Priyaranjan Gupta
      Priyaranjan Gupta

      nice one..sure it will be helpful. 🙂

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Priya 🙂

      Author's profile photo SHANKARANARAYAN KRISHNAMOORTHY
      SHANKARANARAYAN KRISHNAMOORTHY

      Cool !

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Shankar 🙂

      Author's profile photo Bharath Kumar
      Bharath Kumar

      gud..document

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Bharath 🙂

      Author's profile photo abilash n
      abilash n

      excellent tip.....

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Thanks Abilash 🙂

      Author's profile photo Former Member
      Former Member

      Hi Syambabu Allu,

      In my system source code is updated, but the logic of the program remains the same, whats wrong?

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Mike,

      Have you activated the program before going to load the current source code 😉

      Thanks,

      Syam.

      Author's profile photo Former Member
      Former Member

      Of course, I activated the program (ABAP 7.02, SAP GUI 7300.2.4.1084 Patch level 4), but the problem is not resolved

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Mike,

      I am not sure.what you have missed 😕

      Author's profile photo Former Member
      Former Member

      Please activate the program.............

      Author's profile photo Former Member
      Former Member

      Good Job 🙂
      Thanks for sharing 🙂

      Cheers,

      Akberhusain

      Author's profile photo Jitendra Kansal
      Jitendra Kansal

      Syambabu Allu

      its really helpful. 🙂

      Rgrds,

      Jitendra

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Jitendra,

      Thanks a lot 😉

      Author's profile photo Jitendra Soni
      Jitendra Soni

      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    🙂

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Jitendra,

      Have you activated the program before going to load the current source code 😉

      Thanks,

      Syam.

      Author's profile photo Jitendra Soni
      Jitendra Soni

      Hello Syambabu,

      Without code activation "load the current source code" won't work  🙂


      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      No.It won't work 😉

      Author's profile photo Former Member
      Former Member

      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:

      Actual Code.jpg

      I have executed the program in other session.

      Debug mode:

      Debug_Before Change.jpg

      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:

      Code Change.jpg

      After load current source code in debug session:

      after Load current source code.jpg

      Changed code is visible on debug screen. Further debugging is actually executing the commented code too !

      commented code is being executed.jpg

      Let me know if something wrong with settings.

      Rgds,

      Somu

      Author's profile photo Former Member
      Former Member

      Hi,

      It works wrong to all not only for you there is the problem in that functionality. 😕

      Regards,

      Ravi Shankar L

      Author's profile photo Timo John
      Timo John

      For me it's the the same, it does not use the "new" code.

      Yes, did activation etc...

      Author's profile photo Former Member
      Former Member

      dats surely a useful piece of information.

      Thanks for sharing 🙂

      Regads,

      Priyanka

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Priya,

      Thanks a lot 🙂

      Author's profile photo Jerry Wang
      Jerry Wang

      very cool! Thanks for sharing. I am sure it helps in my daily work 🙂

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Jerry,

      Thanks a lot 🙂 .

      Even it will for my daily work also. 😉

      Author's profile photo rajesh bethamcharla
      rajesh bethamcharla

      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

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Rajesh,

      Thanks a lot 🙂

      Thanks,

      Syam

      Author's profile photo Former Member
      Former Member

      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.

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Kranthi,

      Thanks a lot 🙂

      Thanks,

      Syam

      Author's profile photo Former Member
      Former Member

      Hi ,

      Thanks for sharing , Intresting one.

      Regards,

      Aditya.

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Aditya,

      Thanks a lot 🙂

      Thanks,

      Syam

      Author's profile photo Arun Chembra
      Arun Chembra

      Hi Syam,

      Nice One.... 🙂

      Thanks,

      Arun

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Arun,

      Thanks a lot 🙂

      Thanks,

      Syam

      Author's profile photo Former Member
      Former Member

      Helpful INFO thanks For sharing with Screen Shots 🙂 🙂 🙂

      Author's profile photo Syambabu Allu
      Syambabu Allu
      Blog Post Author

      Hi Giri,

      Thanks a lot 🙂

      Thanks,

      Syam

      Author's profile photo Rahul Mahajan
      Rahul Mahajan

      Nice Tip! 🙂 Thanks for sharing it. Keep learning and sharing.

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Modadugu Hemanth Kumar
      Modadugu Hemanth Kumar

      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.

      Author's profile photo Gokulakumar Kamalanathan
      Gokulakumar Kamalanathan

      Nice one. Thank you for sharing syam ...

      Author's profile photo Bharath Kumar
      Bharath Kumar

      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

      Author's profile photo Former Member
      Former Member

      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.... ?

      Author's profile photo Sandra Rossi
      Sandra Rossi

      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

      Author's profile photo Former Member
      Former Member

      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.

       

      Author's profile photo Sandra Rossi
      Sandra Rossi

      This feature is implemented in ADT though ?

      Do you say you can change the code while the program is running, really?

      Author's profile photo Former Member
      Former Member

      Yes, you can edit the source code while debugging.

      Cf. Basics of debugging in ADT

      Author's profile photo Sandra Rossi
      Sandra Rossi

      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.

      Author's profile photo Sunny Ch
      Sunny Ch

      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. 🙂