<?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: exit. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065155#M427269</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;Please try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...

if v_newqty &amp;gt; 6 or v_newqty &amp;lt; 0. 
  message E899(BD) with 'incorrect new quantity'.
endif.

...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Mar 2007 20:24:20 GMT</pubDate>
    <dc:creator>ferry_lianto</dc:creator>
    <dc:date>2007-03-13T20:24:20Z</dc:date>
    <item>
      <title>exit.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065154#M427268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HELLO,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to make exit if the v_newqty is graterthan 6 or lessthan 0 message should come and not allow me to create  the order........please correct the code in bold...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      loop at it_fg_xvbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;        if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;          v_mitem1_qty = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;          v_quantity = it_zfreegoods-quantity.&lt;/P&gt;&lt;P&gt;          clear v_lines.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;          it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;          modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        v_lines = v_lines + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          v_newqty = v_quantity - it_fg_xvbap-lsmeng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;b&amp;gt;  if v_newqty &amp;lt; 0.&lt;/P&gt;&lt;P&gt;          exit.&lt;/P&gt;&lt;P&gt;          else.&lt;/P&gt;&lt;P&gt;          endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          it_fg_xvbap-kwmeng = v_newqty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    if v_mixitem_qty ne it_zfreegoods-quantity.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          if v_quantity ne it_zfreegoods-quantity.&lt;/P&gt;&lt;P&gt;            if fcode eq 'SICH'.&lt;/P&gt;&lt;P&gt;              message e020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              message s020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;         endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;      xvbap[] = it_fg_xvbap[].&lt;/P&gt;&lt;P&gt;    endif.   "  it_zfreegoods table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2007 20:20:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065154#M427268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-13T20:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: exit.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065155#M427269</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;Please try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...

if v_newqty &amp;gt; 6 or v_newqty &amp;lt; 0. 
  message E899(BD) with 'incorrect new quantity'.
endif.

...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2007 20:24:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065155#M427269</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2007-03-13T20:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: exit.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065156#M427270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Exit' statement will take you back to the called statement of subroutine. To terminate the transation, You have to write an error message . (STOP. statement is not permitted by SAP and abend is also not expected)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Audy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2007 21:15:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exit/m-p/2065156#M427270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-13T21:15:23Z</dc:date>
    </item>
  </channel>
</rss>

