<?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: do...varying... with variable starting point 'from' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240424#M1630079</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;I know, how it works in general.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at your exaple: &lt;/P&gt;&lt;P&gt;DO 21 TIMES VARYING ld_p0121 FROM p0121-RFP01 NEXT p0121-RFP02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that position/fieldname &lt;STRONG&gt;p0121-RFP01&lt;/STRONG&gt; is 'unknown'  because it is set dynamically by entering the&lt;/P&gt;&lt;P&gt;starting period on the selection dynpro of the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.  you want to calculate the sum of faglflext-hsl02 to faglflext-hsl06.&lt;/P&gt;&lt;P&gt;Therefore you put period 2 ...to 6 into the according parameter fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case the coding would be  like:  &lt;/P&gt;&lt;P&gt;do 5 times varying i_sum from faglflext-hsl02 next faglflext-hsl03.&lt;/P&gt;&lt;P&gt;i_total = i_total + i_sum.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Oct 2011 06:45:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-13T06:45:01Z</dc:date>
    <item>
      <title>do...varying... with variable starting point 'from'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240422#M1630077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use 'do...varying...' in order to add special columns (e.g. hsl03 to hsl10 of tabel faglfext).&lt;/P&gt;&lt;P&gt;The problem is that the starting point ( hsl03) is set variably:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO x TIMES VARYING i_sum FROM faglflext-hslxx NEXT 'faglflext-hslxx + 1'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 06:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240422#M1630077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-13T06:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: do...varying... with variable starting point 'from'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240423#M1630078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The  varying command is a function of the DO loop which allows you to move horizontaly along a table row without actually having to specify each individual field name. i.e. if the table row had the fields: Field1 Field2 Field3 Field4 etc you would be able to loop around each field using only one DO..VARYING command. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Code to demonstrate VARYING command&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; The varying comand works on the position within the row, therfore&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; each field must be the same number of fields apart.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: ld_p0121 type p0121-rfp01,&lt;/P&gt;&lt;P&gt;      ld_numcont type i.&lt;/P&gt;&lt;P&gt;  DO 21 TIMES VARYING ld_p0121 FROM p0121-RFP01 NEXT p0121-RFP02.&lt;/P&gt;&lt;P&gt;    IF not ld_p0121 IS INITIAL.&lt;/P&gt;&lt;P&gt;      ld_numcont = ld_numcont + 1.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Code to demonstrate multiple field VARYING command&lt;/P&gt;&lt;P&gt;DATA: ld_kst0x LIKE p0027-kst02,&lt;/P&gt;&lt;P&gt;      ld_auf0x LIKE p0027-auf02,&lt;/P&gt;&lt;P&gt;      ld_psp0x LIKE p0027-psp02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO 25 TIMES VARYING ld_kst0x FROM p0027-kst02 NEXT p0027-kst03&lt;/P&gt;&lt;P&gt;              VARYING ld_auf0x FROM p0027-auf02 NEXT p0027-auf03&lt;/P&gt;&lt;P&gt;              VARYING ld_psp0x FROM p0027-psp02 NEXT p0027-psp03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM get_cost_center_and_text USING ld_kst0x&lt;/P&gt;&lt;P&gt;                                           ld_auf0x&lt;/P&gt;&lt;P&gt;                                           ld_psp0x.&lt;/P&gt;&lt;P&gt;    APPEND output_tab.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 06:18:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240423#M1630078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-13T06:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: do...varying... with variable starting point 'from'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240424#M1630079</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;I know, how it works in general.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at your exaple: &lt;/P&gt;&lt;P&gt;DO 21 TIMES VARYING ld_p0121 FROM p0121-RFP01 NEXT p0121-RFP02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that position/fieldname &lt;STRONG&gt;p0121-RFP01&lt;/STRONG&gt; is 'unknown'  because it is set dynamically by entering the&lt;/P&gt;&lt;P&gt;starting period on the selection dynpro of the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.  you want to calculate the sum of faglflext-hsl02 to faglflext-hsl06.&lt;/P&gt;&lt;P&gt;Therefore you put period 2 ...to 6 into the according parameter fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case the coding would be  like:  &lt;/P&gt;&lt;P&gt;do 5 times varying i_sum from faglflext-hsl02 next faglflext-hsl03.&lt;/P&gt;&lt;P&gt;i_total = i_total + i_sum.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 06:45:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240424#M1630079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-13T06:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: do...varying... with variable starting point 'from'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240425#M1630080</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;Thanks for your help.&lt;/P&gt;&lt;P&gt;Gues I´ve resolved the puzzle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 07:09:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-varying-with-variable-starting-point-from/m-p/8240425#M1630080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-13T07:09:22Z</dc:date>
    </item>
  </channel>
</rss>

