‎2008 Mar 18 5:52 AM
‎2008 Mar 18 5:55 AM
Hi,
check is conditional,continue is non conditional.
DO 4 TIMES.
CHECK sy-index > 2.
WRITE sy-index.
ENDDO.
output:3 4
DO 4 TIMES.
IF not sy-index > 2.
CONTINUE.
ENDIF.
WRITE sy-index.
ENDDO.
output:3 4
rgds,
bharat.
‎2008 Mar 18 5:55 AM
Hi,
check is conditional,continue is non conditional.
DO 4 TIMES.
CHECK sy-index > 2.
WRITE sy-index.
ENDDO.
output:3 4
DO 4 TIMES.
IF not sy-index > 2.
CONTINUE.
ENDIF.
WRITE sy-index.
ENDDO.
output:3 4
rgds,
bharat.
‎2008 Mar 18 5:55 AM
Hi,
Check statement is like IF and EXIT combined. That is if check statement fails then it skips the programing code next..
Continue statement is used inside the loops if we want to again start the loop with the same record thus there is no exit..
Reward points!!!!!!!!!!
‎2008 Mar 18 5:55 AM
CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement.
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
CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one.
Example
DO loop: Omit an area (10 ... 20)
DO 100 TIMES.
IF SY-INDEX >= 10 AND SY-INDEX <= 20.
CONTINUE.
ENDIF.
...
ENDDO.
anya
‎2008 Mar 18 6:00 AM
Hi,
CHECK evaluates the subsequent logical expression. If it is true, the processing continues with the next statement.
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. Examples of loop structures are:
DO ... ENDDO
WHILE ... ENDWHILE
LOOP ... ENDLOOP
SELECT ... ENDSELECT
Note
Outside loops, a CHECK with a negative outcome will cause you to exit the current processing block (event block, dialog module, procedure). During the reporting event GET, the system terminates the processing of the current entry, read by the logical database, and processes the next entry in the current node of the logical database. Nodes that are subordinate in the hierarchical structure of the logical database are not processed.
SAP recommends that you only use CHECK within loops. Use the RETURN statement to exit processing blocks.
Within loop structures like
DO ... ENDDO
WHILE ... ENDWHILE
LOOP ... ENDLOOP
SELECT ... ENDSELECT
CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one.
Hope this is helpful.
Reward points if useful.
Regards,
Sowmya.