<?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 statement with where clause in web dynpro application in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315665#M1636848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use RANGES in the where stament so in case the field is empty, you select all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lr_category LIKE RANGE OF itab-category,
            ls_category LIKE LINE OF lr_category.

ls_category-sign = 'I'.
ls_category-option = 'EQ'.
loop at itab.
ls_category-low = itab-category.
insert ls_category into table lr_category.
* Add here other fields
endloop.


SELECT *
INTO CORRESPONDING FIELDS OF ls_role
FROM zgr_llt_table
FOR ALL ENTRIES IN itab
WHERE category IN lr_category.
* AND otherfield IN lr_otherfield.... etc....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2011 14:42:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-30T14:42:30Z</dc:date>
    <item>
      <title>Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315660#M1636843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developing a  web dynpro application where i have several search parameters . i am trying to query the database and provide refined search results to a alv table based on the search parameters . i am unable to make multiple search parameters work and when i am leaving one search parameter blank and selecting others. . Can anyone provide me with example on how the select statement is written with where clause including multiple search parameters .  i am new to web dynpro .. kindly help with this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 10:18:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315660#M1636843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T10:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315661#M1636844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am developing a  web dynpro application where i have several search parameters . i am trying to query the database and provide refined search results to a alv table based on the search parameters . i am unable to make multiple search parameters work and when i am leaving one search parameter blank and selecting others. . Can anyone provide me with example on how the select statement is written with where clause including multiple search parameters .  i am new to web dynpro .. kindly help with this.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no difference in the selection query, it will be the same as in normal abap. for your convinence i am sharing an example of selection query as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA LOC_MATNR TYPE MARA-MATNR.
SELECT MATNR FROM MARA INTO LOC_MATNR WHERE WERKS = 'EP02'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;sahai.s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 10:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315661#M1636844</guid>
      <dc:creator>sahai</dc:creator>
      <dc:date>2011-11-30T10:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315662#M1636845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;  INTO   CORRESPONDING FIELDS OF ls_role&lt;/P&gt;&lt;P&gt;  FROM   zgr_llt_table&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN itab&lt;/P&gt;&lt;P&gt;  WHERE ( category = itab-category or category = ' ')  and ( sow = itab-sow  or sow = ' ' )   and ( phase = itab-phase or phase = ' ' )&lt;/P&gt;&lt;P&gt;      and  ( type1 = itab-type1 or type1  = ' '  ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i am not selecting any one of the field it is not executing .when i select all select fields then only its working.&lt;/P&gt;&lt;P&gt;can u tell me that solution for that problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 11:01:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315662#M1636845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T11:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315663#M1636846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;&amp;gt;   INTO   CORRESPONDING FIELDS OF ls_role&lt;/P&gt;&lt;P&gt;&amp;gt;   FROM   zgr_llt_table&lt;/P&gt;&lt;P&gt;&amp;gt;   FOR ALL ENTRIES IN itab&lt;/P&gt;&lt;P&gt;&amp;gt;   WHERE ( category = itab-category or category = ' ')  and ( sow = itab-sow  or sow = ' ' )   and ( phase = itab-phase or phase = ' ' )&lt;/P&gt;&lt;P&gt;&amp;gt;       and  ( type1 = itab-type1 or type1  = ' '  ).&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; if i am not selecting any one of the field it is not executing .when i select all select fields then only its working.&lt;/P&gt;&lt;P&gt;&amp;gt; can u tell me that solution for that problem&lt;/P&gt;&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;PRE&gt;&lt;CODE&gt;SELECT *
INTO CORRESPONDING FIELDS OF table ls_role       " here you have missed writing table ahead of ls_role
FROM zgr_llt_table
FOR ALL ENTRIES IN itab
WHERE ( category = itab-category or category = ' ') and ( sow = itab-sow or sow = ' ' ) and ( phase = itab-phase or phase = ' ' )
and ( type1 = itab-type1 or type1 = ' ' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check it out.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 11:06:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315663#M1636846</guid>
      <dc:creator>sahai</dc:creator>
      <dc:date>2011-11-30T11:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315664#M1636847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is nothing Web Dynpro specific about writing select statements.  In fact you shouldn't even have SQL in your Web Dynpro Component, but in the underlying model.  Your quesiton about Select statements is in fact a general ABAP question and belongs in the corresponding forum.  I am moving this thread to ABAP General.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 12:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315664#M1636847</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2011-11-30T12:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement with where clause in web dynpro application</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315665#M1636848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use RANGES in the where stament so in case the field is empty, you select all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lr_category LIKE RANGE OF itab-category,
            ls_category LIKE LINE OF lr_category.

ls_category-sign = 'I'.
ls_category-option = 'EQ'.
loop at itab.
ls_category-low = itab-category.
insert ls_category into table lr_category.
* Add here other fields
endloop.


SELECT *
INTO CORRESPONDING FIELDS OF ls_role
FROM zgr_llt_table
FOR ALL ENTRIES IN itab
WHERE category IN lr_category.
* AND otherfield IN lr_otherfield.... etc....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 14:42:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-with-where-clause-in-web-dynpro-application/m-p/8315665#M1636848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T14:42:30Z</dc:date>
    </item>
  </channel>
</rss>

