Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Advanced debugging feature

manish_malakar0316
Active Participant
0 Likes
3,724

Hi,

I have a couple of queries regarding some advanced debugging features in ABAP. I tried searching in the forum, but unfortunately I didnt get any blog regarding my kind of scenario.

Most of the times in my project, abapers need to debug in production to find the root cause of the issue. Now many developers dont have authorization in the production environment to use command like "Goto statement" by which we can go back or skip a few lines of the code to see what happens.

Scenario 1)

In the production server, since I cannot use "Goto statement" due to no authorization, how can I use the "breakpoint at" command to directly keep my breakpoint at line 682 instead of going line by line using "/h" command ?

I tried it myself, but I do not know what inputs I need to put in the below screen in the source code tab :

Scenario 2:

I have an internal table where I need to check the condition types in it. When I do a ctrl+f with the condition type 'ZD06' for column KSCHL, it shows that in row 13 it exists.

But when I scroll down, there is also another record which exists in line 162 for the same condition type:

So , in the above case, do I need to create watchpoints to check multiple values in the internal table or is there any other way to figure this out ?

Regards,

Manish

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
3,453

S1 (breakpoint at source code): there are two screen frames, one for ABAP source code, and one for dynpro source code. So, for defining a breakpoint at line number 682 of the ABAP code, enter 682 in the ABAP screen frame, not in the dynpro frame! Now, you should be authorized to display the ABAP source code via transaction SE38 and set the breakpoint directly via the ABAP editor.

S2: your question is unclear. Do you want to stop when a line is added or modified in internal table HKOMV which has column KSCHL = 'ZD06' ? If so, then either you find a strategy by yourself, or you create a debugger script which is triggered each time HKOMV is changed, the script should read the statement, determine the variable which contains the line and stop only if KSCHL is 'ZD06' (script not obvious to write for newbies).

10 REPLIES 10
Read only

matt
Active Contributor
0 Likes
3,453

Why can't you just set a breakpoint at line 682?

Read only

DoanManhQuynh
Active Contributor
3,453

S1: Not sure what authorization you have but if you can go into source code, you also can goto the line you want to debug and set break-point there, within a custom report i dont think its too hard to do, not to say easier than find the solution for goto statement...

S2: i think there only option to set watch point.

Read only

manish_malakar0316
Active Participant
0 Likes
3,453

matthew.billingham I can, but I just need to know for my knowledge, that in case I come across a standard program that I need to debug and I know where the issue might be, how can I put a breakpoint there by using the "breakpoint at" statement . What inputs do I need to enter in that case.

Read only

manish_malakar0316
Active Participant
0 Likes
3,453

@Quynh Doan Manh I know that. But as I explained in the above comment, I need to know what inputs I can put if I need the "breakpoint at" command. Its for my own knowledge as I cant find any documentation or blog posts regarding these features. I need them as I have to debug many standard programs in the production server and I dont want to check them line by line as it is very time consuming. My scenario1 was just an example .

Read only

matt
Active Contributor
0 Likes
3,453

Well, in 20 years of ABAP debugging, the only time I've used breakpoint at is for authority check. I've never needed to.

For 2, possibly set a watchpoint for when sy-tabix = 162

Read only

manish_malakar0316
Active Participant
0 Likes
3,453

So, in case I need to debug standard programs in the production server, I have no other option but to go line by line ? Do you know any way I can jump to certain commands/FMs,forms etc. using the "breakpoint at" command and their inputs ? I only found blogs regarding checking of messages and authority check.

https://archive.sap.com/documents/docs/DOC-53035

https://blogs.sap.com/2014/03/19/how-to-analyze-authorization-issues-in-debug/

Read only

Sandra_Rossi
Active Contributor
3,454

S1 (breakpoint at source code): there are two screen frames, one for ABAP source code, and one for dynpro source code. So, for defining a breakpoint at line number 682 of the ABAP code, enter 682 in the ABAP screen frame, not in the dynpro frame! Now, you should be authorized to display the ABAP source code via transaction SE38 and set the breakpoint directly via the ABAP editor.

S2: your question is unclear. Do you want to stop when a line is added or modified in internal table HKOMV which has column KSCHL = 'ZD06' ? If so, then either you find a strategy by yourself, or you create a debugger script which is triggered each time HKOMV is changed, the script should read the statement, determine the variable which contains the line and stop only if KSCHL is 'ZD06' (script not obvious to write for newbies).

Read only

0 Likes
3,453
Manish Malakar:S2: okay, so you just want to use Ctrl+F in the variable and it worked only for the first occurrence, the second search did not find the second occurrence. You should check SAP notes, then open a ticket at SAP support.
Read only

manish_malakar0316
Active Participant
0 Likes
3,453

sandra.rossi S1: Yes, you are correct. I had to put the line number in the ABAP frame, not the dynpro frame. Thanks.

S2: I wanted to know if I can find out in which lines (rows) will I get successful hits for KSCHL = 'ZD06'. On doing a ctrl+f, it was pointing to only 1 row and after I did another ctrl+f, it didnt go to row 162. So is that done using scripts as you mentioned ? Then I need to research what debugger scripts are. My main objective was to know in how many lines will I get successful hits for the condition type ZD06.

Read only

3,453

Please don't create an ANSWER to reply to someone. ANSWER is reserved for proposing a solution.