Skip to Content
0
Former Member
Nov 25, 2009 at 01:58 PM

Subroutine pass by value and result

1077 Views

I actually wanted to know if the copying the value back to variable(inpu2) it works.but when i use stop staement to exit the subroutine the value is still copied back to the actual parameter input 2.

plz guide me.

REPORT zsub_routines_pgm.

DATA : input1 TYPE i VALUE 1,

input2 TYPE i VALUE 2.

*PERFORM add USING input1 input2.

*

*INCLUDE zsub_routines_pgm_addf01.

WRITE : / 'before call', input2.

PERFORM add CHANGING input1 input2.

WRITE : / 'after call' , input2.

INCLUDE zsub_routines_pgm_addf01.

include pgm:

&----


*& Form add

&----


  • text

----


  • -->P_INPUT1 text

  • -->P_INPUT2 text

----


FORM add CHANGING value(p_input1)

value(p_input2).

p_input2 = p_input1 + p_input2.

stop.

ENDFORM. "