Saturday, January 14, 2012

If elseif statement example in sap abap


REPORT demo_flow_control_if .

DATA: text1(30) TYPE c VALUE 'This is the first text',
      text2(30) TYPE c VALUE 'This is the second text',
      text3(30) TYPE c VALUE 'This is the third text',
      string(5) TYPE c VALUE 'eco'.

IF text1 CS string.
  WRITE / 'Condition 1 is fulfilled'.
ELSEIF text2 CS string.
  WRITE / 'Condition 2 is fulfilled'.
ELSEIF text3 CS string.
  WRITE / 'Condition 3 is fulfilled'.
ELSE.
  WRITE / 'No condition is fulfilled'.
ENDIF.

No comments:

Post a Comment