If..Elseif..Endif
Ex :
Steps :
- Go to transaction code SE38.
- Enter the program name Z or Y<program name>
- Select attribute type as Executable program.
- Click on Save.
Source Code
PARAMETERS : color TYPE I.
IF COLOR = 1.
WRITE 'COLOR 1 ' COLOR 1.
ELSEIF COLOR = 2.
WRITE 'COLOR 2 ' COLOR 2.
ELSEIF COLOR = 3.
WRITE 'COLOR 3 ' COLOR 3.
ELSEIF COLOR = 4.
WRITE 'COLOR 4 ' COLOR 4.
ELSEIF COLOR = 5.
WRITE 'COLOR 5 ' COLOR 5.
ELSEIF COLOR = 6.
WRITE 'COLOR 6 ' COLOR 6.
ELSEIF COLOR = 7.
WRITE 'COLOR 7 ' COLOR 7.
ENDIF.
IF COLOR = 1.
WRITE 'COLOR 1 ' COLOR 1.
ELSEIF COLOR = 2.
WRITE 'COLOR 2 ' COLOR 2.
ELSEIF COLOR = 3.
WRITE 'COLOR 3 ' COLOR 3.
ELSEIF COLOR = 4.
WRITE 'COLOR 4 ' COLOR 4.
ELSEIF COLOR = 5.
WRITE 'COLOR 5 ' COLOR 5.
ELSEIF COLOR = 6.
WRITE 'COLOR 6 ' COLOR 6.
ELSEIF COLOR = 7.
WRITE 'COLOR 7 ' COLOR 7.
ENDIF.
Comments
Post a Comment