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

Come out of loop in debugger

naveen_inuganti2
Active Contributor
0 Likes
10,531

Hi.,

While debugging, if we are inside the loop... How to come outside first line of that loop by excuting that loop?

Also how to come outside of that loop... without excuting that loop?

---Its in new debugger!

--Naveen Inuganti.

1 ACCEPTED SOLUTION
Read only

former_member217544
Active Contributor
5,560

Hi,

If you want to come outside the loop without executing then delete the internal table which you are doing loop in debugger mode. ( An option is available in debugger mode to delete the intertable table values).

And for coming outside the loop with executing the loop, you can follow the method suggested in above reply.

Regards,

Swarna Munukoti.

Hi.,

While debugging, if we are inside the loop... How to come outside first line of that loop by excuting that loop?

Also how to come outside of that loop... without excuting that loop?

---Its in new debugger!

--Naveen Inuganti.

25 REPLIES 25
Read only

Former Member
0 Likes
5,560

hi,

for coming out from a loop in debugging :

just set a break point on the immediate next statement of the loop and then press F8.

it will take you out from loop.

and for going to some line without executing just place the cursor on that line then go to debugger tab ==> go to statement.

hope it will help you

regards

rahul

Edited by: RAHUL SHARMA on Feb 2, 2009 9:28 AM

Read only

matt
Active Contributor
0 Likes
5,560

What kind of loop? LOOP AT, DO?

matt

Read only

0 Likes
5,560

Matt.,

Both...!?

--Naveen.I

Read only

Former Member
0 Likes
5,560

Hi Naveen,

You can come out of any loop by pressing F7.

Regards,

Nitin.

Read only

faisalatsap
Active Contributor
0 Likes
5,560

Hi, Naveen.

YOu just Need to Place the "STOP POINT" after the loop and than Press "F8".

And I think you canu2019t Skip Loop with out execution

Hope will help.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 2, 2009 1:31 PM

Read only

former_member217544
Active Contributor
5,561

Hi,

If you want to come outside the loop without executing then delete the internal table which you are doing loop in debugger mode. ( An option is available in debugger mode to delete the intertable table values).

And for coming outside the loop with executing the loop, you can follow the method suggested in above reply.

Regards,

Swarna Munukoti.

Read only

0 Likes
5,560

Hi,

Hope you all know about first screen of module pool programs, where we can't put break points...!

There we can have LOOPS....

If I am inside of loop here.... How can I come out of this loop?

See the following code..is from onwe standard program of SAP..

PROCESS BEFORE OUTPUT.
        MODULE STATUS_SETZEN_S.
        MODULE DYNPRO_KOPF_MODIF.
        MODULE AUSGLEICHS_VORSCHLAG.
        MODULE D0710_MODIF.
        module dynpro_sel_modif.                        
      LOOP.
        FIELD RF05A-XPOS1.
        FIELD RF05A-AZEI3.
        MODULE SEL_ANZEIGEN_AUSWAHL.
      ENDLOOP.

PROCESS AFTER INPUT.
        MODULE EXIT AT EXIT-COMMAND.
        MODULE PAI_ANFANG.
        MODULE GET_CURSOR.

*------- Konto, Buchungskreis ... --------------------------------------
        FIELD RF05A-AGKOA MODULE MC_OBJEKT_SETZEN1.
        FIELD RF05A-AGBUK MODULE MC_AGBUK_PARM_SETZEN.

*------- Vertrag ----------------------------------------------"contract
        chain.
          field rf05a-vertn.
          field rf05a-vertt.
          field rf05a-xulsd.
          field rf05a-agums.
          module clr_contract.
        endchain.

      CHAIN.
        FIELD RF05A-AGKON.
        FIELD RF05A-VERTN.
        FIELD RF05A-VERTT.
        FIELD RF05A-AGKOA.
        FIELD RF05A-AGUMS.
        FIELD RF05A-XNOPS.
        FIELD RF05A-AGBUK.
        FIELD RF05A-XMULK.
        FIELD RF05A-AVSID.
        FIELD RF05A-XINVS.                                        
        MODULE AUSGLEICHSDATEN.
      ENDCHAIN.

*------- ... weitere Konten ? ------------------------------------------
        FIELD RF05A-XMULK MODULE RF05A-XMULK ON INPUT.

      CHAIN.
        FIELD RF05A-XAUTS.
        FIELD RF05A-XFIFO.
        MODULE RF05A-XAUTS-XFIFO ON CHAIN-INPUT.
      ENDCHAIN.

*------- Weitere Suchkriterien -----------------------------------------
      LOOP.
        FIELD RF05A-XPOS1.
        FIELD RF05A-AZEI3.
        MODULE SEL_BEARBEITEN_AUSW.
      ENDLOOP.

      CHAIN.
        FIELD RF05A-AGKON.
        FIELD RF05A-VERTN.
        FIELD RF05A-VERTT.
        FIELD RF05A-AGKOA.
        FIELD RF05A-AGUMS.
        FIELD RF05A-XNOPS.
        FIELD RF05A-AGBUK.
        FIELD RF05A-XMULK.
        FIELD RF05A-XINVS.                                        
        MODULE SEL_PRUEFEN.
        MODULE FUSSZEILE_BEARBEITEN.
      ENDCHAIN.

