<?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: SELECT-OPTIONS: in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475820#M835488</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;I want to validate field with respective table bsad, whether the entry made in select-option is ther in the database or not? if not it has to throw error message???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Feb 2008 13:39:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-29T13:39:26Z</dc:date>
    <item>
      <title>SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475816#M835484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to validate many fields for select-options,so can any guide me regarding the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: A1 for bsad-kunnr,&lt;/P&gt;&lt;P&gt;                              a2 for bsad-belnr,&lt;/P&gt;&lt;P&gt;                              a3 for bsad-blart,&lt;/P&gt;&lt;P&gt;                              a4 for bsad-waers,&lt;/P&gt;&lt;P&gt;                              a4 for bsad-bldat,&lt;/P&gt;&lt;P&gt;                              a5 for bsad-budat,&lt;/P&gt;&lt;P&gt;                              a6 for bsad-sgtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewarded if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 10:54:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475816#M835484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T10:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475817#M835485</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;&lt;/P&gt;&lt;P&gt;Use Event AT SELECTION SCREEN on &amp;lt;Field&amp;gt;.&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;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 11:00:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475817#M835485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T11:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475818#M835486</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;Do check the example code, this might give you some idea how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zdummy_atg_2 message-id 000.
 
TABLES: SPFLI.
 
SELECTION-SCREEN BEGIN OF BLOCK TEST.
SELECT-OPTIONS:
              S_CARRID FOR SPFLI-CARRID.
SELECTION-SCREEN END OF BLOCK TEST.
 
AT SELECTION-SCREEN.
READ TABLE S_CARRID INDEX 1.
IF S_CARRID-HIGH LT S_CARRID-LOW.
  MESSAGE E000 WITH 'Error'.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 11:05:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475818#M835486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T11:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475819#M835487</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;select-options p1 for zcust_master2-zcustid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;if p1-high &amp;lt; p1-low.&lt;/P&gt;&lt;P&gt;message ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Arunsri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 12:01:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475819#M835487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T12:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475820#M835488</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;I want to validate field with respective table bsad, whether the entry made in select-option is ther in the database or not? if not it has to throw error message???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Feb 2008 13:39:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475820#M835488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-29T13:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475821#M835489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; data it_bsad type table of bsad.
SELECT-OPTIONS: A1 for bsad-kunnr,
a2 for bsad-belnr,
a3 for bsad-blart,
a4 for bsad-waers,
a5 for bsad-bldat,
a6 for bsad-budat,
a7 for bsad-sgtxt.

at selection-screen

select * from bsad into table it_bsad
where kunnr in a1 
and     belnr in a2
and 	blart in a3
and     waers in a4
and     bldat in a5
and     budat in a6
and     sgtxt in a7.

if sy-subrc NE 0.
 message 'Entry not found' type 'E'.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I'm not sure the order of the fields in the where clause . So ensure the order of the fields in the where clause is as same as they appear in the bsad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the at selection-screen event will be called after u press enter or execute on the selection screen , if any of the select option is empty, it will be ignored in the select query and the records fetched from the database will be fetched which meet criteria with the entered values in the selection screen (its almost like accessing data from data browser se16) . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it solves your problem. Don't forget to reward points &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Advait Gode on Mar 1, 2008 7:11 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Mar 2008 18:09:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475821#M835489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-01T18:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475822#M835490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi moni,&lt;/P&gt;&lt;P&gt;the above code will work fine if you want o/p with any one or more select option. but if u want to validate each individyual filed then you have to proceed as follow..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. use event 'AT SELECTIOON SCREEN ON FILED&amp;lt;F1&amp;gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE A SELECT QUERY AS..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM TAB1 UP TO 1 ROW WHERE FILED &amp;lt;x&amp;gt; IN S_FILED&amp;lt;X&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC&amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE e001(00) WITH S_FIELD1 &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REAPEAT ABOVE CODE FOR ALL THE FILEDS IN RESPECTIVE AT SELECTION SCREEN ON ...EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF U HAVE THE SAME TABLE , THINK OF WRITING ONE SUBROUTINE AND PASS THE SELCT OPTION ONLY AS PARAMETER.&lt;/P&gt;&lt;P&gt;SO EACH TIME JUST CALL THE SAME SUBROUTINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THIS WILL GIVE YOU MODULERISED CODE AND SOLVE YOUR PURPOSE TO..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Mar 2008 07:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475822#M835490</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-02T07:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT-OPTIONS:</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475823#M835491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also we need not to check for high and low value , system automatically detects the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Mar 2008 07:09:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-options/m-p/3475823#M835491</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-02T07:09:20Z</dc:date>
    </item>
  </channel>
</rss>

