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

subrc

Former Member
0 Likes
353

what is check-subrc?example?

2 REPLIES 2
Read only

Former Member
0 Likes
330

Its nothing but same as if sy-subrc = 0.endif.

Normally you use check sy-subrc when you want to check any condition

performance wise sometimes they use this.

Read only

anversha_s
Active Contributor
0 Likes
330

hi,

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

so its like

if sy-subrc =

..

<b>but there is a diffrence.</b>

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

Regards

Anver