<?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: Problem in selection from data base with RANGE-TABLE. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438012#M545485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nirad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your coding is problematic. I assume that field SALESRLNO (of table ZNSLVWHDIMMD_LCL) probably means sales number (or sales order) and, thus, must not be empty. If this is correct then the first IF statement is probably wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
    wa_salesno-sign = 'I'.
    wa_salesno-option = 'EQ'.
    wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
    APPEND wa_salesno TO r_salesno.
    CLEAR : wa_salesno .
  else.
    REFRESH: r_salesno.  " means: select all sales numbers

" NOTE: If you fill the range like below this means that only sales order
"            with no sales number (= ' ', space) should be select.
" Thus, there will never be any sales order selected.
 *   wa_salesno-sign = 'I'.
 *   wa_salesno-option = 'EQ'.
 *   wa_salesno-LOW = space.
 *   APPEND wa_salesno TO r_salesno.
 *    CLEAR : wa_salesno .
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same logic applies to the second IF statement. If you want to select all BRANDID if none has been provided as selection criteria then code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  if  Stru_Cn_Selcrtr-ca_brand is not initial.
    wa_brandid-sign = 'I'.
    wa_brandid-option = 'EQ'.
    wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
    APPEND  wa_brandid TO  r_brandid.
    CLEAR :  wa_brandid .
  else.
    REFRESH: r_brandid.  " means: select all BRANDID

*    wa_brandid-sign = 'I'.
*    wa_brandid-option = 'EQ'.
*     wa_brandid-LOW = space.
* 
*    APPEND wa_brandid  TO  r_brandid.
*    CLEAR : wa_brandid  .
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2007 18:34:37 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2007-06-21T18:34:37Z</dc:date>
    <item>
      <title>Problem in selection from data base with RANGE-TABLE.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438011#M545484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear folks,&lt;/P&gt;&lt;P&gt;               I am facing weird problem with range table in selection query.I have problem with bold part of code.Here when i give input to both ranges r_salesno,r_brandid then and the selection occurs ,when i put black in one of those it does not work.I haev passed Empty table to range if no inpiut in elements..although it does not work..I dont know why it is happening...By the i m using this code in Webdynpro ABAP.Please help points will be awarded..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
    wa_salesno-sign = 'I'.
    wa_salesno-option = 'EQ'.
    wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
    APPEND wa_salesno TO r_salesno.
    CLEAR : wa_salesno .
  else.
    wa_salesno-sign = 'I'.
    wa_salesno-option = 'EQ'.
    wa_salesno-LOW = space.
    APPEND wa_salesno TO r_salesno.
     CLEAR : wa_salesno .
  endif.


  if  Stru_Cn_Selcrtr-ca_brand is not initial.
    wa_brandid-sign = 'I'.
    wa_brandid-option = 'EQ'.
    wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
    APPEND  wa_brandid TO  r_brandid.
    CLEAR :  wa_brandid .
  else.
    wa_brandid-sign = 'I'.
    wa_brandid-option = 'EQ'.
     wa_brandid-LOW = space.

    APPEND wa_brandid  TO  r_brandid.
    CLEAR : wa_brandid  .
  endif.

*If any of these are given then select data accordingly.
    &amp;lt;b&amp;gt;select * from ZNSLVWHDIMMD_LCL
             into corresponding fields of table IT_VIEW
             WHERE SALESRLNO in  r_salesno
*             and   CREATEDBY in It_crtby_selopt
*            and   STARTDATE in It_validfrm_selopt
*             and   ENDDATE   in It_validto_selopt
*             and  STATUS     in It_status_selopt1
             and   BRANDID   in r_brandid.
*             and   MODELNO   in It_model_selopt.&amp;lt;/b&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 15:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438011#M545484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T15:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in selection from data base with RANGE-TABLE.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438012#M545485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nirad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your coding is problematic. I assume that field SALESRLNO (of table ZNSLVWHDIMMD_LCL) probably means sales number (or sales order) and, thus, must not be empty. If this is correct then the first IF statement is probably wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; if  Stru_Cn_Selcrtr-ca_slsrl is not initial.
    wa_salesno-sign = 'I'.
    wa_salesno-option = 'EQ'.
    wa_salesno-LOW = Stru_Cn_Selcrtr-ca_slsrl.
    APPEND wa_salesno TO r_salesno.
    CLEAR : wa_salesno .
  else.
    REFRESH: r_salesno.  " means: select all sales numbers

" NOTE: If you fill the range like below this means that only sales order
"            with no sales number (= ' ', space) should be select.
" Thus, there will never be any sales order selected.
 *   wa_salesno-sign = 'I'.
 *   wa_salesno-option = 'EQ'.
 *   wa_salesno-LOW = space.
 *   APPEND wa_salesno TO r_salesno.
 *    CLEAR : wa_salesno .
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same logic applies to the second IF statement. If you want to select all BRANDID if none has been provided as selection criteria then code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  if  Stru_Cn_Selcrtr-ca_brand is not initial.
    wa_brandid-sign = 'I'.
    wa_brandid-option = 'EQ'.
    wa_brandid-LOW = Stru_Cn_Selcrtr-ca_brand.
    APPEND  wa_brandid TO  r_brandid.
    CLEAR :  wa_brandid .
  else.
    REFRESH: r_brandid.  " means: select all BRANDID

*    wa_brandid-sign = 'I'.
*    wa_brandid-option = 'EQ'.
*     wa_brandid-LOW = space.
* 
*    APPEND wa_brandid  TO  r_brandid.
*    CLEAR : wa_brandid  .
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 18:34:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438012#M545485</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-06-21T18:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in selection from data base with RANGE-TABLE.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438013#M545486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have solved this problem with dynamic selection at my own .By the way thankx for looking at problem and i have awarded points to you.Have a good day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        nirad pachchigar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 19:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438013#M545486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T19:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in selection from data base with RANGE-TABLE.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438014#M545487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved by Dynamic Selection of data according to fields selected on selcection screen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2007 19:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selection-from-data-base-with-range-table/m-p/2438014#M545487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-21T19:50:09Z</dc:date>
    </item>
  </channel>
</rss>

