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
416

define check statement how it works

3 REPLIES 3
Read only

Former Member
0 Likes
390

Hi,

its just a check statement which returns the expression given is true or false.

CHECK log_exp.

Effect

If the statement CHECK is executed in a loop and log_exp is incorrect, the statement CHECK immediately terminates the current loop pass and the program continues with the next loop pass. For log_exp, you can specify any logical expression.

Variant 1

CHECK log_exp.

Effect

If the statement CHECK is executed outside a loop and log_exp is incorrect, the statement terminates the current process block. You can specify any logical expression for log_exp.

The behavior of the runtime environment after exiting the processing block is described under Exiting Processing Blocks.

Note

SAP recommends to use this procedure with the statement CHECK only inside loops (see CHECK - Loop).

Variant 2

CHECK SELECT-OPTIONS.

Effect

In this way, you can use CHECK only in event blocks for reporting events GET but not in methods. Regardless of whether the statement is executed inside or outside a loop, the effect is the same.

The statement checks whether the content of theinterface working area that was filled for the the current GET event by the logical database fullfills the conditions in all selection tables that are associated with the current node of the logical database. The name of the node is statically taken from the next highest GET statement in the program. The following restrictions apply:

The statement CHECK SELECT-OPTIONS is only executed when the type of the current node of the logical database is a database table.

If the node is to be used for unlimited selections, the statement only evaluates the selection criteria that have been declared with the extension NO DATABASE SELECTION of the statement SELECT-OPTIONS.

If the conditions in one of the selection tables are not fullfilled, the GET event block is exited. The behavior of the runtime environment is described under Exiting Processing Blocks.

<b>*Reward points</b>

regards

Read only

Former Member
0 Likes
390

Hi,

Conditional termination of a loop pass or a processing block.

Syntax

CHECK <logexp>.

If the logical expression <logexp> is true, the program continues at the next statement. If,

however, <logexp> is false, the current loop pass terminates and the next begins. If the program

is not currently processing a loop, the current processing block terminates. There are special

forms of the CHECK statement for use with selection tables and in GET event blocks.

ex.

CHECK: WA_SPFLI-CARRID IN S_CARRID,

WA_SPFLI-CITYFR IN S_CITYFR,

WA_SPFLI-CITYTO IN S_CITYTO,

SPFLI-CONNID IN S_CONNID.

Regards,

Bhaskar

Read only

Former Member
0 Likes
390

hi

thanks to all for responding to my query

regards

suri