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

Loop Level

Former Member
0 Likes
855

Hi Gurus,

Would there be a functionality in Debug mode, if let say you have 3 loop within loops... and you want to know what level in the loop you are in?

E.G.

Loop at table

Loop at table

Loop at table

You are here

Endloop

Endloop

Endloop

Thanks!!!!

Benedict

8 REPLIES 8
Read only

Former Member
0 Likes
800

from the debugger line itself you can see what code is running.

and any ways. in new front end editor in SE38 shows you at what level you are in.

Read only

0 Likes
800

Hi,

Thanks for the reply. My issue here is that, there are lots of subroutines were called. And I want to know if I am still under a loop.

Thanks.

Benedict

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
800

Hi,

Refer:-


DATA : lv_text(10) TYPE c.

LOOP AT <itab>.
  lv_text = 'Loop 1'.
  LOOP AT <itab>.
    lv_text = 'Loop 2'.
    LOOP AT <itab>.
      lv_text = 'Loop 3'.
    ENDLOOP.
  ENDLOOP.
ENDLOOP.

CLEAR lv_text.

Use this lv_text to know in which loop you are currently in.

Hope this helps you.

Regards,

Tarun

Read only

0 Likes
800

see. if you want it in debugger level then its there.

in the debugger screen(advanced debugger) there is a level area which shows the scope.

this shows the scope of a particular line where the debugger cursor is currently lying.

say some example.

REPORT  zsomu_1.

DATA : gt_v TYPE STANDARD TABLE OF vbak WITH HEADER LINE.

gt_v-vbeln = '0030003445'.
APPEND gt_v.

LOOP AT gt_v.
  LOOP AT gt_v.
    LOOP AT gt_v.
      WRITE: gt_v-vbeln.  " here you have kept the break point and debugger triggers here.
    ENDLOOP.
  ENDLOOP.
ENDLOOP.

so when debugger starts.

below the program lines you will find (when your cursor is on the 'WRITE STATEMENT')

SCOPE \LOOP\LOOP\LOOP

i hope this answers your question.

thanks

Somu

Read only

0 Likes
800

Hi All,

As I have said, we are using subroutines...

form f_loop.

loop at t_tab into w_tab.

perform f_loop_2.

endloop.

endform.

form f_loop_2.

loop at t_tab into w_tab.

perform f_loop_3.

endloop.

endform.

form f_loop_3.

loop at t_tab into w_tab.

...

endloop.

endform.

and the status that you have mentioned only tells me where i am and not on how deep i am in the loop of the whole program.

status:

when in subroutine f_loop

Scope \FORM f_loop\LOOP

when in subroutine f_loop_2

Scope \FORM f_loop_2\LOOP

Thanks.

Benedict

Read only

0 Likes
800

Hi,

This is possible with NEW (advanced debugger). Did u try my approach already?

Regards,

Manne.

Read only

0 Likes
800

Hi Raja,

I am using the new advanced debugger and still the same.

Thanks.

Benedict

Read only

Former Member
0 Likes
800

Hi,

If you have a new debugger, switch to it and then place the cursor on the link that you want to see scope in debugging mode, then scope of that statement appears in the FOOTER row of the debugger as below.

Scope \FUNCTION GET_DDIC_FIELD_INFO\IF\LOOP\LOOP\LOOP 

      "where GET_DDIC_FIELD_INFO is the function name you are debugging.

Regards,

Manne.