‎2007 Nov 02 8:42 PM
Hi Friends,
can anyone explain.. differnece between using and changing in subroutine concept. when we use??
regards,
‎2007 Nov 02 8:46 PM
You can get the answer very simply by putting your cursor on a PERFORM statement and then pressing F1.
Rob
‎2007 Nov 02 8:50 PM
Hi,
Please the check the syntax help for FORM and PERFORM...You can check the standard sap help
Thanks
naren
‎2007 Nov 03 9:42 PM
THE MAIN DIFFERENCE BETWEEN
USING & CHANGING
IF YOU USE USING EACH AND EVERY CHANGES MADE TO THE FORMAL PARAMETERS THE CHANGE EFFECT WILL BE IMEDIATLY EFFECT ON ACCTUAL PARAMETERS
WHERE AS INCASE OF THERE WILL BE NO IMEDEATE CHANGE TO THE ACTUAL PARAMETERS THE CHANGE WILL BE DONE WHEN IT REACHES THE END FORM.(SIMPLY INTERMEDIATE CHANGES OF FORMAL PARAMETERS WILL NOT BE EFFECT THE ACCTUAL PARAMETRES FINAL TESULTS WIL BE RETURN).
‎2007 Nov 03 10:38 PM
Hello
Within the subroutine you can modify the formal parameters irrespective of whether they are USING or CHANGING parameters. This is nothing else but messy coding.
The ABAP keyword documentation gives a good example of how to use USING and CHANGING parameters:
<i>The following five PERFORM statements mean the same but only the <u>fourth </u>is recommended, since it is the only one that documents the interface of the subroutine called. </i>
DATA: a1 TYPE string,
a2 TYPE string,
a3 TYPE string,
a4 TYPE string.
PERFORM test USING a1 a2 a3 a4.
PERFORM test CHANGING a1 a2 a3 a4.
PERFORM test USING a1 CHANGING a2 a3 a4.
PERFORM test USING a1 a2 CHANGING a3 a4.
PERFORM test USING a1 a2 a3 CHANGING a4.
...
FORM test USING p1 TYPE string
p2 TYPE string
CHANGING value(p3) TYPE string
value(p4) TYPE string.
...
ENDFORM.