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

changing

Former Member
0 Likes
453

difference between changing and using in subroutines

3 REPLIES 3
Read only

former_member156446
Active Contributor
0 Likes
434

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.

Read only

Former Member
0 Likes
434

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.

Rgds

sathar

Read only

Former Member
0 Likes
434

Hi,

Using is used in subroutines when u just pass the value of a variable and u never change that value in the so called form u r just supposed to use it.

for example

form <name> using w_no type i.

*local variables declaration.

data:

lw_data type i.

lw_data = w_no + 2.

endform.

see here u sed the value of w_no but u have not changed it..

form <name> changing w_no type i.

w_no = w_no + 2.

endform.

see here u changed the value of w_no so here u have to use changing

i hope i am clear to u..

reward if helpful..