Saturday, January 14, 2012

case endcase statement example in sap abap


REPORT demo_flow_control_case .

DATA: text1   TYPE c VALUE 'X',
      text2   TYPE c VALUE 'Y',
      text3   TYPE c VALUE 'Z',
      string  TYPE c 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.

2 comments: