Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

subroutines

Former Member
0 Likes
801

Hi,

in subroutines ....

when we use USING AND CHANGING ADDTIONS..

AND WAHT IS THE DIFFERENCE BETWEEN THEM.??

1.. USING p1 p2 p3 ...

2.. CHANGING p1 p2 p3 ...

PLS.. EXPLAIN..

REGARDS,

Hi,

in subroutines ....

when we use USING AND CHANGING ADDTIONS..

AND WAHT IS THE DIFFERENCE BETWEEN THEM.??

1.. USING p1 p2 p3 ...

2.. CHANGING p1 p2 p3 ...

PLS.. EXPLAIN..

REGARDS,

5 REPLIES 5
Read only

Former Member
0 Likes
783

Hi,

using Parameters shouldn't be changed in the Subrotuine they should be used to fetch data or do any operations

where as Changing parameters can be changed in the subroutine

similar to exporting parameters

and importing paramerers..

santhosh

Read only

Former Member
0 Likes
783

There will be difference between using and changing on how we mention in form statement.

Form < subroutine name> Using var1 Changing var2.

Here there is no difference as both pass by reference.

Form < subroutine name> Using var1 Changing value (var2).

Here var1 is passed by reference, whereas var2 is passed by value and result.where var2 has its own copy of memory in subroutine, but while the subroutine ends this value overwrites the original value of the var2.

also whenever you write a subroutine its better to give USING only for those parameters which u wont be changing in the subroutine and CHANGING only for those parameters which u'll be definetly changing or updateing or returning the value to the called program

Regards,

sampath

Edited by: sampath pilla on Apr 29, 2008 8:52 PM

Read only

Former Member
0 Likes
783

Hi Venugopal,

If u modify the parameter in subroutine which is passed to ur subroutine as using and Once u come out of the subroutine the variable value will be same as what u had before calling the subroutine.

But if u use changing ur variable will be changed to the new value when u come out of the subroutine.

Regards,

Sunil

Read only

0 Likes
783

Below link will help you understand subroutines with various additions .

http://help.sap.com/saphelp_46c/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm

regards

Saravanan

Read only

Former Member
0 Likes
783

Hi Venugopal,

Using comes for table, folders, documents, fields

changing comes for values in these.

Regards,

Nagaraju Tankala