<?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 how to usw while..endwhile as loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029154#M1499115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My requirement is to find last no of sales order. I am taking latest no fron number range object. But suppose that order is deleted then i have to find previous no. I am using below code but it is not workng..can anyone give inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_VBELN LIKE VBAK-VBELN,&lt;/P&gt;&lt;P&gt;      V_AUDAT LIKE VBAK-AUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: IND(1) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_VBELN = '1133720517'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE IND = 'X'.&lt;/P&gt;&lt;P&gt;  SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE VBELN = V_VBELN.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    IND = 'X'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  V_VBELN = V_VBELN - 1.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jun 2010 06:35:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-23T06:35:11Z</dc:date>
    <item>
      <title>how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029154#M1499115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My requirement is to find last no of sales order. I am taking latest no fron number range object. But suppose that order is deleted then i have to find previous no. I am using below code but it is not workng..can anyone give inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: V_VBELN LIKE VBAK-VBELN,&lt;/P&gt;&lt;P&gt;      V_AUDAT LIKE VBAK-AUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: IND(1) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;V_VBELN = '1133720517'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE IND = 'X'.&lt;/P&gt;&lt;P&gt;  SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE VBELN = V_VBELN.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    IND = 'X'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  V_VBELN = V_VBELN - 1.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:35:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029154#M1499115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-23T06:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029155#M1499116</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;Use the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF TY_VBELN,&lt;/P&gt;&lt;P&gt;               VBELN TYPE VBELN_VA,&lt;/P&gt;&lt;P&gt;             END OF TY_VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T_VBELN TYPE STANDARD TABLE OF TY_VBELN,&lt;/P&gt;&lt;P&gt;           WA_VBELN TYPE TY_VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT VBELN INTO TABLE T_VBELN FROM VBAK. "You can also add order type, Sales Area here....&lt;/P&gt;&lt;P&gt;SORT T_VBELN BY VBELN DESCENDING.&lt;/P&gt;&lt;P&gt;READ TABLE T_VBELN INTO WA_VBELN INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence You get the latest Sales Order in field WA_VBELN-VBELN...&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;Birendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029155#M1499116</guid>
      <dc:creator>birendra_chatterjee</dc:creator>
      <dc:date>2010-06-23T06:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029156#M1499117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I can use this but in this performance issue will come. is there any other solution like conditional loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029156#M1499117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-23T06:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029157#M1499118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think till u dont get the order u want  to fetch the record from  vbak , so u can write the condition as &lt;/P&gt;&lt;P&gt;WHILE IND ne 'X'.&lt;/P&gt;&lt;P&gt;SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE VBELN = V_VBELN.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;IND = 'X'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;V_VBELN = V_VBELN - 1.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:46:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029157#M1499118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-23T06:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029158#M1499119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Madhukar,&lt;/P&gt;&lt;P&gt;This resolve my problem..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:50:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029158#M1499119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-23T06:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to usw while..endwhile as loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029159#M1499120</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;try with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;write conditions...&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 06:50:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-usw-while-endwhile-as-loop/m-p/7029159#M1499120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-23T06:50:44Z</dc:date>
    </item>
  </channel>
</rss>

