‎2007 Apr 10 10:09 AM
Hi all,
open dataset w_fname for input in text mode " get input data
message lw_msg. " any errors place here
if sy-subrc <> 0.
message i002 with lw_msg.
stop.
endif.
In the above code why the stop statement is required what does it mean there.Even if we don't give also after giving the message it will come out of the if endif.
‎2007 Apr 10 10:16 AM
Hi,
If you use the STOP statement within an event block, the system <b>stops processing the block immediately</b>. The ABAP runtime environment triggers the next event.
<i>So in your code it exits of the block in which the code is and moves to the next block.</i>
For ex:
From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement.
regards,
madhu
‎2007 Apr 10 10:16 AM
Hi,
If you use the STOP statement within an event block, the system <b>stops processing the block immediately</b>. The ABAP runtime environment triggers the next event.
<i>So in your code it exits of the block in which the code is and moves to the next block.</i>
For ex:
From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement.
regards,
madhu
‎2007 Apr 10 10:19 AM
hi,
The statement STOP is only to be used in executable programs and in the following event blocks:
AT SELECTION-SCREEN (without additions)
START-OF-SELECTION
GET
You leave these event blocks via STOP, and the runtime environment triggers the event END-OF-SELECTION.
regards,
veeresh
‎2007 Apr 10 10:22 AM
hi,
Cancels all data selection. No further tables are read.
Refer
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/stop.htm
this is from help
STOP
Syntax
STOP.
Effect
The statement STOP is only to be used in executable programs and in the following event blocks:
AT SELECTION-SCREEN (without additions)
START-OF-SELECTION
GET
You leave these event blocks via STOP, and the runtime environment triggers the event END-OF-SELECTION.
Note
The statement STOP is forbidden in methods and, since Release 6.10, leads to an uncatchable exception during the processing of screens called with CALL SCREEN and in programs not called with SUBMIT.
Example
Ending the event blocks GET sbook after max postings have been issued, and branching to END-OF-SELECTION.
NODES: sflight, sbook.
DATA: bookings TYPE i,
max TYPE i VALUE 100.
GET sflight.
WRITE: / sflight-carrid, sflight-connid, sflight-fldate.
GET sbook.
bookings = bookings + 1.
WRITE: / sbook-bookid, sbook-customid.
IF bookings = max.
STOP.
ENDIF.
END-OF-SELECTION.
ULINE.
WRITE: / 'First', bookings, 'bookings'.
Regards,
Santosh
‎2007 Apr 10 10:30 AM
Not onli comes out of the IF.. it comes out of the loop if any loops u have.. or it goes to END -OF-SELECTION event directly if u dont have any loop ...
regards,
sai ramesh