Community
Ask a Question Write a Blog Post Login
Rudra Prasanna Mohapatra
May 26, 2015 7 minute read
Debugging for Functional Consultants
Follow RSS feed Like
60 Likes 41,706 Views 47 Comments
Introduction to Debugging
SAP consists for various transactions codes and data. Data are stored in the tables and the transaction codes
have ABAP programs at the back end. Literal meaning of debugging is ,to make something(a program in current
discussion) bug-free. But that is just one aspect of debugging.
Through debugging, we can analyze a program, understand the ow logic and most importantly nd out the
root cause to any issue .Although Debugging is the obvious task of an ABAP consultant, the debugging
knowledge would be of great help to functional consultants. It will save their time for analysis and issue
resolution , reduce over-dependence of ABAP team , help in e ort estimation.
Let’s look at the di erent aspects of debugging. We will divide the discussion in to the below parts.
1. Programs in SAP ABAP
2. Initiating the Debugging
3. Breakpoints
4. General tips
1. Programs in SAP ABAP
As functional consultants, we deal with many transaction codes and behind each transaction code, there is a
ABAP source code. It can be either SAP delivered or customized code, written by ABAP consultant for speci c
need.
When we execute the program, the control runs through the program and delivers the output. When we debug,
the control remains in our hand and runs through the program line by line, thereby allowing us to nd out a
speci c bug, or clarity about a speci c logic.
2. Initiating the Debugging
Debugging can be initiated in two ways.
a. Using /h command and executing the transaction.
b. Putting a break-point, at a particular line of the program and executing
the transaction.
As functional consultants , we would be mostly using the 1st option. The 2nd option is used, generally by
ABAPers, where they want to see the behavior of a particular section of the code. Let’s see examples of each of
the above mentioned methods.
Example
a. Using /h command and executing the transactions
Below is the initial screen of a transaction.
First step is to use the command ‘/h’.
A message will be displayed in the bottom of the screen.
The resulting Screen will be as below.
We can see the current control with the yellow arrow.
As we press ‘F5’, the control proceeds further.
If we press F8, two things can happen
1. If any Break-point is there, the control will directly ow there.(Break-Points have been discussed in more
detailed way in coming slides)
2. If no break-point is there, the debugging will end and the program will get executed.
As we move along the program, we may encounter, Subroutines/function modules, which are nothing but a
piece of code within the program, which take inputs and provide a speci c output.
If we Keep pressing on F5, we will go inside the Subroutines/function modules and go through each line.
If we have yet not entered Subroutines/function modules , then by pressing F6 , we will skip going through
the code piece and the Subroutines/function module will be completely executed.
If we have entered Subroutines/function modules , then by pressing F7 , we will come out of the code piece
and the Subroutines/function module will be completely executed.
b. Putting a break-point, at a particular line of the program and executing the transaction
This can be done by going in to the source code editor (SE38/37 etc.) and putting the break point at the desired
line. Cursor can be put on the particular line , at which we need the control to stop and click on the break point
button(highlighted in the below screenshot).This will create the breakpoint in the program.
When we execute the program, the control will go to that point and stop.
3. Break-Points
Break-point is the point where the Program execution comes to a halt and from there on we can continue
debugging or straight away execute the program , by pressing F8.
There are various ways, through which we can put a break-point in a program . Two mostly used ways are as
below.
1. During Debugging the program
2. Before Debugging/Executing the program
Lets discuss about each of the ways.
1. During Debugging of the program
During debugging break point can be put in two ways.
a. Jumping to a speci c processing block
This is one of the important methods and by far the most useful for functional consultants.
Generally we tend to debug, when we encounter an error message. In that case, we can put the breakpoint,
exactly at the point , where the error originated. And once we execute the program, that will take us straight to
that point.
Let’s take an example of the current program. It takes the input as an AL11 path. The path must be a valid one. If
we put an invalid one, it would ideally end in error. Suppose We encounter such an error, while executing the
transaction in question.
Above is the initial screen and upon execution, we got the below error.
1st thing to do after this is double clicking the error message which will give us the message class and the
message number In the screen below AD is the message class and 010 is the message number and the
message, being in red, indicates that it’s an error message.
We start the debugging, by using /h and then, we put this message class and number in the debugging screen
as mentioned in the following screenshot.
Now executing the program(F8) will take us to the exact point of error, where we can analyze the reason of the
error. In this speci c case, the IF statement below says, if the 1st two characters (OFILE_SAVE+0(2)) is not ‘\\’,
then issue an error. The input that we provided in the selection screen started with ‘//’ , and hence it resulted in
error. That’s how, we nd out the reason of an error, in this method.
b. Using the stop icon, during debugging
Once the debugging screen appears, breakpoint can be put by using the highlighted breakpoint option.
2. Before Debugging/Executing the program
This can be done by putting a breakpoint in the source code editor (SE38/37 etc.). When we execute the
program, the control will go to that point and stop.
In SE38, Cursor can be put on the particular line , at which we need the control to stop and click on the break
point button(highlighted in the below screenshot).
Next when we execute the program or transaction, the control stops at this point.
4. General Tips:
Given below are some general tips, suggestions and terminologies involved in debugging.
Debugging with the new Debugger Opens a new session. Hence , before debugging, ensure that we have
enough room for the same, else, automatically the old debugger opens.
During Debugging, if at any point, we want to see the source-code, we can do so in the following way.
During debugging, we come across select statements, which are nothing but the statements, which fetch
data from database table and store in the internal table in the run-time. If we click on the table
icon(highlighted in the below screenshot) , It opens up the table in the next window. We can download the
table data in an excel format for our analysis.
Below are few important parameters and terminologies with respect to debugging.
SY-SUBRC : It’s an indicator, that shows , whether the execution of a “Select statement” , “Function Module”,
“Subroutine” , “Method”, is successful or not. When sy-subrc is 0, it indicates that the execution is
successful.
Variable : It’s a temporary storage parameter, that holds a value during the program run-time.
Constant: As the name suggests, it holds a constant value, which is hard-coded in the program.
Tables : When the control passes through a select statement, up on successful execution, the table(internal
table) gets lled in the run-time.
Structures : Structure is di erent than a table. Its just a template, but not a table.
These were some basic information, which can be handy to the functional consultants. Debugging has far more
aspects and we can explore more of them, as we continue to be involved in more of debugging. Your comments
and suggestions are most welcome.
Alert Moderator
Assigned tags
FIN (Finance) | abap | debug | debugging for functional consultants | debugging techniques |
Related Blog Posts
LSMW for Functional Consultants in simple step-by-step way
By Ravi Sankar Venna , Sep 10, 2013
Beyond ERP – Improve your SAP Functional Area design to integrate with EPM
By Je rey Holdeman , Apr 22, 2008
FI validation trouble shooting (debug)
By Neal Zhou , Aug 09, 2016
Related Questions
LSMW. How does it work?
By Former Member , Dec 24, 2018
Assessment Cycle
By Belal Katlan , Apr 12, 2017
functional area error.
By Former Member , Aug 14, 2007
47 Comments
You must be Logged on to comment or reply to a post.
Former Member
May 26, 2015 at 3:38 am
Rudra,
Thanks for your e ort.Great document.Excellent. Keep sharing more.
Regards
Sam
Like (0)
Rudra Prasanna Mohapatra | Post author
May 26, 2015 at 3:45 am
Thanks for the nice words Sam 🙂
Regards
Rudra
Like (0)
Jyothi Pammina
May 26, 2015 at 6:09 am
Hello Rudra,
Its useful for functional consultants like me. Thanks for sharing 🙂
KR,
Jyothi
Like (0)
Rudra Prasanna Mohapatra | Post author
May 26, 2015 at 3:03 pm
Thanks Jyothi for the comments 🙂
Like (0)
Jobi Sebastian
May 26, 2015 at 12:39 pm
Hi Rudra,
Fantastic document, each steps mentioned clearly for easy understanding.
Very handy document for Functional consultants..
Thanks for sharing
Jobi
Like (0)
Rudra Prasanna Mohapatra | Post author
May 26, 2015 at 3:04 pm
Thanks Jobi, for your complement and the nice words. 🙂
Like (0)
Former Member
May 28, 2015 at 10:37 am
Hi Rudra,
Thank you for sharing the document and today i have learned some Debugging Techniques.
Awaiting to see more documents from you.
Thank you once again for sharing the document.
Regards,
Ajay.
Like (0)
Rudra Prasanna Mohapatra | Post author
May 28, 2015 at 4:12 pm
Thanks Ajay for the nice comments . Glad that it has been useful to you. 🙂
Like (0)
Prashant Govind Rane
May 28, 2015 at 10:42 am
Hi Rudra,
Very good!
B/R
Like (0)
Rudra Prasanna Mohapatra | Post author
May 28, 2015 at 4:13 pm
Thanks Prashant.
Like (0)
Aarti Hinge
June 1, 2015 at 10:10 am
Hi Prashant,
We have requriment in Report Painter (GRR1).
If you already worked on Report Painter earlier Or has knowledge about it, kindly help us in completing this
enhancement as early as possible.
send me email on aartihinge89@gmail.com
Like (0)
Former Member
June 1, 2015 at 11:13 am
A very useful document!
Like (0)
Rudra Prasanna Mohapatra | Post author
June 1, 2015 at 6:14 pm
Thanks Ganesh 🙂
Like (0)
Former Member
June 2, 2015 at 2:37 pm
Really nice information and useful information.
Thanks Rudra
Like (0)
Rudra Prasanna Mohapatra | Post author
June 4, 2015 at 2:46 am
Thanks Venkata 🙂
Like (0)
Former Member
June 3, 2015 at 12:12 pm
Nice document
Like (0)
Rudra Prasanna Mohapatra | Post author
June 4, 2015 at 2:47 am
Thanks Abdul 🙂
Like (0)
Phi Dang
June 4, 2015 at 3:02 am
Great job my friend. Cheers!
Like (0)
Rudra Prasanna Mohapatra | Post author
June 16, 2015 at 4:03 pm
Thanks Phi Dang 🙂
Like (0)
Emmanuel Fuentes
June 16, 2015 at 5:16 am
thank you for sharing, this helps!!!
Like (0)
Rudra Prasanna Mohapatra | Post author
June 16, 2015 at 4:05 pm
Thanks . Glad that you found it helpful. 🙂
Like (0)
Ganesh Sadula
June 16, 2015 at 7:34 am
Dear Rudra,
It very help document ,
Thank for sharing your knowledge and e orts.
With Regards,
Ganesh
Like (0)
Rudra Prasanna Mohapatra | Post author
June 16, 2015 at 4:05 pm
Thanks for the nice words 🙂
Like (0)
Former Member
June 18, 2015 at 5:39 am
Hi Rudra, Thanks for helping us out with this document. Keep it up.
Like (0)
Former Member
June 18, 2015 at 11:09 am
Hi Rudra,
Nice document and the way you presented is also good, helps functional guys for sure.
Thanks.
Regards,
KR
Like (0)
Former Member
July 2, 2015 at 5:45 pm
Hello All,
I have created a WIKI with debug tips for posting and clearing process. I hope that helps!Debug – Posting with
Clearing in Detail – ERP Financials – SCN Wiki
Regards,
Raquel
Like (0)
Former Member
July 6, 2015 at 9:47 am
Super Raquel..Your detailed understanding can be seen in your documentation.
Thanks.
Regards,
KR
Like (0)
Adityaz Febriandri
January 13, 2016 at 6:11 am
Awesome document Raquel ,… its very helpful
Like (0)
Former Member
July 16, 2015 at 3:11 pm
Hi Rudra,
Excellent document and explanation for debugging.
Great work.
Regards,
Venki
Like (0)
Former Member
October 30, 2015 at 6:15 am
Hi Rudra,
Thanks for sharing the document.
Regards
G Srinivas
Like (0)
Former Member
December 15, 2015 at 2:37 pm
Hi Rudra,
Very informative. Thanks for sharing.
Regards
Venkateshh
Like (0)
Former Member
January 1, 2016 at 10:13 pm
Nice document
Like (0)
Sattaiah Gundu
Satta a Gu du
January 4, 2016 at 1:04 pm
Good Document
Like (0)
Ajay Jawalkar
January 8, 2016 at 4:31 am
Hello Rudra,
Thanks for sharing! Very useful
Like (0)
Former Member
January 8, 2016 at 5:09 am
Very helpful for functional consultant.
Thanks for sharing it
Best Regards,
Chirag Panchal
Like (0)
Rudra Prasanna Mohapatra | Post author
January 8, 2016 at 10:16 am
Thanks all for your comments, I am glad that you are nding this helpful. 🙂
Regards
Rudra
Like (0)
Former Member
January 11, 2016 at 7:55 am
🙂 Thank you for sharing,good document.
Like (0)
Adityaz Febriandri
January 13, 2016 at 6:10 am
Great job Rudra,.. thanks it helps me a lot
Like (0)
Ajith Kumar
January 13, 2016 at 7:00 am
Thanks for sharing ,very informative especially for functional consultants.
Like (0)
Ritesh Ingale
January 15, 2016 at 6:39 am
Good e orts and help to learners.
Thanks
Like (0)
Former Member
January 17, 2016 at 8:35 am
Thanks a lot for sharing Rudra, that really helps
Like (0)
Rudra Prasanna Mohapatra | Post author
January 18, 2016 at 10:34 am
Thanks all for your nice comments.
Like (0)
Former Member
January 21, 2016 at 4:26 pm
Very nice description!
Like (1)
Valdimir Putin
July 10, 2017 at 5:45 am
Wonderful blog
Thanks
Like (1)
Former Member
March 18, 2018 at 1:26 pm
useful information for functional consultants
Like (0)
Rahul Patil
November 21, 2018 at 4:44 am
Very Resourceful, De-bugging understanding made easy.
Like (0)
AMOL NAMJOSHI
May 14, 2019 at 12:23 pm
Very Value added Information and thanks for sharing step by step process.
Like (0)
Share & Follow
Privacy Terms of Use
Legal Disclosure Copyright
Trademark Cookie Preferences
Sitemap
Newsletter