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

abap debugger

Former Member
0 Likes
4,340

hi,

   i have to debug a 10k lines of code which will take an hour to execute,nd  i want to debugg for a pirticular itab values in different parts of code, what i did is i put break points in the required places (ex:at line 150 nd line3000).when i execute first break point reached nd again i press f7 r f8 controll is going back to first break point only.if i remove the first break point after execution of that line,it is takin more than 30 mins to reach the next break point.is there anyway to do it fast.i.e moving from one break point to another .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,376

Hi

In debug mode use the continue to cursor (shift+f8) i hope it will use for that time  .

Regards

Mahesh

17 REPLIES 17
Read only

Former Member
0 Likes
3,377

Hi

In debug mode use the continue to cursor (shift+f8) i hope it will use for that time  .

Regards

Mahesh

Read only

Former Member
0 Likes
3,376

Dear Krishna,

If you are putting break point in the loop then it will take time to reach 2nd break point

try to put break point after loop or before loop.

regards

Yogesh

Read only

Former Member
0 Likes
3,376

Hello Krishna,

Start your program in debug mode. And use ' goto statement ' option to reach directly at your desired point.

sometimes it is possible and sometimes not....just check with your case.

Hope it work.

Regards,

Sudhir Kothavale.

Read only

0 Likes
3,376

what is the difference b/w 'goto statement' and ' continue to cursor' .in debugger

Read only

0 Likes
3,376

GOTO STATEMENT : the execution will jump to the mouse cursor in the program

CONTINUE : it will go the next break point

Eg : if u executed the program upto  100 lines. if u want to go back to line no. 50 u can place cursor there in 50th line and press goto statement. The control will go to 5o th line..

Read only

0 Likes
3,376

This message was moderated.

Read only

0 Likes
3,376

This message was moderated.

Read only

0 Likes
3,376
Read only

former_member209696
Participant
0 Likes
3,376

Dear Krishnasree,

     U already mentioned the over all program execution is taking 1 hour time. So it may take 30 min to reach the next break point. Check your codes and improve the peformance by following the coding standards...check following points..

  • Avoid ‘SELECT *’ instead of use select with fields.
  • Avoid nested Select statements
  • Replace nested loop with parallel cursor
  • When using ‘FOR ALL ENTRIES’ delete duplicate entries from driver table and sort the driver table
  • TYPE (data element) command is used while declaring the fields whenever feasible instead of LIKE.
  • Internal Table is defined with “TYPE STANDARD TABLE OF” & Work-Areas is used instead of header lines
  • Global variables are minimized by declaring local variables or by passing variables through parameters & arguments while creating internal subroutine(s)
  • In SELECT statement, only the required fields are selected in the same order as they reside on the database table/structure/view
  • For selecting single row from a database table, “SELECT UP to 1 Rows” is used. “Select Single” is used only when full primary key combination is known
  • Use “SELECT INTO TABLE” rather than “SELECT INTO CORRESPONDING FIELDS OF TABLE”
  • Always specify as many primary keys as possible in WHERE clause to make the Select efficient
  • Always select into an internal table, except when the table will be very large (i.e., when the internal table will be greater than 500,000 records). Use “Up to N Rows” when the number of records needed is known
  • Nested Select is not used instead “Inner Join” and/or “For all Entries” is used. “For all Entries” is to be used over “Loop at ITAB / Select / ENDLOOP” (FOR ALL ENTRIES retrieves a unique result set so ensure you retrieve the full key from the database)
  • CHECK that the internal table used in FOR ALL ENTRIES is NOT empty as this will retrieve all entries from the table
  • For copying internal tables use ‘=’ operator instead of Looping & Appending
  • SORT inside a LOOP is not used
  • Sort internal table by fields in the correct order, which are used in a READ TABLE statement using BINARY SEARCH. If the order of sorting is invalid the BINARY SEARCH will never work
  • Fields specified in the WHERE condition with the critical operators NOT and <> (negative SQL statements) cannot be used for a search using database indexes. Whenever possible formulate SQL statements positively
  • When coding IF or CASE, testing conditions are nested so that the most frequently true conditions are processed first. Also CASE is used instead of IF when testing multiple fields “equal to” something
  • LOOP AT ITAB INTO WORKAREA WHERE K = ‘XXX’ should be used instead of LOOP AT ITAB INTO WORKAREA / CHECK ITAB-K = ‘XXX’.
  • After the APPEND statement inside a loop, the work area that has been appended is cleared
  • Internal tables, Work areas & Global Variables are freed when no longer needed (e.g. using the FREE / REFRESH command), especially when the tables are large or the program is a batch program
  • Do not delete the records of internal table inside the Loop – End loop.
  • Use the MODIFY ITAB ... TRANSPORTING f1 f2 ... for single line, and MODIFY ITAB ... TRANSPORTING f1 f2 ... WHERE condition for a set of line, to accelerate the updating of internal table
  • If possible, Update/Insert statement is used instead of Modify
  • Avoid the aggregate (Count, Max, Min) functions in the database selection
  • Remove unnecessary code and redundant processing
  • Instead of using the move-corresponding clause it is advisable to use the move statement instead
  • Use of control break events in loop statements which have a Where Clause is not recommended
  • Use ABAP sort over ORDER BY
  • Modifying a group of lines. Do not loop at all the records, rather use the MODIFY statement on the internal table as a whole
Read only

Former Member
0 Likes
3,376

Hi Krishna,

As an alternative, put '/H' and then execute. When you enter in, in the new debugger, put a break point for Message. You have such an option. So you code will then stop at the lines that contain 'Message'.

I generally debug like this and it helps. Try and let me know if this helps you too!

Read only

Former Member
0 Likes
3,376

Hi,

You can use watchpoints. Thats the best thing you can do.

Please do let us know if still you are facing the issue.

Regards

Purnand

Read only

adam_krawczyk1
Contributor
0 Likes
3,376

Hi Krishna,

You wrote:

"i want to debugg for a pirticular itab values in different parts of code"

If you want to stop in case of particular value is set to variable, please try to use watchpoint. It is feature that allows you to stop in the code, in case when variable reaches expected value.

Proposed steps:

1. Set breakpoint in some of the first lines of program

2. Go to menu Breakpoints -> Create watchpoint

3. Type the name of structure and its component (column) and provide value in condition that you expect, like below:

Then your program will stop when ls_table_line reaches values that you want. You can define own WHERE condition criteria, define many watchpoint for different variables.

  • You can mix breakpoints with watchpoint (like set watchpoint after some breakpoint is reached).
  • You can use check for sy-tabix to stop when particular table row is read.
  • You can even make watchpoint that checks if internal table content has changed - just put lt_table[], or even single row of the table (it must already exist) - lt_table[1].
  • I think It is not possible to create watchpoint on any row in the table that column has specific value, that is why I used structure ls_table_line above as example for watchpoint.

Hope it helps.

Regards,

Adam

Read only

0 Likes
3,376

Hi,

Please try to add some new points. The point you mentioned has already been told.

Regards

Purnand

Read only

0 Likes
3,376

Hi Purnand,

I agree with you, we should not repeate solutions that were already proposed as it is waste of time for others. On the other hand, not everyone knows how to add watchpoint for internal tables monitoring so I just prepared ready answer for the author.

As you can see my post is right behind yours, we started at similar time and I have not seen your post before mine. I just spent more time on editing and preparing content

Regards,

Adam

Read only

0 Likes
3,376

Then its ok

Read only

bishwajit_das
Active Contributor
0 Likes
3,376

Hi Krishna,

I just want to let you know that:-

Your code needs to be properly optimised so that the execution time is minimum to debug.

And one more thing is a standard debuger can be active for 600secs.

Thanks,

Bishwajit.

Read only

Former Member
0 Likes
3,376

This message was moderated.