2008 Apr 29 4:17 PM
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,
2008 Apr 29 4:20 PM
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
2008 Apr 29 4:21 PM
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
2008 Apr 29 4:21 PM
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
2008 Apr 29 4:21 PM
Below link will help you understand subroutines with various additions .
http://help.sap.com/saphelp_46c/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm
regards
Saravanan
2008 Apr 29 4:23 PM
Hi Venugopal,
Using comes for table, folders, documents, fields
changing comes for values in these.
Regards,
Nagaraju Tankala