<?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: raise error message in loop and exit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082985#M976274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;I now understand that i can't raise a Error message in form endform and only way is to pass back a flag indicating that there is an error.&lt;/P&gt;&lt;P&gt;I got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jun 2008 10:11:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-25T10:11:18Z</dc:date>
    <item>
      <title>raise error message in loop and exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082981#M976270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looping on an internal table and validating data.&lt;/P&gt;&lt;P&gt;so if in between if i find any inconsistency, i want to throw an error and exit.&lt;/P&gt;&lt;P&gt;let me put it in sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;perform check_data using wa1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_data using wa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa1-field1 is initial.&lt;/P&gt;&lt;P&gt;  message 'No Data can't save' type 'E'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i want to give this error and end loop processing&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;how can i give?&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i can't use continue also as its not in loop endloop.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;friends pls suggest.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endif.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2008 08:22:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082981#M976270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-25T08:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: raise error message in loop and exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082982#M976271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope following code can give you idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;perform check_data using wa1 changing lv_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if lv_error = 'X'.&lt;/P&gt;&lt;P&gt;message 'No Data can't save' type 'E'.&lt;/P&gt;&lt;P&gt;exit.&lt;/P&gt;&lt;P&gt;endif.&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;form check_data using wa1 changing p_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa1-field1 is initial.&lt;/P&gt;&lt;P&gt;  p_error = 'X'.&lt;/P&gt;&lt;P&gt;endif.&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;Thanks,&lt;/P&gt;&lt;P&gt;Victor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Victor Wijaya on Jun 25, 2008 10:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2008 08:25:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082982#M976271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-25T08:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: raise error message in loop and exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082983#M976272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Simha,&lt;/P&gt;&lt;P&gt;do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_message TYPE c.&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;perform check_data using wa1 CHANGING w_message.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK w_message EQ 'X'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXIT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_data using wa1  CHANGING p_message.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Do ur validations&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK wa1-field1 is initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;message 'No Data can't save' type 'E'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MOVE 'X' TO p_message.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way could be issue message directly in the loop instead of doing in form and then exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_message TYPE c.&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;perform check_data using wa1.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CHECK wa1-field1 is initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;message 'No Data can't save' type 'E'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXIT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_data using wa1.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Do ur validations&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Reddy Vemuru on Jun 25, 2008 2:01 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2008 08:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082983#M976272</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-06-25T08:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: raise error message in loop and exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082984#M976273</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 the following :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt; begin of wa1,&lt;/P&gt;&lt;P&gt; field1 type i,&lt;/P&gt;&lt;P&gt; end of wa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;itab1 like standard table of wa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;write logic for fetching the data into itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;perform check_data using wa1-field1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_data using wa1-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa1-field1 is initial.&lt;/P&gt;&lt;P&gt;w_flag = 'X'.&lt;/P&gt;&lt;P&gt;stop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;if w_flag = 'X'.&lt;/P&gt;&lt;P&gt; message 'No Data can't save' type 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2008 08:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082984#M976273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-25T08:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: raise error message in loop and exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082985#M976274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;I now understand that i can't raise a Error message in form endform and only way is to pass back a flag indicating that there is an error.&lt;/P&gt;&lt;P&gt;I got it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Simha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2008 10:11:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-error-message-in-loop-and-exit/m-p/4082985#M976274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-25T10:11:18Z</dc:date>
    </item>
  </channel>
</rss>

