Vous êtes sur la page 1sur 2

report z745oops5.

Importing parameters
in Local class methods (OPTIONAL KEYWORD)
class abc definition.
public section.
methods : m1 importing x type i 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->m1
exporting
x = p_x
y = p_y.
call method ob->m2.
uline.
ob->m1( exporting x = p_x y = p_y ).
ob->m2( ).

y type c optional,

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

Vous aimerez peut-être aussi