<?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: how to use do varying command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950968#M1336117</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;You can use simple loop - endloop to calculate any thing row wise.&lt;/P&gt;&lt;P&gt;Declare some field outside the loop for calculation and initilize it.&lt;/P&gt;&lt;P&gt;then use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot type p decimals 2 value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mgmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot = m_tot + tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot will give you the final total row wise. You can use any number of variable as per calculating different fields total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this was your requirement, i think this is more than sufficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2009 07:44:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-13T07:44:24Z</dc:date>
    <item>
      <title>how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950966#M1336115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_mgmt OCCURS 0,&lt;/P&gt;&lt;P&gt;       btrtl     TYPE pa0001-btrtl,&lt;/P&gt;&lt;P&gt;       btext     TYPE t001p-btext,&lt;/P&gt;&lt;P&gt;       perm      TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       con       TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       perm2     TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       con2      TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       perm3     TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       con3      TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       tot       TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;       avg       TYPE pad_amt7s ,&lt;/P&gt;&lt;P&gt;      END OF i_mgmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This my int. table and i need to calculate tot. row wise How can i use do varying command in this condition. Or any other way to calculate tot. row wise...Plesae help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:35:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950966#M1336115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950967#M1336116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Do you mean that tot will be the sum of perm con, perm2, con2, perm3 and con3 for each btrtl then you can use COLLECT statement and collect the data in a new internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:40:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950967#M1336116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950968#M1336117</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;You can use simple loop - endloop to calculate any thing row wise.&lt;/P&gt;&lt;P&gt;Declare some field outside the loop for calculation and initilize it.&lt;/P&gt;&lt;P&gt;then use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot type p decimals 2 value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mgmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot = m_tot + tot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m_tot will give you the final total row wise. You can use any number of variable as per calculating different fields total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this was your requirement, i think this is more than sufficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:44:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950968#M1336117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950969#M1336118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on your SAP release, DO ... VARYING might be obsolete, use ASSIGN ... INCREMENT instead inside the loop.&lt;/P&gt;&lt;P&gt;See ABAP Online help for more information, as always.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:49:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950969#M1336118</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-07-13T07:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950970#M1336119</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;Check this example program how to use DO VARYING ..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZTEST_NOTEPAD.

DATA: BEGIN OF text,
        word1 TYPE c LENGTH 4 VALUE 'AAAA',
        word2 TYPE c LENGTH 4 VALUE 'BBBB',
        word3 TYPE c LENGTH 4 VALUE 'CCCC',
        word4 TYPE c LENGTH 4 VALUE 'DDDD',
      END OF text.

DATA: word  TYPE c LENGTH 4,
      char1 TYPE c LENGTH 1,
      char2 TYPE c LENGTH 1,
      leng TYPE i.

FIELD-SYMBOLS &amp;lt;word&amp;gt; LIKE text-word1.
DATA inc TYPE i.

DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.
leng = leng / 2.

DO leng TIMES VARYING char1 FROM text(1)
                            NEXT text+2(1) RANGE text
              VARYING char2 FROM text+1(1)
                            NEXT text+3(1) RANGE text.
  WRITE: char1, char2.
  char1 = 'x'.
  char2 = 'y'.
ENDDO.

DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.
  WRITE / word.
ENDDO.

DO.
  inc = sy-index  - 1.
  ASSIGN text-word1 INCREMENT inc TO &amp;lt;word&amp;gt; RANGE text.
  IF sy-subrc = 0.
    WRITE / &amp;lt;word&amp;gt;.
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat.O&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:54:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950970#M1336119</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-07-13T07:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950971#M1336120</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;Ya tot = perm + con + perm2 + con2 + perm3 + con3 for eac btrtl. will collect gives the total row-wise?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 08:50:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950971#M1336120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T08:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950972#M1336121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi anil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here tot = perm + con + perm2 + con2 + perm3 + con3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to calculate??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 08:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950972#M1336121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T08:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950973#M1336122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After selecting the required data into itab i_mgmt with work area (say wa), do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_mgmt into wa.&lt;/P&gt;&lt;P&gt;    wa-tot = wa-perm + wa-con + wa-perm2 + wa-con2 + wa-perm3 + wa-con3. &lt;/P&gt;&lt;P&gt;    wa-avg = wa-tot / 3.&lt;/P&gt;&lt;P&gt;    modify i_mgmt index sy-tabix from wa .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mdi.Deeba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 09:14:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950973#M1336122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T09:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to use do varying command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950974#M1336123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Ya tot = perm + con + perm2 + con2 + perm3 + con3 for eac btrtl. will collect gives the total row-wise?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT statment should not be used for standard tables (obsolete for standard tables). As suggested by Thomas please use the ASSIGN statement with the INCREMENT addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the below article(page 6)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[State of the art ABAP programs - part 2|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4fbafc9e-0e01-0010-dea9-9d23d1b269fb?overridelayout=true]&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;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 10:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-use-do-varying-command/m-p/5950974#M1336123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T10:22:22Z</dc:date>
    </item>
  </channel>
</rss>

