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

STOP and EXIT

Former Member
0 Likes
843

Dear Guys,

In ERP 2005, Stop statement is giving run time dump in programs.

But in 46C its working fine. can we replace EXIT command replacing STOP statement here. Please explain and suggest me.

Thanks.

Ambichan.

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
716

Hi ,

<b>1</b>.

<b>EXIT</b> Statement.

=====

<b>Within a loop</b>: The entire loop is terminated, and processing continues with the first statement following the loop.

<b>Outside a loop</b>: Terminates the current processing block.

<b>In a reporting event</b>: Jumps directly to the output list.

<b>2</b>.

<b>STOP</b> Statement.

====

Only occurs in event blocks for reporting events. Leaves the event block and goes to the END-OF-SELECTION block.

Now decide whether we can use STOP statement in LOOP or not.We should not use within loop thats y dump is coming.

I think it gives u clear idea.

<b>Thanks,

Venkat.O</b>

5 REPLIES 5
Read only

suresh_datti
Active Contributor
0 Likes
716

Hi,

it depends on where you put the EXIT.

If you use the STOP statement within an event block, the system stops processing the block immediately.If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block.

You can also try the key word LEAVE.

Regards,

Suresh Datti

Read only

vinod_gunaware2
Active Contributor
0 Likes
716

Use statement <b>LEAVE to SCREEN sy-dynnr.</b>

regards

vinod

Read only

venkat_o
Active Contributor
0 Likes
717

Hi ,

<b>1</b>.

<b>EXIT</b> Statement.

=====

<b>Within a loop</b>: The entire loop is terminated, and processing continues with the first statement following the loop.

<b>Outside a loop</b>: Terminates the current processing block.

<b>In a reporting event</b>: Jumps directly to the output list.

<b>2</b>.

<b>STOP</b> Statement.

====

Only occurs in event blocks for reporting events. Leaves the event block and goes to the END-OF-SELECTION block.

Now decide whether we can use STOP statement in LOOP or not.We should not use within loop thats y dump is coming.

I think it gives u clear idea.

<b>Thanks,

Venkat.O</b>

Read only

hymavathi_oruganti
Active Contributor
0 Likes
716

'STOP' The statement is only intended for use in the INITIALIZATION, AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It terminates the current processing block in an executable program and triggers the END-OF-SELECTION event. In all other processing blocks, or when you do not want to trigger the END-OF-SELECTION event, you must use EXIT.

Read only

Former Member
0 Likes
716

Hi,

Basic form EXIT.

Effect - Within a loop structure:

Terminates loop processing (DO, WHILE, LOOP, SELECT).

- Within subroutines and other modularization units (but not in a loop structure):

Leaves the subroutine or modularization unit (FORM, MODULE,FUNCTION, TOP-OF-PAGE, END-OF-PAGE).

- Outside loop structures and modularization units (report

processing):

Terminates report processing and triggers list display.

STOP.

This statement is not allowed in an ABAP Objects context.

STOP not allowed.

This statement terminates a processing block in an excutable program.

The statement is only intended for use in the INITIALIZATION,AT SELECTION-SCREEN, START-OF-SELECTION, and GET events.

It terminates the current processing block in an executable program and triggers the END-OF-SELECTION event. In all other processing blocks, or when you do not want to trigger the END-OF-SELECTION event, you must use EXIT.

Reward points if helpful,

Rgds,

Sumana