11. Control Statements Flashcards

1
Q

SY-FDPOS statement

A

Occurrence after certain operations on character-like or byte-like data objects (for example FIND or Comparisons). Is set after each string comparison. Depending on the type and outcome of the string comparison operation, SY-FDPOS is either set to the length of one string, or to the offset of one string within another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

CASE statement

A

The CASE statement is used to distinguish between mutually exclusive options. It is used when a single variable can take on one of several known values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

WHEN clause

A

Is used with the case statement. Each of the possible known values is specified in a WHEN clause, which heads a block of code to be executed when the variable takes on that value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

WHEN OTHERS clause

A

The WHEN OTHERS clause can be used to provide a default action if the variable does not equal one of the specified values. It is good programming practice to include a WHEN OTHERS clause in a CASE statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

DO loop

A

A DO loop is used to unconditionally execute a block of code multiple times. By default, a DO statement creates an infinite loop. Ref.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

it is possible to terminate a DO loop by issuing one of the following statements inside the loop

A

EXIT, STOP, or REJECT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

WHILE

A

a WHILE loop conditionally executes a block of code, possibly multiple times.
The WHILE statement must always be followed by a logical expression. Before each loop iteration (including the first), the logical expression is evaluated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SY-INDEX

A

The system variable SY-INDEX represents the index of the current loop pass (starting with 1 for the first loop pass). Outside a loop, SY-INDEX is zero.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CHECK statement- true

A

The CHECK statement is used to test a logical expression. If the logical expression of a CHECK statement evaluates to true, processing continues as if the CHECK statement was not there. If the logical expression of a CHECK statement evaluates to false, processing proceeds in one of three ways, depending on the context of the CHECK statement:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Check statement-false

A

If the logical expression of a CHECK statement evaluates to false, processing proceeds in one of three ways, depending on the context of the CHECK statement:
• If the CHECK statement is in a loop, control immediately returns to the top of the loop for
the next loop pass. If the loop was already in its last iteration, the loop terminates.
• If the CHECK statement is outside a loop but within a subroutine, the subroutine
immediately terminates, and control returns to the calling module.
• If the CHECK statement is outside a loop and outside a subroutine, the current
processing event immediately terminates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

EXIT statement

A

The EXIT statement unconditionally terminates a loop, subroutine, or program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

CONTINUE statement

A

The CONTINUE statement is used inside a loop. CONTINUE unconditionally returns control to the top of the loop for the next loop pass. If the loop was already in its last iteration, the loop terminates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

IF statement

A

The IF statement is used to ensure statements are executed only if certain conditions are met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly