2007 Jan 22 9:14 AM
Hi all
can any body explain me abt subroutines..call by value,call by referrence,call by value and results...
Thanks n Regards
popi
2007 Jan 22 9:21 AM
Refer these links,
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db982c35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm
<b>
What is the difference between external & internal subroutine?</b>
Internal subroutines in the sense ..subroutines which are defined and used in a same program...
external in the sense if you create a sub routine in one program and you're calling this subroutine in another program ..
then this is external subroutine.
Hope this helps.
Reward points if u find helpful.
Hi all
can any body explain me abt subroutines..call by value,call by referrence,call by value and results...
Thanks n Regards
popi
2007 Jan 22 9:21 AM
Refer these links,
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db982c35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm
<b>
What is the difference between external & internal subroutine?</b>
Internal subroutines in the sense ..subroutines which are defined and used in a same program...
external in the sense if you create a sub routine in one program and you're calling this subroutine in another program ..
then this is external subroutine.
Hope this helps.
Reward points if u find helpful.
2007 Jan 22 9:24 AM
Hi yen,
<b>CALL BY VALUE: in this case a local copy of the parameter is created for called function and changes make in the variable are local in function they will not change the actual variable.
CALL BY REFERENCE: The address of actual variable is passed to called function and changes made in function will change the actual variable.
CALL BY VALUE AND RESULT: Local copy will be made for the variable and at the end of called function the changed value will be written back to original variable.
</b>
2007 Jan 22 9:34 AM
Hi Popi,
Go through the following:
When we are passing parameter by reference, then a separate copy will not be created. If we are passign by value, a separate copy will be created.
1. Pass by value and pass by reference ( getting result )
a) Pass by value
PERFORM subr USING a1 a2 a3 a4 a5
Click for example: http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/frameset.htm
b) Pass by reference
PERFORM subr CHANGING a1 a2 a3 a4 a5
Click for example Example: http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm
Ashven
2007 Jan 22 9:36 AM
Hi Popi,
Following link is also useful. Go through it.
http://www.cs.princeton.edu/~lworthin/126/precepts/pass_val_ref.html
Ashven
2007 Jan 22 10:01 AM
Hi,
Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally. If you want a function to be reusable throughout the system, use a function module.
Call by value..Inside the subroutine if you change the value it will not have effect (means it will not change the value) in the calling place..
Call by reference...Inside the subroutine if you change the value it will change in the calling place..Means it will share the same memory..
Just have a look at this link:
Regards,
Gunasree.