You are on page 1of 9

ABAP Development: How New Debugger

Saved my Day !!!

Posted by karthikeyan P Dec 30, 2015


Note: The ASSIGN technique which I have used in this blog is NOT Recommended by SAP. Please go through
the comments section of ASSIGN Life made easy. before reading this.

Recently I was working on a custom VOFM routine implementation. My functional counterpart was sitting with
me and we had configured the routine by entering the key.
Now it is my job to implement the code. I was able to get the values available in the structure KOMKBV2 inside
the routine. But he needed the values from other structures (say LIKP) to implement the custom validation.

The functional consultant sitting next to me was very keen now. He wanted to know how to retrieve the internal
table / structure values which are not directly available from the userexit / BADI / Customer Exit interface
parameters.

I need to explain him now

So I set a breakpoint in the VOFM routine. We executed the transaction and program stopped at the breakpoint
in the routine which I had set earlier.

From the debugger, I started to loop back to previous program from the call stack. I showed him how to check
the values of the internal tables & structures of the previous program which called the VOFM routine.

Generated by Jive on 2016-02-02+01:00


1
ABAP Development: How New Debugger Saved my Day !!!

I told him that we have an option to use

ASSIGN ((<program name>)<internal table[]>) to <field symbol of that type>.

CONSTANTS : lc_likp TYPE char17 VALUE '(SAPMV50A)xlikp[]'.


FIELD-SYMBOLS:<fs_likp> TYPE STANDARD TABLE.

ASSIGN (lc_likp) to <fs_likp>.

Phew!!! I was able to read the value which he was interested. But now he started to fire questions at me.

How to find all the internal tables which I can use by this way. How to find that???

I managed to tell him that if a program a loaded and available in context, we can access the global variables of
that program by the above method. But it is not advisable to read the data by this way, as SAP has the right to
change logic of the program or name of the internal table in the future release. But he was reluctant to accept
that.

Okay!! Then give me the list of all programs which are loaded and available in context now. I
need to know

Oh God!! Please save me from him. I honestly dont know, how to get the details of all program
which were loaded right now.

Generated by Jive on 2016-02-02+01:00


2
ABAP Development: How New Debugger Saved my Day !!!

1. Idea..!!! I can activate a trace and execute the transaction. Collect all the programs names
displaying in the trace log and give it to him. Thats a good idea!!! But how do I get the
list of internal table names & its value. I cannot directly get those from the trace.

Without a hope, I was going through the options available in the debugger. I noticed an icon with
name Replace Tool. I hardly used that. I click on that and I got a pop up. It has many options
coupled as a tree. I expanded the tree Special Tools. I was able to find Loaded Programs
(Global Data)

I doubled click that and the tool was giving me everything I wanted. Thank God You saved
me ..!!!

Generated by Jive on 2016-02-02+01:00


3
ABAP Development: How New Debugger Saved my Day !!!

It has two tabs Loaded Programs & Global data. From the global data tab, I was able to get the global
variables, internal table, work area value. And the best thing was, I was able to search by CTRL + F based on
the variable names. What else do I need..!!!

After he left, I did a quick search on this feature in google. I was amazed to find the below two URLs.

https://help.sap.com/saphelp_nw73ehp1/helpdata/en/49/1ec3f1f3ee6492e10000000a42189b/content.htm
http://scn.sap.com/community/abap/testing-and-troubleshooting/blog/2011/07/14/news-in-abap-debugger-
breakpoints-and-watchpoints-statement-debugging

Everything was explained in detail and I had never read / bookmarked it First thing I did after that was
to click on Follow and started following the updates on that space.

Thanks for your time to stop by and read this blog.

Regards,
Karthikeyan
1928 Views Tags: development, abap, debugger, debugging_for_functional_consultants, loadedprogram

SRINIVAS REDDY in response to karthikeyan P on page 5


Jan 27, 2016 4:47 AM

I overcome This by using SPOOL ... Thank you Sp much to all..

Naimesh Patel in response to karthikeyan P on page 5


