<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perform statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601523#M270063</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi johnn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. we want to pass some input parameters&lt;/P&gt;&lt;P&gt;   the form routine (as an input)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   so we use USING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Inside the FORM,&lt;/P&gt;&lt;P&gt;   if we want to MODIFY&lt;/P&gt;&lt;P&gt;   some parameters, (passed with PERFORM statement)&lt;/P&gt;&lt;P&gt;   then we should use CHANGING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. HOWEVER,&lt;/P&gt;&lt;P&gt;4. we can modify both type of parameters,&lt;/P&gt;&lt;P&gt;   (provided they are not passed by value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. But the USING / CHANGING&lt;/P&gt;&lt;P&gt;   is provided for CLARIFICATION/SIMPLICITY&lt;/P&gt;&lt;P&gt;   purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Sep 2006 10:01:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-14T10:01:11Z</dc:date>
    <item>
      <title>Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601520#M270060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain me abt the difference between&lt;/P&gt;&lt;P&gt; Using &amp;amp; changing in Perform statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 09:50:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601520#M270060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T09:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601521#M270061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what the sap documentation says:&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... USING    u1 u2 u3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 3 &lt;/P&gt;&lt;P&gt;... CHANGING c1 c2 c3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These additions must be followed by type-related actual parameters for all USING and CHANGING parameters of the called subroutine. The two additions are equivalent. Only the order of the parameters is important. The first USING or CHANGING parameter of the PERFORM call is transferred to the first USING or CHANGING parameter of the subroutine, the second to the second, and so on. For documentation reasons you should, when calling, use the same addition as with the subroutine definition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 09:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601521#M270061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T09:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601522#M270062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING parameters: a local copy of the parameter is created in the subroutine and the original parameter value will not changed if changes are made within subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHANGING parameters: address of the original parameter is passed to subroutine changes in the parameter value in subroutine will change the original parameter too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 09:57:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601522#M270062</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-09-14T09:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601523#M270063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi johnn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. we want to pass some input parameters&lt;/P&gt;&lt;P&gt;   the form routine (as an input)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   so we use USING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Inside the FORM,&lt;/P&gt;&lt;P&gt;   if we want to MODIFY&lt;/P&gt;&lt;P&gt;   some parameters, (passed with PERFORM statement)&lt;/P&gt;&lt;P&gt;   then we should use CHANGING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. HOWEVER,&lt;/P&gt;&lt;P&gt;4. we can modify both type of parameters,&lt;/P&gt;&lt;P&gt;   (provided they are not passed by value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. But the USING / CHANGING&lt;/P&gt;&lt;P&gt;   is provided for CLARIFICATION/SIMPLICITY&lt;/P&gt;&lt;P&gt;   purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 10:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601523#M270063</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T10:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601524#M270064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;USING&amp;lt;/b&amp;gt; parameters: a local copy of the parameter is created in the subroutine and the original parameter value will not changed if changes are made within subroutine. Basically, can also be said to be PASS by value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CHANGING&amp;lt;/b&amp;gt; parameters: address of the original parameter is passed to subroutine changes in the parameter value in subroutine will change the original parameter too. Basically, can also be said to be PASSing by reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cs.princeton.edu/~lworthin/126/precepts/pass_val_ref.html" target="test_blank"&gt;http://www.cs.princeton.edu/~lworthin/126/precepts/pass_val_ref.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 10:05:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601524#M270064</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T10:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601525#M270065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : num1 type i ,&lt;/P&gt;&lt;P&gt;       num2 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1  = 7.&lt;/P&gt;&lt;P&gt;num2 = 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform find_sum using num1 num2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form find_sum using num1 type i  num2 type i.&lt;/P&gt;&lt;P&gt;num1 = num1 + num2.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write num1. "out put will be 7 itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********&lt;STRONG&gt;changing&lt;/STRONG&gt;**********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform find_sum changing num1 num2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form find_sum changing num1 num2.&lt;/P&gt;&lt;P&gt;num1 = num1 + num2.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write num1. "out put will be 17.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING -&amp;gt; a local copy of the parameter is created in the subroutine and the original parameter value will not changed if changes are made within subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHANGING - &amp;gt; address of the original parameter is passed to subroutine changes in the parameter value in subroutine will change the original parameter too. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if hlped rwrd points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 10:20:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601525#M270065</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-14T10:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Perform statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601526#M270066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the form header declares that the parameter is passed by reference, i.e. the parameters in the FORM statemtent are written as P1 P2 ... and not as VALUE(P1) VALUE P(2) ..., then USING and CHANGING behave in the same way and it is just a matter of good coding practice to specify USING for parameters that do not get changed inside the subroutine, and CHANGING for parameters that do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the parameters in the FORM line are declared with the VALUE() clause, then the behaviour &lt;U&gt;is&lt;/U&gt; different. With USING the actul variable passed by the caller does not change, with CHANGING it does change unless the subroutine is exited with an exception (e.g. a MESSAGE E).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few simple examples to clarify:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#1:&lt;/P&gt;&lt;P&gt;DATA MYVAR TYPE I VALUE 5.&lt;/P&gt;&lt;P&gt;PERFORM DOUBLE USING MYVAR.&lt;/P&gt;&lt;P&gt;WRITE MYVAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM DOUBLE USING ARG.&lt;/P&gt;&lt;P&gt; ARG = ARG * 2.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; In this case MYVAR becomes 10. Since ARG is changed in the soubroutine, "CHANGING" would be better coding than "USING" but the effect is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#2:&lt;/P&gt;&lt;P&gt;PERFORM DOUBLE CHANGING MYVAR.&lt;/P&gt;&lt;P&gt;FORM DOUBLE USING ARG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; MYVAR still becomes 10. This is not good coding however: your PERFORM statement should match the declaration in the FORM. If you have USING in the PERFORM and CHANGING in the FORM -&amp;gt; same thing: result is 10, but sloppy coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#3:&lt;/P&gt;&lt;P&gt;PERFORM DOUBLE USING MYVAR.   (or CHANGING)&lt;/P&gt;&lt;P&gt;FORM DOUBLE USING VALUE(ARG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; Now MYVAR will remain 5. Combination of USING and VALUE() in the FORM header means that for this parameter a local copy is created and its final value is &lt;U&gt;not&lt;/U&gt; returned back to the caller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#4:&lt;/P&gt;&lt;P&gt;PERFORM DOUBLE USING MYVAR.   (or CHANGING)&lt;/P&gt;&lt;P&gt;FORM DOUBLE CHANGING VALUE(ARG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; MYVAR becomes 10 if the subroutine is exited normally (e.g. via ENDFORM). If it exits with an exception, MYVAR remains 5. Personally this is not something I'd ever code this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this didn't look too confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 10:29:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-statement/m-p/1601526#M270066</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T10:29:07Z</dc:date>
    </item>
  </channel>
</rss>

