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

CHECK behaviour??

Former Member
0 Likes
851

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
788

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

6 REPLIES 6
Read only

Former Member
0 Likes
788

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

Read only

0 Likes
788

thanq

guess, the EXIT also bhaves the same.

So, then, pls. let the difference btwn CHECK and EXIT?

thanq

Read only

0 Likes
788

Exit doesnot check for any condition to exit the loop...whereas CHECK does.

Read only

Former Member
0 Likes
788

where ever you write the check , if the condition fails the subsequent lines after the check will not be executed.

Read only

Former Member
0 Likes
788

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

Read only

Former Member
0 Likes
789

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