<?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: dynamic select in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397583#M192443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; appreciate your response. the year field in the table contains yyyymmdd but i have yyyy (in this ex 2006 = w_year) thats the reason i want to use ..where year like W_year% this will be called multiple times based on w_year. &lt;/P&gt;&lt;P&gt;hope i'm clear. your help will be rewarded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;venu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jun 2006 22:10:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-13T22:10:18Z</dc:date>
    <item>
      <title>dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397579#M192439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i need to select entires from a table based on year which i determine dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg w_year = '2006'.&lt;/P&gt;&lt;P&gt;I'm looking for something like this&lt;/P&gt;&lt;P&gt;select * from dbtable into .....where date like w_year%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; can someone help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;venu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397579#M192439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397580#M192440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venu,&lt;/P&gt;&lt;P&gt;I really dont see need of dynamic select.&lt;/P&gt;&lt;P&gt;Once you have the value of year, you can directly put it in the 'where' conddition of select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:03:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397580#M192440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397581#M192441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Venu,&lt;/P&gt;&lt;P&gt;   Why do you want to select the year dynamically??? once the year gets populated to the field(w_year) then use the field(w_year) in the select statement.&lt;/P&gt;&lt;P&gt;i.e,&lt;/P&gt;&lt;P&gt;   w_year = 2006. &lt;/P&gt;&lt;P&gt;select * from dbtable into .....where &amp;lt;b&amp;gt;date = w_year&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:05:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397581#M192441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397582#M192442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You build dynamic select if you derive the table or where conditions at run time. I dont see any need for the synamic select here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:05:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397582#M192442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397583#M192443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; appreciate your response. the year field in the table contains yyyymmdd but i have yyyy (in this ex 2006 = w_year) thats the reason i want to use ..where year like W_year% this will be called multiple times based on w_year. &lt;/P&gt;&lt;P&gt;hope i'm clear. your help will be rewarded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;venu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397583#M192443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397584#M192444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in that case do this way&lt;/P&gt;&lt;P&gt;  w_year = field(yyyymmddformat) + 0(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  now use this variable in the select.&lt;/P&gt;&lt;P&gt;i.e,&lt;/P&gt;&lt;P&gt;select * from dbtable into .....where date = w_year.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397584#M192444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397585#M192445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venu,&lt;/P&gt;&lt;P&gt;Declare internal table itab to hold data from dbtable.&lt;/P&gt;&lt;P&gt;You can try like this :&lt;/P&gt;&lt;P&gt;*Code starts&lt;/P&gt;&lt;P&gt;select * into itab from dbtable.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt; if itab-year CP w_year.&lt;/P&gt;&lt;P&gt;   continue.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;   delete itab.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;*Code ends &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally itab has all the relevant records from dbtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397585#M192445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397586#M192446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: BEGIN OF where_clause OCCURS 0,
        clause(72).
DATA: END OF where_clause.

CONCATENATE w_year
            '%'
       INTO where_clause-clause.
CONDENSE where_clause-clause NO-GAPS.

CONCATENATE 'DATE LIKE'
            where_clause-clause
       INTO where_clause-clause SEPARATED BY SPACE.

SELECT * FROM dbtable WHERE (where_clause).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 22:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397586#M192446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-13T22:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic select</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397587#M192447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venu,&lt;/P&gt;&lt;P&gt;Declare  2 temporary date variables.&lt;/P&gt;&lt;P&gt;l_date1 and l_date2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_Date1 like sy-datum,&lt;/P&gt;&lt;P&gt;      l_date2 like sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_date1(4) = w_year.&lt;/P&gt;&lt;P&gt;l_date1+4(4) = '0101'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_date2(4) = w_year.&lt;/P&gt;&lt;P&gt;l_date2+4(4) = '1231'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from dbtable into .....where date GE l_date1 and&lt;/P&gt;&lt;P&gt;                                      date le l_date2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should solve your problem.&lt;/P&gt;&lt;P&gt;Let me know if you need more inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2006 23:45:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-select/m-p/1397587#M192447</guid>
      <dc:creator>Puneet_Gupta</dc:creator>
      <dc:date>2006-06-13T23:45:50Z</dc:date>
    </item>
  </channel>
</rss>

