<?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: Parameters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440034#M209422</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;&amp;lt;b&amp;gt;No DATA will be fetched when parameters is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun.

TABLES : mara.

DATA : it_mara_par TYPE STANDARD TABLE OF mara,
       it_mara_sel TYPE STANDARD TABLE OF mara,
       par_cnt TYPE i,
       sel_cnt TYPE i.

PARAMETERS     : p_matnr TYPE mara-matnr.
SELECT-OPTIONS : s_mtart FOR mara-mtart.


START-OF-SELECTION.
  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr AND
                                                                 mtart IN s_mtart.

  DESCRIBE TABLE it_mara_par LINES par_cnt.

*Lets clear parameter and see the result
  CLEAR p_matnr.

  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr AND
                                                                 mtart IN s_mtart.

  DESCRIBE TABLE it_mara_sel LINES sel_cnt.

  WRITE : / 'No of Records Fetched',
          / 'PARAMETERS WITH DATA    :' , par_cnt,
          / 'PARAMETERS WITH NO DATA :' , sel_cnt.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The reason is that.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)Select-options with "NO INTERVALS NO-EXTENSION" and PARAMETERS are displayed as the same on the selection screen then why they are used??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you dint give any value in selection screen for PARAMETERS, none of the records will be fetched when it is used in the WHERE clause of a SELECT statement. But when no input is given in SELECT-OPTION and used in the WHERE clause of SELECT statement, all the records for the corresponding key will be fetched. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun.

  TABLES : mara.
  DATA : it_mara_par TYPE STANDARD TABLE OF mara,
         it_mara_sel TYPE STANDARD TABLE OF mara,
         par_cnt TYPE i,
         sel_cnt TYPE i.

  PARAMETERS     : p_matnr TYPE mara-matnr.
  SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS NO-EXTENSION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*This option works same like PARAMETERS statement. The difference is that&lt;/P&gt;&lt;P&gt;*if no input value is passed in the selection screen no records are fetched&lt;/P&gt;&lt;P&gt;*for the PARAMETERS statement.... Whereas for SELECT-OPTIONS --- NO INTERVALS NO-EXTENSION.&lt;/P&gt;&lt;P&gt;*all the values will be fetched if no input is specified.START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*I am limiting the values to be fetched to 200 else it will take a lot of time.&lt;/P&gt;&lt;P&gt;**Dont give any values in the selecton screen and execute the program.&lt;/P&gt;&lt;P&gt;**No record will be fetched for PARAMETERS option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr.
  DESCRIBE TABLE it_mara_par LINES par_cnt.

*All records in the table will be fetched for SELECT-OPTIONS --- NO INTERVALS NO-EXTENSION option

  SELECT * FROM mara INTO TABLE it_mara_sel UP TO 200 ROWS WHERE matnr IN s_matnr.

  DESCRIBE TABLE it_mara_sel LINES sel_cnt.

  WRITE : / 'No of Records Fetched when no data passed to Selection Screen',
  / 'PARAMETERS     :' , par_cnt,
  / 'SELECT-OPTIONS :' , sel_cnt.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2006 15:33:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-19T15:33:02Z</dc:date>
    <item>
      <title>Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440030#M209418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a parameter is used in a select statement and if it is initial.  how will it be treated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from keko into table xkeko&lt;/P&gt;&lt;P&gt;            where matnr in s_matnr&lt;/P&gt;&lt;P&gt;              and werks in s_werks&lt;/P&gt;&lt;P&gt;              and kokrs eq p_kokrs&lt;/P&gt;&lt;P&gt;              and klvar EQ p_klvar&lt;/P&gt;&lt;P&gt;              and tvers EQ p_tvers&lt;/P&gt;&lt;P&gt;              and kadky EQ p_kadky&lt;/P&gt;&lt;P&gt;              and losgr EQ p_losgr&lt;/P&gt;&lt;P&gt;            order by kalnr kadky descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If some of the parameters above are not filled with a value and are initial ; will the records being pulled be looked for a blank value in those parameters or used as a wildcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance..!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440030#M209418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T15:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440031#M209419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the parameter is initial, the select querz will serach for the blank value in the table for that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if u want to pick all the record when it is blank then built a range table and pass to the querz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:05:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440031#M209419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T15:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440032#M209420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The select statement will only bring records which the values are blank.  If you want it to bring all if the field is blank, like wild card, you should use SELECT-OPTIONS that look like parameters.&lt;/P&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-options: s_bukrs for t001-bukrs no intervals no-extension.

