SAP Database

EXIT : ABAP Keyword a day

Print This Post Email This Post Written by admin on Jan 31st, 2008 | Filed under: ABAP Keywords

EXIT

Basic forms

1. EXIT.
2. EXIT FROM STEP-LOOP.
3. EXIT FROM SQL.

EXIT in loops and modularization units

Basic form
EXIT.
Effect
* In loop structures:
Leaves the loop processing (DO , WHILE , LOOP , SELECT )
* In subroutines and other modularization units (but outside loop structures):
Leaves the subroutine or modularization unit (FORM , MODULE , FUNCTION , TOP-OF-PAGE , END-OF-PAGE )
* Outside loop structures and modularization units (report processing):
Cancels the report processing and displays the list
Example
TABLES T100.
DATA SAP_COUNT TYPE I.
SELECT * FROM T100 WHERE SPRSL = SY-LANGU AND
ARBGB = 'DS'.
WRITE / T100-TEXT.
IF T100-TEXT CS 'SAP'.
ADD 1 TO SAP_COUNT.
IF SAP_COUNT = 3.
EXIT.
ENDIF.
ENDIF.
ENDSELECT.

Note
If there are several nested loops, the effect of EXIT is only to leave the current loop. Processing continues after the next END… statement in the next loop up.
Related CONTINUE , CHECK , REJECT , STOP

EXIT FROM STEP-LOOP

Basic form
EXIT FROM STEP-LOOP.
Effect
Leaves a step loop ( screen ). The current line and all subsequent lines are either not displayed ( PBO ) or not processed ( PAI ).

EXIT FROM SQL

Basic form
EXIT FROM SQL.
Effect
Leaves loop processing of the selected lines introduced by EXEC SQL PERFORMING form . Leaves the function form and cancels the processing of the block of code introduced by EXEC SQL and concluded by ENDEXEC .
Related EXEC SQL

If you like this post, you may as well like these too:

  1. DO : ABAP Keyword a day DO Variants 1. DO. 2. DO n TIMES. Variant 1 DO. Addition ... VARYING f FROM f1 NEXT f2 Effect Repeats the processing enclosed by the DO and ENDDO statements...
  2. CONTINUE: ABAP Keyword a day CONTINUEBasic formCONTINUE.EffectWithin loop structures like * DO ... ENDDO* WHILE ... ENDWHILE* LOOP ... ENDLOOP* SELECT ... ENDSELECTCONTINUE terminates the current loop pass, returns the processing to the beginning of...
  3. EXEC : ABAP Keyword a day EXEC Basic form EXEC SQL. Addition ... PERFORMING form Effect In contrast to Open SQL , addressed database tables do not have to be known to the ABAP/4 Dictionary...
  4. DESCRIBE : ABAP Keyword a day DESCRIBE Return attributes of a field - DESCRIBE FIELD f. Return attributes of an internal table - DESCRIBE TABLE itab. Determine distance between two fields - DESCRIBE DISTANCE BETWEEN f1...
  5. FETCH : ABAP Keyword a day FETCH Basic form FETCH NEXT CURSOR c target. Effect Uses the cursor c to read the next line or lines from the dataset of a database table determined by...



Leave a Reply

  • Help Support CRY