Monday, April 14, 2014

ABAP - Case Statement



  REPORT  ZMYSAPLIBRARY.

parameters :  type i,
              y type i,
              ch type i.

data type i.

case ch.
  when 1.
    + y.      write :'Sum is ',z.
  when 2.
    y.      write :'Difference is ',z.
  when 3.
    * y.
    write :'Product is ',z.
  when 4.
    / y.      write :'Division is ',z.
  when others.
    write :'Invalid choice, please enter 1,2,3,4'.
endcase.

No comments:

Post a Comment