‎2007 Jun 27 8:11 AM
can any one tell exact difference between pass by value and pass by referrence
‎2007 Jun 27 8:17 AM
Hi,
<b>Pass by Reference</b> With pass by reference, a reference to the actual parameter is passed to the method for each formal parameter for which an actual parameter is specified when you call the method, regardless of the parameter type. The method thus uses the actual parameter itself, and changes to formal parameters have a direct effect on the actual parameter.
<b>Pass by Value</b> With pass by value, a local data object is created as a copy of the actual parameter for each formal parameter when the method is called. In the case of input parameters and input/output parameters, the value of the actual parameter is assigned to this data object. The value of the formal parameter is only assigned to output parameters, input/output parameters, and return values if the method is exited without errors using ENDMETHOD or RETURN.
Reward if useful.
Regards,
Suruchi
‎2007 Jun 27 8:14 AM
hi sandeep.
When u say pass by value u mean that u r using the actual parameters to pass the value directly.
when u say pass by reference u r using the ddress of this variable to store the value.
‎2007 Jun 27 8:15 AM
Hi Sandeep,
Check out this link,
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/content.htm
Reward if useful!
‎2007 Jun 27 8:17 AM
Hi,
<b>Pass by Reference</b> With pass by reference, a reference to the actual parameter is passed to the method for each formal parameter for which an actual parameter is specified when you call the method, regardless of the parameter type. The method thus uses the actual parameter itself, and changes to formal parameters have a direct effect on the actual parameter.
<b>Pass by Value</b> With pass by value, a local data object is created as a copy of the actual parameter for each formal parameter when the method is called. In the case of input parameters and input/output parameters, the value of the actual parameter is assigned to this data object. The value of the formal parameter is only assigned to output parameters, input/output parameters, and return values if the method is exited without errors using ENDMETHOD or RETURN.
Reward if useful.
Regards,
Suruchi
‎2007 Jun 27 8:18 AM
Hi,
Pass By Value - This passes the actual parameters i.e variables passed to the Function Module.
Pass By Reference - This passes the address of the variable not the actual value.
Regards,
Priyanka.