<?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: selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828762#M353387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens &lt;/P&gt;&lt;P&gt;  This is my exact requirement&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;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Feb 2007 14:25:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-02T14:25:46Z</dc:date>
    <item>
      <title>selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828754#M353379</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 have a parameter A and b, i need to validate parameter A with the database table wheather parameter  A is exist or not and paramter shpuld be validated against internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls provide code for the above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828754#M353379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828755#M353380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. We can do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from dbtable&lt;/P&gt;&lt;P&gt;where field1 = A.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  message 'A Not found' type 'I'.&lt;/P&gt;&lt;P&gt;  leave list-processing.&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;read table ITAB with key field1 = B.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  message 'B Not found' type 'I'.&lt;/P&gt;&lt;P&gt;  leave list-processing.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:27:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828755#M353380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828756#M353381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;karthik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this is available on help.sap.com&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT selection-screen on a.

  select count( * ) from &amp;lt;database&amp;gt; where &amp;lt;field&amp;gt; = a.
if sy-subrc &amp;lt;&amp;gt; 0.
  message Ennn with a 'does not exist'.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828756#M353381</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-02-02T13:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828757#M353382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;at selection-screen for a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * from &amp;lt;the master table for parameter A) where &amp;lt;field&amp;gt; = a.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e001(zz) with 'Invalid value'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen for b.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Iassume that you have the internal table to validate against ready.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table itab with key field = b.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e001(zz) with 'Invalid value for B'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:28:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828757#M353382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828758#M353383</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;If you want to do the validation at selection screen then you can validate one variable at selection screen whicn you need to validate with databse. Or you can validate both the values at start of selection.&lt;/P&gt;&lt;P&gt;Use AT SELECTION-SCREEN event.&lt;/P&gt;&lt;P&gt;Select single field from dbtable&lt;/P&gt;&lt;P&gt;where field1 = A.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  Error message.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For internal table do the validation at Start-of-selection screen event.&lt;/P&gt;&lt;P&gt;Read table ITAB with key field1 = B.&lt;/P&gt;&lt;P&gt;If sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; Error message.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashvender&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828758#M353383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828759#M353384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;parameter :p_werks like marc-werks.&lt;/P&gt;&lt;P&gt;parameter :p_matnr like mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this in at selection screen  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection screen.&lt;/P&gt;&lt;P&gt;select single werks into v_werks from t001w where werks = p_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;write:/ 'plant exits '&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;message e001 (zxx) with 'Plant dosent exist'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same &lt;/P&gt;&lt;P&gt;select single matnr into v_matnr from  mara where matnr = p_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//parameter A is exist or not and paramter shpuld be validated against internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if im doing the validation here then it is enough .  &lt;/P&gt;&lt;P&gt;cause error is thrown here cause start of selection is not yet triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now if i do a select internal table will contain only valid entries of Db so y do i need to do the validation unless im making some criteria .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex material 'raw ' is defined in plants 1001 2001 3001 then i can do a validation whether it exists for plant or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single matnr into v_matnr from marc where &lt;/P&gt;&lt;P&gt;matnr = p_matnr and werks = p_werks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with same effect&lt;/P&gt;&lt;P&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;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:37:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828759#M353384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828760#M353385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I have a field A with the values in the internal table, i need to check those values exits in the table B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls send code for the above &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 13:49:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828760#M353385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T13:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828761#M353386</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;is this a refinement or a new question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 14:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828761#M353386</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-02-02T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828762#M353387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens &lt;/P&gt;&lt;P&gt;  This is my exact requirement&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;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 14:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828762#M353387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T14:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828763#M353388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;execute the code ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of itab occurs 0,
       f1(4) type c,
       f2(4) type c,
       end of itab.

data : begin of jtab occurs 0,
       f1(4) type c,
       f2(4) type c,
       end of jtab.

*table a
       itab-f1 = '0001'.
       itab-f2 = 'pppp'.
       append itab.

       itab-f1 = '0002'.
       itab-f2 = 'pppp'.
       append itab.

**table b
       jtab-f1 = '0007'.
       jtab-f2 = 'abcd'.
       append jtab.

       jtab-f1 = '0002'. "common entry of table a
       jtab-f2 = 'efgh'.
       append jtab.


sort itab by f1.
sort jtab by f1.

     loop at itab.
     read table jtab with key f1 = itab-f1.
     if sy-subrc = 0.
     write:/ 'Common in table A and B' , itab-f1.
     endif .
     endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 14:33:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen/m-p/1828763#M353388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T14:33:29Z</dc:date>
    </item>
  </channel>
</rss>

