‎2008 Jun 10 7:29 PM
Hi Experts,
Pls. clarify my basic doubt that, Wht is CHECK behaviour in the folllowing scenarios?
1) LOOP
check not my_itab[] is initial.
endloop.
2) form_1
check not my_itab[] is initial.
endform.
3) Main Prog. blocks
check not my_itab[] is initial.
logic...
4) Is END-OF-SELECTION triggers, if CHECK is true i.e. my_itab does hv records?
1) IF
check not my_itab[] is initial.
endif.
thanq
‎2008 Jun 10 8:05 PM
hi,
EXIT works similar to CHECK except that it doesn't check a given condition. Usually you would place it in some IF ENDIF clause. In a Loop and endloop statement exit comes out of the loop where the check continues to check the condition for the next record ignoring the code below the check statement...
Regards,
Santosh
‎2008 Jun 10 7:35 PM
CHECK evaluates the subsequent logical expression . If it is true, the processing continues with the next statement.
In loop structures like
DO ... ENDDO
WHILE ... ENDWHILE
LOOP ... ENDLOOP
SELECT ... ENDSELECT
CHECK with a negative outcome terminates the current loop pass and goes back to the beginning of the loop to start the next pass, if there is one.
In structures like
FORM ... ENDFORM
FUNCTION ... ENDFUNCTION
MODULE ... ENDMODULE
AT
CHECK with a negative outcome terminates the routine or modularization unit.
If CHECK is not in a loop or a routine or a modularization unit, a negative logical expression terminates the current event. In contrast, the statement REJECT terminates the current event, even from loops or subroutines.
Regards,
Santosh
‎2008 Jun 10 7:53 PM
thanq
guess, the EXIT also bhaves the same.
So, then, pls. let the difference btwn CHECK and EXIT?
thanq
‎2008 Jun 10 8:00 PM
Exit doesnot check for any condition to exit the loop...whereas CHECK does.
‎2008 Jun 10 7:35 PM
where ever you write the check , if the condition fails the subsequent lines after the check will not be executed.
‎2008 Jun 10 8:01 PM
Check is nothing but in other terms if ...endif.
so no where it is equal to exit ...
now you can find the difference...do you
‎2008 Jun 10 8:05 PM
hi,
EXIT works similar to CHECK except that it doesn't check a given condition. Usually you would place it in some IF ENDIF clause. In a Loop and endloop statement exit comes out of the loop where the check continues to check the condition for the next record ignoring the code below the check statement...
Regards,
Santosh