PROCESS ON VALUE-REQUEST.
        FIELD RF05A-AGUMS MODULE F4_AGUMS.
        FIELD RF05A-AGKON MODULE F4_AGKON.
        FIELD RF05A-AVSID MODULE F4_AVSID.

--Naveen Inuganti.

Read only

0 Likes
5,560

Hi,

Yes, We can Delete the Records, from the Internal Table Using (Delete Table (FREE)).

But not Skip the Table execution with having Values in it i think.

Kind Regards,

Faisal

Read only

0 Likes
5,560

Hi...

For my above code if I try to move with SHIFT+F12 is wil get :

>Place the cursor on an excutable sourse code line

Or,

If i try to put break point out side of loop...

>Break points are not possible in screen debugging.

How to come out of loop?

--Naveen Inuganti

Read only

0 Likes
5,560

Hi, Naveen.

Yes, You just Place your Mouse Pointer on the statment where you want to jump and than Press "Shift + F12" it is working here very fine in this way,

I have tested.

Kind Regards,

Faisal

Read only

0 Likes
5,560

I too tested. Its not working in above case!

Thats why I pasted the error , which I am getting!

menu bar -- Debugger->Goto statement is not working in above case

--Thanks,

Naveen Inuganti.

Read only

0 Likes
5,560

Looks like you are trying to put a break-point on screen flow logic - PAI/PBO code

You can't put a break point there, try to put a break point within code of MODULE following the ENDLOOP statement and press F8 to come out of the loop.

Read only

0 Likes
5,560

shift f12 is not wroking in your system as u might not be having development rights in that particular system...

it happens that if you are not having proper development rights you can't even change the variable valur dynamically... mean while debugging... thats y u are not able to skip the execution

Read only

0 Likes
5,560

Vishnu wrote:

>You can't put a break point there, try to put a break point within code of MODULE following the >ENDLOOP statement and press F8 to come out of the loop.

How can i move inside of module... with out coming out from that LOOP.

Yadesh wrote:

>shift f12 is not wroking in your system as u might not be having development rights in that particular >system...

>

>it happens that if you are not having proper development rights you can't even change the variable valur >dynamically... mean while debugging... thats y u are not able to skip the execution

I am not changing any values in debuggung, even i need changes there is no need of development access key with in debugging mode.

--Naveen Inuganti.

Read only

0 Likes
5,560

i worked on some systems on which i was not having rights to change the valur while debugging....

to jump a line of code u need to do only shift+F12 on that particular line of code on which you want to jump...thats it...its working from last many months...in my system..

Read only

0 Likes
5,560

You can always switch to the old classic debugger and then set your break point.

Read only

0 Likes
5,560

Yadesh wrote:

>...its working from last many months...in my system..

Could please read my question and subsequent replies once.

I am not saying that SHIFT+F12 is not working in all cases!!!

I am talking about screen sourse code...that too I am looking for HOW TO COME OUT OF LOOP?

Okay?

If still you have doubt(Confidence) ...goto VA01 or any other screen enter some value now run next in debugging mode....!

You will get my QUESTION there!!

--Naveen Inuganti.

Read only

0 Likes
5,560

Hi.,

Maen...Thanks.,

Its working fine in Old debugger!

What about new debugger...it's not possible? I hope it can here too!

--Naveen Inuganti

Read only

0 Likes
5,560

As far as i know it's not possible in the new debugger. Hence why i switch to classic debugger in those cases.

Read only

0 Likes
5,560

>

> As far as i know it's not possible in the new debugger. Hence why i switch to classic debugger in those cases.

In my 7.1 system, it says something like "breakpoints aren't possible in screens at the moment" So I guess it might come eventually...

matt

Read only

Former Member
0 Likes
5,560

To come outside a loop without executing it...

place the cursor to the next statement after endloop.

den enter SHIFT+F12 ( Menu : Debugger->Goto Statement)

Read only

0 Likes
5,560

Hi, TT

Yes it is working Thanks you Very Much..

Thanks and Kind Regards,

Faisal

Read only

Former Member
0 Likes
5,560

To skip the first item of the loop you can put a watchpoint on

sy-tabix = 2

since sy-tabix = 2 represents 2 line, you can of course skip to any line this way, by just giving its number.

To come out of the loop altogether you can put a break point on a statement following ENDLOOP.

Read only

Former Member
0 Likes
5,560

To exit out of a loop In Debugging:

> by executing the loop:

1) Press F7 and it will execute the loop and control will come at the first statement immediately after the loop.

2) Put a breakpoint at the statement immediately after the loop, and Press F8.

> without executing the loop:

1) Use the GOTO statement (in the Menu options).

2) or you can also delete the entries in internal table that is populated by the loop in question. (this will not work if the internal table is being modified in the loop)

Hope this works. Revert in case of any clarifications reqd.

Read only

Former Member
0 Likes
5,560

Hi,

F7 function key to come out of the current loop.

regards

Md.MahaboobKhan