<?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 option using 2 different fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065844#M93240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select option you will still have to use the high and low values as you will compare with two different database fields . You can use Select option with NO-EXTENSION so that user can enter only two vales ( from &amp;amp; To ). But you just cannot use this select option directly in where clasue &amp;lt;FIELD&amp;gt; IN &amp;lt;SOPTION&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not use SELECTION-SCREEN BEGIN OF LINE / END OF LINE to put two parameters on same line which will look like a select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Oct 2005 01:15:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-21T01:15:19Z</dc:date>
    <item>
      <title>select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065838#M93234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guyz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to use select option for payroll period &amp;amp; start date is T549Q-BEGDA and end date is T549Q-ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i use selection screen in this case???????&lt;/P&gt;&lt;P&gt;If yes.....&lt;/P&gt;&lt;P&gt;how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 00:13:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065838#M93234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T00:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065839#M93235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you can use a Select Option, but you will also need to be a bit creative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
parameters:     p_permo like t549q-permo obligatory,
                p_pabrj like t549q-pabrj obligarory.
select-options: s_pabrp for t549q-pabrp.

ranges: r_datum for sy-datum.

data: begin of tbl_pabrp occurs 0,
        pabrp  like t549q-pabrp,
        begda  like t549q-begda,
        endda  like t549q-endda,
      end of tbl_pabrp.

select pabrp begda endda
       into table tbl_pabrp
       from t549q
       where permo eq p_permo and
             pabrj eq p_pabrj and
             pabrp in s_pabrp.

check sy-subrc eq 0.
* Now TBL_PABRP will have the range of Start and End Dates
* We want to put these Start / End Dates into the Range 
* R_DATUM

loop at tbl_pabrp.
  clear r_datum.
  r_datum-sign   = 'I'.
  r_datum-option = 'BT'.
  r_datum-low    = tbl_pabrp-begda.
  r_datum-high   = tbl_pabrp-endda.
  append r_datum.
endloop.

* Now R_DATUM will be a range that contains the Start and 
* End Dates of a range of Payroll Periods
* You can now use R_DATUM in the WHERE clause of your 
* SELECT statements
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. Kindly assign Reward Points to the posts you find helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 00:26:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065839#M93235</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-10-21T00:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065840#M93236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi pat,&lt;/P&gt;&lt;P&gt;thanx for the reply but the user wants to enter the dates in the mm/dd/yyyy format in the input fields which he cant do if we do it this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user wants to see the screen similar to what we can provide him with select-options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can we do that?????????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 00:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065840#M93236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T00:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065841#M93237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh I see....sorry about the misunderstanding....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do they require to have a range of Start Dates and a Range of End Dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 01:03:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065841#M93237</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-10-21T01:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065842#M93238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no sir&lt;/P&gt;&lt;P&gt;they just want to enter start date &amp;amp; end date.&lt;/P&gt;&lt;P&gt;we can do it using 2 parameters but just wanted to know if select-options can be used...............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 01:08:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065842#M93238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T01:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065843#M93239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well in that case I would recommend simply using the 2 parameters. You can theoretically use a select option, but it will require the user to ALWAYS enter in a Low and High date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select-options s_datum for sy-datum.

read table s_datum index 1.

select *
       from t549q
       where begda = s_datum-low  and
             endda = s_datum-high.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if the user does not enter in both low and high values, or enter in multiple values you will start having problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are much better off using te 2 parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
parameters: p_low  like sy-datum,
            p_high like sy-datum.

select *
       from t549q
       where begda = p_low   and
             endda = p_high.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 01:15:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065843#M93239</guid>
      <dc:creator>former_member221770</dc:creator>
      <dc:date>2005-10-21T01:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065844#M93240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select option you will still have to use the high and low values as you will compare with two different database fields . You can use Select option with NO-EXTENSION so that user can enter only two vales ( from &amp;amp; To ). But you just cannot use this select option directly in where clasue &amp;lt;FIELD&amp;gt; IN &amp;lt;SOPTION&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not use SELECTION-SCREEN BEGIN OF LINE / END OF LINE to put two parameters on same line which will look like a select option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 01:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065844#M93240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T01:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: select option using 2 different fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065845#M93241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yea&lt;/P&gt;&lt;P&gt;i am also planning to do the same&lt;/P&gt;&lt;P&gt;anyway thanx man&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2005 01:20:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-option-using-2-different-fields/m-p/1065845#M93241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-21T01:20:08Z</dc:date>
    </item>
  </channel>
</rss>

