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
526

Hi Friends,

can anyone explain.. differnece between using and changing in subroutine concept. when we use??

regards,

4 REPLIES 4
Read only

Former Member
0 Likes
497

You can get the answer very simply by putting your cursor on a PERFORM statement and then pressing F1.

Rob

Read only

Former Member
0 Likes
497

Hi,

Please the check the syntax help for FORM and PERFORM...You can check the standard sap help

Thanks

naren

Read only

Former Member
0 Likes
497

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).

Read only

uwe_schieferstein
Active Contributor
0 Likes
497

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.