cancel
Showing results for 
Search instead for 
Did you mean: 

case manage ment

Former Member
0 Kudos

hai sir

i want to know abt case manage ment...tel me abt this plz

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Venu,

The CASE Control Structure

This control structure is introduced with the CASE statement. The CASE control structure allows you to control which statement blocks are processed based on the contents of a data object.

CASE <f>.

WHEN <f11> [OR <f 12> OR ...].

<Statement block>

WHEN <f21>.[OR <f 22> OR ...]

<Statement block>

WHEN <f31> [OR <f 32> OR ...].

<statement block>

WHEN ...

......

WHEN OTHERS.

<statement block>

ENDCASE.

The statement block following a WHEN statement is executed if the contents of <f> are the same as those of one of the fields <f ij >. Afterwards, the program carries on processing after the ENDCASE statement. The statement block after the optional WHEN OTHERS statement is executed if the contents of <f> does not equal any of the <f ij > contents. The last statement block must be concluded with ENDCASE.

The CASE control structure is a shortened form of the following IF structure:

IF <f> = <f11> OR <f> = <f 12> OR <f> = ...

<Statement block>

ELSEIF <f> = <f21> OR <f> = <f 22> OR <f> =...

<Statement block>

ELSEIF <f> = <f21> OR <f> = <f 22> OR <f> =...

<statement block>

ELSEIF <f> = ...

...

ELSE.

<statement block>

ENDIF.

You can nest CASE control structures and also combine them with IF structures. However, they must always end with an ENDCASE statement within the current processing block.

DATA: TEXT1 VALUE 'X',

TEXT2 VALUE 'Y',

TEXT3 VALUE 'Z',

STRING VALUE 'A'.

CASE STRING.

WHEN TEXT1 OR TEXT2.

WRITE: / 'String is', TEXT1, 'OR', TEXT2.

WHEN TEXT3.

WRITE: / 'String is', TEXT3.

WHEN OTHERS.

WRITE: / 'String is not', TEXT1, TEXT2, TEXT3.

ENDCASE.

The output is:

String is not X Y Z

Here, the last statement block after WHEN OTHERS is processed because the contents of STRING, ‘A’, does not equal ‘X’, ‘Y’, or ‘Z’.

Kindly Reward Points If You Found The Reply Helpful,

Cheers,

Chaitanya.

Former Member
0 Kudos

this is not the correct forum for your question.