Jan 26, 2016 5:44 PM
Apparently you are not much fan of criticism!! And obviously title fooled me.

There are many new features in the New ABAP debugger and its great that SAP is adding more and more with
each release.

Generated by Jive on 2016-02-02+01:00


4
ABAP Development: How New Debugger Saved my Day !!!

Regarding the Global Memory reading using ASSIGN, if you don't recommended to use but you still used
in your development, then its clear contention. You should only use in your development which you can
recommend.

Hoping for more meaningful title in future

Thanks,

Naimesh Patel

karthikeyan P in response to SRINIVAS REDDY on page 6


Jan 26, 2016 3:40 AM
Hi Srinivas,

You can post this in ABAP Development space and will get suggestions from SCN members.

Thanks,
Karthikeyan

karthikeyan P in response to Naimesh Patel on page 6


Jan 26, 2016 3:36 AM
Hi Nimesh,

The idea of this blog is to share people that there are options like, to view the list of loaded programs are
available in New debugger.

Also not many people who have entered into SAP world after 2011 would prefer or have chance to use the
classical debugger. I am one among them. To be honest I wasn't aware that this sort of feature was available
earlier.

And I guess, I have just written this in a blog. I just wanted to share what happened on that day. I
neither endorse nor recommend the use of <Assign> technique in this blog and after Jelena Perfiljeva
recommendation I had clearly mentioned in this on the top.

I am happy that you liked the catchy title and thanks for those KIND words.

Thanks,
Karthikeyan

Clemens Li in response to Naimesh Patel on page 6


Jan 25, 2016 7:46 PM
Thank you for the hint on this function. It might be useful if I could export or at least copy the the tree of loaded
programs together with the global data tables.
Thanks,

Generated by Jive on 2016-02-02+01:00


5
ABAP Development: How New Debugger Saved my Day !!!

Clemens

Naimesh Patel
Jan 25, 2016 6:57 PM
I think I hoped more by the title. It seems that's still true that don't judge the book by the cover or watch the
movie by poster !!

I think the feature for checking the Global data is available long back. The technique of using the dirty read on
Global data is definitely not recommended and comes in with its own problems.

The functional consultant who is asking for list of all the loaded global data so he can decide which table to use
-- I must say, that either the function consultant thinks that he knows all tables and all fields behavior or the
designer (developer) doesn't know how to achieve the requirement.

Thanks,

Naimesh Patel

Richard Harper in response to SRINIVAS REDDY on page 6


Jan 22, 2016 3:33 PM
How is this relevant to the new debugger ?

To answer your question Read the help on SUBMIT, specifically EXPORTING LIST TO MEMORY and then
have a look at function modules LIST_FROM_MEMORY nad LIST_TO_ASCI.

SRINIVAS REDDY
Jan 22, 2016 2:31 PM
Hi karthikeyan P , Nice to meet you.
I have one doubt .
Present i am creating Function module in this I need to use submit to call other ZREPORT(Classical Report).
Everything is perfect i am able to bring internal table from Zreport.
But the problem is i want total sum and few data which are available in botton report display in report(classical)
using WRITE statement. How to bring those type of data into my zfunction module.
Thanking you.

Joachim Rees
Jan 22, 2016 8:49 AM
Hi Karthikeyan,

thank you for sharing! Yes, the "new" debugger is very powerfull, I'm motivated now to explore some more of
it's features when I have the time. You never know when they'll come in handy!

Best
Joachim

Kripa Rangachari

Generated by Jive on 2016-02-02+01:00


6
ABAP Development: How New Debugger Saved my Day !!!

Jan 5, 2016 3:45 PM


Hi Karthikeyan,

I have used most of the tools from the New - Debugger. Have never tried this 'Load Programs' option..

Thanks for the details

Cheers,
Kripa Rangachari.

karthikeyan P in response to Jelena Perfiljeva on page 7


Jan 5, 2016 4:00 AM
Hi Jelena,

Thanks for pointing the blog. I was not aware of that. After going through the comments section of that blog,
yes, I agree with Suhas Saha now.

Jelena Perfiljeva in response to Suhas Saha on page 8


Jan 4, 2016 6:57 PM
Yes, there was a blog on this on SCN, the red moderator warning on top says it all.

karthikeyan P in response to Thangam Perumal on page 7


Jan 4, 2016 3:38 AM
Hi Thangam,

Thanks for your comments. Wish you the same.

-
Karthikeyan

Thangam Perumal
Jan 2, 2016 5:17 AM
Hi Karthikeyan,
Nice blog. Thanks for sharing. This is the first thing I learned from SCN in this New Year -
2016.

Happy New Year Dude.

Regards,
Thangam.P

Suhas Saha in response to karthikeyan P on page 8


Jan 1, 2016 6:47 PM
I know the consequence of using ASSIGN construct, but here in my project they do not
entertain the usage of Implicit Enhancement unless it is highly necessary.

Generated by Jive on 2016-02-02+01:00


7
ABAP Development: How New Debugger Saved my Day !!!

Well, in that case the project guidelines need to be reviewed again. Implicit Enhancement is safer than the
ASSIGN construct you have used.

Btw, i was comparing implicit enhancement with the ASSIGN. It is a well-known fact that if SAP std.
enhancements available then they should be used first.

SUNIL MANI
Dec 31, 2015 7:33 AM
Thanks sharing with us. Most of us never noticed this, when we really gone out of an idea, we try such a things

Thank you again!

karthikeyan P in response to Suhas Saha on page 8


Dec 31, 2015 6:26 AM
Thanks Suhas for pointing Layer aware debugger. I have just gone through it and it looks really helpful.

I know the consequence of using ASSIGN construct, but here in my project they do not entertain the usage of
Implicit Enhancement unless it is highly necessary. If there is any BADI or exit available, they prefer that over
implicit. We also document this kind of codes and keep an eye on those exits during Up-gradation. Thanks for

reading the blog and for your comments.

Suhas Saha
Dec 30, 2015 10:55 PM
Actually the feature you have discussed is not new to the new debugger. But yes the new debugger is much
more user-friendly than its predecessor.

The features i like the most about the new debugger are - Layer Aware debugging & debugger scripts. I use
the former regularly, the latter mostly when i need to set dynamic watchpoints on field-symbols.

I know this is a bit off-topic (my apologies) but the ASSIGN construct you have suggested/used is for "SAP
internal" use only and should be avoided. You would have been better off using an implicit enhancement to
capture the value of this variable. justsaying

karthikeyan P in response to Richard Harper on page 8


Dec 30, 2015 2:44 PM

Thanks Richard. Without those tools we may have to spend many sleepless nights

Richard Harper
Dec 30, 2015 2:38 PM
Damn Good you say!! Too right it is. Watch points are a boon! immediate Breakpoints are fantastic! Access to
the stack in an easy manner!

Regards

Rich

Generated by Jive on 2016-02-02+01:00


8
ABAP Development: How New Debugger Saved my Day !!!

karthikeyan P in response to Kiran K on page 9


Dec 30, 2015 1:57 PM

It happens, when we analyze any standard program with the help of functional, we keep asking them if there is
any configuration behind this. We may have to answer any technical question they raise, in response to that.

Also, most of the functional consultants are very keen to learn the debugging and the concept behind that. It is
bit difficult to explain and make them understand. When a senior functional consultant raises a query, obviously
you don't have any choice.

But, In the end, we will explore the unexplored areas.

--Karthikeyan

Kiran K
Dec 30, 2015 12:58 PM
Karthikeyan,

Yes NEW DEBUGGER is damn good.


Just sheer out of curiosity,what on earth is the Functional Consultant going to do with those list of programs
and internal tables.100% sure most of them would be INCLUDE programs which can't be executable and on
the face of it we will not know which is head and which is tail.Typical FC :-)

K.Kiran.

Generated by Jive on 2016-02-02+01:00


9

You might also like