‎2008 Jul 14 2:28 PM
‎2008 Jul 14 2:29 PM
Hi,
we use check statement to come out of a iteration or an event block.
for details check the link with process diagram
[http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9afe35c111d1829f0000e829fbfe/content.htm]
Regards,
Anirban Bhattacharjee
‎2008 Jul 14 2:29 PM
Hi,
we use check statement to come out of a iteration or an event block.
for details check the link with process diagram
[http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9afe35c111d1829f0000e829fbfe/content.htm]
Regards,
Anirban Bhattacharjee
‎2008 Jul 14 2:30 PM
hi,
If we donot want to process the code below it if some criteria fails then we use check statement ...
Check out the below link for reference
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/check.htm
Regards,
Santosh
Edited by: Santosh Kumar Patha on Jul 14, 2008 7:00 PM
‎2008 Jul 14 2:30 PM
Hi,
There are different consequences if you use CHECK Statement in between Different Statement(LOOP ...ENDLOOP,DO...ENDO) of program
Just Go through the link,Here is Detail description of the uses of CHECK Satement.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9afe35c111d1829f0000e829fbfe/content.htm
Hope it will help you understanding the concept.
Regards.
Sujit
‎2008 Jul 14 2:32 PM
Hii!
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.
You can use the REJECT statement to exit the reporting event GET conditionally.
Regards
Abhijeet
‎2008 Jul 14 2:33 PM
Hi Vinay,
CHECK <expr> statement within an event block but not within a loop, and the condition <expr> is not fulfilled, the system exits the processing block immediately.
Regards,
Chandra Sekhar
‎2008 Jul 14 2:41 PM
Check this link for a clear understanding...
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9ad735c111d1829f0000e829fbfe/frameset.htm
<removed_by_moderator>
Regards,
Sinu.
Edited by: Julius Bussche on Jul 14, 2008 1:58 PM
‎2008 Jul 14 2:52 PM
Hi vinay,
Check statement:
To terminate a single loop pass conditionally, use the CHECK <condition> statement in the statement block of the loop.
If the condition is not true, any remaining statements in the current statement block after the CHECK statement are ignored, and the next loop pass starts. <condition> can be any logical expression.
Regards,
Sravanthi
‎2008 Jul 14 3:28 PM
Hi Vinay.
I would like to suggest,
Check statement - when we use CHECK statement in a processing block and condition is not fulfilled, we consider cases -
CHECK W/O LOOP -
> Terminates the processing block and exits.
CHECK WITH LOOP -
> Terminates only the loop, but not the processing block.
[SDN - Reference for Check statement|;
[SAP HELP - Reference for CHECK statement in processing block|http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9afe35c111d1829f0000e829fbfe/frameset.htm]
[SAP HELP - Reference for CHECK statement in Unconditional loops|http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3564358411d1829f0000e829fbfe/frameset.htm]
Hope that's clear.
Good Luck & Regards.
Harsh Dave