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

regarding changing and using

Former Member
0 Likes
574

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

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
551

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,

2 REPLIES 2
Read only

Former Member
0 Likes
551

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
552

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,