‎2008 Apr 02 8:48 AM
Hello experts:
First thank you in advance for all your replies.
would you please explain the difference of changing and using preferably by an example?
couldn't thank you more.
Best regards.
Frank
‎2008 Apr 02 8:59 AM
Hi,
USING and CHANGING in PERFORMS means like this.
USING- Call by value
CHANGING- Call by reference
Check the example below.
PERFORM conv_atinnnam_no USING l_refbatch CHANGING w_refbatch.
FORM conv_atinnnam_no USING p_name
CHANGING p_no.
CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
EXPORTING
input = p_w_name
IMPORTING
output = p_w_no.
ENDFORM. " conv_atinnnam_no
The parameters passing under USING will not change if the corrosponding parameter in the FORM changes unless it is global variable. But in case of parameter under changing what ever changes we are making inside FORM will be reflected to Original variables.
In case of global variables USING and CHANGING works in
the same way.
Thanks,
Vinod,
‎2008 Apr 02 8:51 AM
if in the subroutine if you want to change any value...pass as changing parameter.
if you just want to use the variable pass as using parameter..
perform using lv_using changing lv_change.
form using p_lv_using changing p_lv_change.
p_lv_change = p_lv_change * 2.
p_lv_using = p_lv_using * 2. " <<< not possible as its using parameter.
values will not reflect to original values if use using where as it will reflect for changing
‎2008 Apr 02 8:59 AM
Hi,
USING and CHANGING in PERFORMS means like this.
USING- Call by value
CHANGING- Call by reference
Check the example below.
PERFORM conv_atinnnam_no USING l_refbatch CHANGING w_refbatch.
FORM conv_atinnnam_no USING p_name
CHANGING p_no.
CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
EXPORTING
input = p_w_name
IMPORTING
output = p_w_no.
ENDFORM. " conv_atinnnam_no
The parameters passing under USING will not change if the corrosponding parameter in the FORM changes unless it is global variable. But in case of parameter under changing what ever changes we are making inside FORM will be reflected to Original variables.
In case of global variables USING and CHANGING works in
the same way.
Thanks,
Vinod,