hi gurus,
data : a type i value '4',
b type i value '4',
c type i value '4'.
write : / c.
perform add using a b changing c.
write : / 'outside' , c.
form add using a1 b1 changing value(c1).
c1 = a1 + b1.
write : 'c1' , c1.
endform.
in this pgm , why the actual parameter is not changing , its returning only the formal parameter value..
Hi,
the values is changing because of the keyword CHANGING in the definition of the subroutine. Instead use the below code
data : a type i value '4',
b type i value '4',
c type i value '4'.
write : / c.
perform add using a b c."changing c.
write : / 'outside' , c.
form add using a1 b1 value(c1). "changing value(c1).
c1 = a1 + b1.
write : 'c1' , c1.
endform.
this would answer your question.
regards,
Nandana