<?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: validation on selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724625#M1109238</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnkx advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Nov 2008 08:08:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-11T08:08:20Z</dc:date>
    <item>
      <title>validation on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724621#M1109234</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;while doing validation like below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if s_proj[] is not initial.&lt;/P&gt;&lt;P&gt;    select     aufnr&lt;/P&gt;&lt;P&gt;    from       aufk&lt;/P&gt;&lt;P&gt;    into table it_val_aufk UP TO 1 ROWS&lt;/P&gt;&lt;P&gt;               where aufnr&lt;/P&gt;&lt;P&gt;               in s_proj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if it_val_aufk[] is initial.&lt;/P&gt;&lt;P&gt;      message e012(ZXM7).&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i enter aufnr in ranges like 1234  "valid&lt;/P&gt;&lt;P&gt;                                         4567  "not valid &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;still it wont validate for the second record &lt;/P&gt;&lt;P&gt;can you people suggest a better way to solve the above problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 07:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724621#M1109234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T07:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: validation on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724622#M1109235</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;   Remove up 1 ROW and remove second IF condition, use Sy-Subrc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if s_proj[] is not initial.&lt;/P&gt;&lt;P&gt;select aufnr&lt;/P&gt;&lt;P&gt;from aufk&lt;/P&gt;&lt;P&gt;into table it_val_aufk where aufnr&lt;/P&gt;&lt;P&gt;in s_proj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0&lt;/P&gt;&lt;P&gt;message e012(ZXM7).&lt;/P&gt;&lt;P&gt;endif.&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;Bala Krishna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Bala Krishna on Nov 11, 2008 1:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 07:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724622#M1109235</guid>
      <dc:creator>former_member585060</dc:creator>
      <dc:date>2008-11-11T07:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: validation on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724623#M1109236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

if s_proj[] is not initial.
select aufnr
from aufk
into table it_val_aufk 
where aufnr
in s_proj.

if it_val_aufk[] is initial.
message e012(ZXM7).
endif.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it_val_aufk[]  returns all the valid records for the data entered in the selection screen. Now If you want to check which record(s) that is entered in the screen is not valid, then u need to write ur logic to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 07:51:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724623#M1109236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T07:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: validation on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724624#M1109237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Its right that you need to remove UP TO 1 ROWS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i enter aufnr in ranges like 1234 "valid&lt;/P&gt;&lt;P&gt;4567 "not valid &lt;/P&gt;&lt;P&gt;still it wont validate for the second record &lt;/P&gt;&lt;P&gt;can you people suggest a better way to solve the above problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It is alright and thats how it works with select options. When you enter search criteria in the select-options, you can enter ranges. And at times it is not always necessary that there will be a correspding database record for each value of the the serach criteria.&lt;/P&gt;&lt;P&gt;For select-options, you should therefore only give error message if nothing was found and leave it otherwise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, imagine if the user gives a range of 1234 to 4567 around 3000 records. Imagine there are only 5 valid records among these 3000. In that case you don't want to end up giving message for the remaining invalid values. Besides that, the moment you give an error message for any one of the record, the program will stop executing and the user will have to restarat his selection once again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would say that for select-options, do not try to validate each and every value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 08:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724624#M1109237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T08:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: validation on selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724625#M1109238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnkx advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Nov 2008 08:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-on-selection-screen/m-p/4724625#M1109238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-11T08:08:20Z</dc:date>
    </item>
  </channel>
</rss>

