Download - 5oops5

Transcript
Page 1: 5oops5

report  z745oops5. Importing parameters in Local class methods (OPTIONAL KEYWORD)class abc definition.  public section.   methods : m1 importing x type i optional  y type c optional,             m2.  protected section.      data : empno type i,             ename(20) type c.endclass.

class abc implementation.  method m1.     empno = x.     ename = y.  endmethod.

  method m2.    write :/ empno,ename.  endmethod.endclass.

start-of-selection.data ob type ref to abc.create object ob.

parameters : p_x type i,             p_y(20) type c.

call method ob->m1exporting   x = p_x   y = p_y.

call method ob->m2.

uline.ob->m1( exporting x = p_x y = p_y ).ob->m2( ).

Page 2: 5oops5

uline.ob->m1( x = p_x y = p_y ).ob->m2( ).