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

Using and changing

Former Member
0 Likes
689

Hi sir,

what is the diff b/w using and changing keywords for passing the perameters to subroutine and form

4 REPLIES 4
Read only

Former Member
0 Likes
656

Are you giving any interview ?

Or,

We are getting interviewed ?

Read only

Former Member
0 Likes
656

If you want to pass the variable as read only then use USING clause and if you want the variable to be read/ write one then you can use Changing clause.

no rewarding plz

Read only

Former Member
0 Likes
656

Hi Suresh,

Using and Changing in form Routines in simple are input and output parameters to the routine.

we input the parameters to the routine using Keyword 'USING'.

we catch the otput from the routine using keyword 'CHANGING'.

Eg to fetch customer material.

/: PERFORM GET_CUST_MATERIAL IN PROGRAM ZSROINVOICE

/: USING &VBDKR-VBELN_VAUF&

/: USING &VBDPR-POSNR&

/: CHANGING &CUSTMAT&

/: CHANGING &CUSTMAKT&

You can code the data in the program ZSROINVOICE.

Babul.

Read only

Former Member
0 Likes
656

Hi ,

By default if you pass a varaible as Using , you cannot change the value of it in the subroutine but in case of chianging it can be.

Now you can pass the value of using paramater by pass by value , it allows you to change the value in the subroutine but once you are out of the subroutine the changed value is lost and the original value is retained.

So in case you want to change value of a parameter you are passing to a subroutine use changing and if you just want to use its value then use using.

Here is a code which might help you understand it better

REPORT .

data : one type i ,

two type i.

one = 1.

two = 1.

perform chnage_value using one

changing two.

write /: one , two.

&----


*& Form chnage_value

&----


  • text

----


  • -->P_ONE text

  • <--P_TWO text

----


form chnage_value using value(p_one)

changing p_two.

p_one = p_one + 1.

p_two = p_two + 1.

endform. " chnage_value

regards

Arun