Professional Documents
Culture Documents
04 Control Techniques
04 Control Techniques
Objectives
OUTPUT:
The following logical expressions are true:
1.000000000000000E+02 >= 50.00
30 NE
50.00
Loops
Terminating Loops
Syntax
IF <condition1>.
<statement block>
ELSEIF <condition2>.
<statement block>
ELSEIF <condition3>.
<statement block>
.....
ELSE.
<statement block>
ENDIF.
Syntax
CASE <f>.
WHEN <f1>.
<statement block>
WHEN <f2>.
<statement block>
WHEN <f3>.
<statement block>
WHEN ...
......
WHEN OTHERS.
<statement block>
ENDCASE.
DO
Write sy-index.
If sy-index = 3.
Exit.
Endif.
ENDDO.
Output:
1
Purpose
Terminating a Loop Pass Unconditionally
Terminating a Loop Pass Conditionally
Terminating a Loop Entirely
SUMMARY
Comparison statements are IF and CASE.
Comparison operators like EQ,NE,LT,LE,GT,GE are used
for comparing all field types.
Special operators like CO,CN.CA,NA,CS,NS,CP and NP are
used
for comparing strings
Conditional branching using CASE is shorter form of similar
processing with IF
The loop statements are do and while.
sy-index always contains the counter for the current loop
pass. After the loop is finished, its value is reset to the value
it had when the loop began. Although you can change syindex, its value is reset with the next pass of the loop .
SUMMARY
Use the exit, continue, and check statements to modify
loop processing.
immediately
Zxxxxxxx
Zxxxxxxx
for EXIT
statement
Thank You