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 statement

Former Member
0 Likes
19,363

where we r using check statement exactly?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
7,597

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

8 REPLIES 8
Read only

Former Member
0 Likes
7,598

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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

Read only

Former Member
0 Likes
7,597

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