Select 
   .....
      where bukrs in s_bukrs.



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. &lt;/P&gt;&lt;P&gt;Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points. &lt;/P&gt;&lt;P&gt;Spread the wor(l)d!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440032#M209420</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-19T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440033#M209421</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 parameter is blank in the select &lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;its initial value will be used for selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex&lt;/P&gt;&lt;P&gt;if parameter is date ...00000000 will be used in select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Time then ......000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if char1.........then space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if int ...........0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of select-option ....it will be drop form the select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in case of Like ....it will be dropped from the select query&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:17:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440033#M209421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T15:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Parameters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440034#M209422</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;&amp;lt;b&amp;gt;No DATA will be fetched when parameters is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun.

TABLES : mara.

DATA : it_mara_par TYPE STANDARD TABLE OF mara,
       it_mara_sel TYPE STANDARD TABLE OF mara,
       par_cnt TYPE i,
       sel_cnt TYPE i.

PARAMETERS     : p_matnr TYPE mara-matnr.
SELECT-OPTIONS : s_mtart FOR mara-mtart.


START-OF-SELECTION.
  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr AND
                                                                 mtart IN s_mtart.

  DESCRIBE TABLE it_mara_par LINES par_cnt.

*Lets clear parameter and see the result
  CLEAR p_matnr.

  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr AND
                                                                 mtart IN s_mtart.

  DESCRIBE TABLE it_mara_sel LINES sel_cnt.

  WRITE : / 'No of Records Fetched',
          / 'PARAMETERS WITH DATA    :' , par_cnt,
          / 'PARAMETERS WITH NO DATA :' , sel_cnt.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The reason is that.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)Select-options with "NO INTERVALS NO-EXTENSION" and PARAMETERS are displayed as the same on the selection screen then why they are used??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you dint give any value in selection screen for PARAMETERS, none of the records will be fetched when it is used in the WHERE clause of a SELECT statement. But when no input is given in SELECT-OPTION and used in the WHERE clause of SELECT statement, all the records for the corresponding key will be fetched. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest_arun.

  TABLES : mara.
  DATA : it_mara_par TYPE STANDARD TABLE OF mara,
         it_mara_sel TYPE STANDARD TABLE OF mara,
         par_cnt TYPE i,
         sel_cnt TYPE i.

  PARAMETERS     : p_matnr TYPE mara-matnr.
  SELECT-OPTIONS : s_matnr FOR mara-matnr NO INTERVALS NO-EXTENSION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*This option works same like PARAMETERS statement. The difference is that&lt;/P&gt;&lt;P&gt;*if no input value is passed in the selection screen no records are fetched&lt;/P&gt;&lt;P&gt;*for the PARAMETERS statement.... Whereas for SELECT-OPTIONS --- NO INTERVALS NO-EXTENSION.&lt;/P&gt;&lt;P&gt;*all the values will be fetched if no input is specified.START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*I am limiting the values to be fetched to 200 else it will take a lot of time.&lt;/P&gt;&lt;P&gt;**Dont give any values in the selecton screen and execute the program.&lt;/P&gt;&lt;P&gt;**No record will be fetched for PARAMETERS option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT * FROM mara INTO TABLE it_mara_par UP TO 200 ROWS WHERE matnr EQ p_matnr.
  DESCRIBE TABLE it_mara_par LINES par_cnt.

*All records in the table will be fetched for SELECT-OPTIONS --- NO INTERVALS NO-EXTENSION option

  SELECT * FROM mara INTO TABLE it_mara_sel UP TO 200 ROWS WHERE matnr IN s_matnr.

  DESCRIBE TABLE it_mara_sel LINES sel_cnt.

  WRITE : / 'No of Records Fetched when no data passed to Selection Screen',
  / 'PARAMETERS     :' , par_cnt,
  / 'SELECT-OPTIONS :' , sel_cnt.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 15:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parameters/m-p/1440034#M209422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-19T15:33:02Z</dc:date>
    </item>
  </channel>
</rss>

