<?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: Tables Vs Changing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446750#M211957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt; There is not much of difference in your example.&lt;/P&gt;&lt;P&gt;One thing is that you cannot pass normal variables using tables parameters.&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>Fri, 23 Jun 2006 15:17:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-23T15:17:28Z</dc:date>
    <item>
      <title>Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446749#M211956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi What is the diff bw two methods :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I define a form nd pass internal table using tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form demo tables t_demo&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if i pass internal table using changing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form  demo changing t_demo.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 15:12:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446749#M211956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-23T15:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446750#M211957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt; There is not much of difference in your example.&lt;/P&gt;&lt;P&gt;One thing is that you cannot pass normal variables using tables parameters.&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>Fri, 23 Jun 2006 15:17:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446750#M211957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-23T15:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446751#M211958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From  Help....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TABLES Addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure compatibility with previous releases, the following addition is still allowed before the USING and CHANGING additions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM &amp;lt;subr&amp;gt; TABLES   ... &amp;lt;itabi&amp;gt; [TYPE &amp;lt;t&amp;gt;|LIKE &amp;lt;f&amp;gt;] ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formal parameters &amp;lt;itabi&amp;gt; are defined as standard internal tables with header lines. If you use an internal table without header line as the corresponding actual parameter for a formal parameter of this type, the system creates a local header line in the subroutine for the formal parameter. If you pass an internal table with a header line, the table body and the table work area are passed to the subroutine. Formal parameters defined using TABLES cannot be passed by reference. If you want to address the components of structured lines, you must specify the type of the TABLES parameter accordingly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;From Release 3.0, you should use USING or CHANGING instead of the TABLES addition for internal tables, although for performance reasons, you should not pass them by value.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/i&amp;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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 15:19:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446751#M211958</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-23T15:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446752#M211959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajesh,&lt;/P&gt;&lt;P&gt;PROGRAM FORM_TEST.&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;SUM TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM1 = 2. NUM2 = 4.&lt;/P&gt;&lt;P&gt;PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUM1 = 7. NUM2 = 11.&lt;/P&gt;&lt;P&gt;PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM ADDIT &lt;/P&gt;&lt;P&gt;       USING ADD_NUM1 &lt;/P&gt;&lt;P&gt;             ADD_NUM2 &lt;/P&gt;&lt;P&gt;       CHANGING ADD_SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ADD_SUM = ADD_NUM1 + ADD_NUM2.&lt;/P&gt;&lt;P&gt;  PERFORM OUT USING ADD_NUM1 ADD_NUM2 ADD_SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM OUT &lt;/P&gt;&lt;P&gt;       USING OUT_NUM1 &lt;/P&gt;&lt;P&gt;             OUT_NUM2 &lt;/P&gt;&lt;P&gt;             OUT_SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / 'Sum of', OUT_NUM1, 'and', OUT_NUM2, 'is', OUT_SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The produces the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum of 2 and 4 is 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum of 7 and 11 is 18&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, the actual parameters NUM1, NUM2, and SUM are passed by reference to the formal parameters of the subroutine ADDIT. After changing ADD_SUM, the latter parameters are then passed to the formal parameters OUT_NUM1, OUT_NUM2, and OUT_SUM of the subroutine OUT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input parameters which are changed in the subroutine are also changed in the calling program. To prevent this, you must pass the parameter by value in a USING addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of passing parameters by reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM FORM_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: NUM TYPE I VALUE 5,&lt;/P&gt;&lt;P&gt;FAC TYPE I VALUE 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM FACT USING NUM CHANGING FAC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / 'Factorial of', NUM, 'is', FAC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FACT&lt;/P&gt;&lt;P&gt;       USING VALUE(F_NUM)&lt;/P&gt;&lt;P&gt;       CHANGING F_FACT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  F_FACT = 1.&lt;/P&gt;&lt;P&gt;  WHILE F_NUM GE 1.&lt;/P&gt;&lt;P&gt;    F_FACT = F_FACT * F_NUM.&lt;/P&gt;&lt;P&gt;    F_NUM = F_NUM - 1.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The produces the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Factorial of 5 is 120&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure that an input parameter is not changed in the calling program, even if it is changed in the subroutine, you can pass data to a subroutine by value. In this example, the factorial of a number NUM is calculated. The input parameter NUM is passed to the formal parameter F_NUM of the subroutine. Although F_NUM is changed in the subroutine, the actual parameter NUM keeps its old value. The output parameter FAC is passed by reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of output parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM FORM_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: OP1 TYPE I,&lt;/P&gt;&lt;P&gt;OP2 TYPE I,&lt;/P&gt;&lt;P&gt;RES TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OP1 = 3.&lt;/P&gt;&lt;P&gt;OP2 = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM MULTIP &lt;/P&gt;&lt;P&gt;          USING OP1 OP2 &lt;/P&gt;&lt;P&gt;          CHANGING RES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / 'After subroutine:',&lt;/P&gt;&lt;P&gt;/ 'RES=' UNDER 'RES=', RES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM MULTIP &lt;/P&gt;&lt;P&gt;       USING VALUE(O1) &lt;/P&gt;&lt;P&gt;             VALUE(O2) &lt;/P&gt;&lt;P&gt;     CHANGING VALUE(R).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    R = O1 * O2.&lt;/P&gt;&lt;P&gt;    WRITE: / 'Inside subroutine:',&lt;/P&gt;&lt;P&gt;/ 'R=', R, 'RES=', RES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The produces the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside subroutine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R= 12 RES= 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;keerthi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 15:19:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446752#M211959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-23T15:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446753#M211960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you pass a value as CHANGING VALUE()..&lt;/P&gt;&lt;P&gt;the change is not reflected within the FORM ..ENDFORM for the actual parameter.. ie in case you call another PERFORM like follows..&lt;/P&gt;&lt;P&gt;b=5.&lt;/P&gt;&lt;P&gt;PERFORM a CHANGING B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM a CHANGING VALUE(B)&lt;/P&gt;&lt;P&gt;b=10.&lt;/P&gt;&lt;P&gt;PERFORM C.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM c.&lt;/P&gt;&lt;P&gt;write : /b.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;now&lt;/P&gt;&lt;P&gt;in the form c.&lt;/P&gt;&lt;P&gt;the value of b is still unchanged since the endform of FORM a is still encountered&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Laxmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 15:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446753#M211960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-23T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Tables Vs Changing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446754#M211961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CHANGING would only pass the header line of the internal table to the form whereas TABLES would pass the entire internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 15:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/tables-vs-changing/m-p/1446754#M211961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-23T15:35:18Z</dc:date>
    </item>
  </channel>
</rss>

