Skip to Content

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

To report this post you need to login first.

54 Comments

You must be Logged on to comment or reply to a post.

  1. Ravi Shankar

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

    (0) 
      1. Somasekhar C

        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

        (0) 
  2. 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

    (0) 
  3. Ashok P

    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

    (0) 
  4. 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

    (0) 
  5. Hari kumar

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

    (0) 
  6. 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

    (1) 
    1. Suhas Saha

      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.

       

      (0) 
      1. Sandra Rossi

        This feature is implemented in ADT though πŸ™‚

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

        (0) 
          1. 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.

            (1) 

Leave a Reply