‎2008 Mar 20 9:26 AM
Hi sir,
what is the diff b/w using and changing keywords for passing the perameters to subroutine and form
‎2008 Mar 20 9:29 AM
Are you giving any interview ?
Or,
We are getting interviewed ?
‎2008 Mar 20 9:34 AM
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
‎2008 Mar 20 9:37 AM
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.
‎2008 Mar 20 9:40 AM
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