<?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: Creating Dynamic Ranges in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398506#M192835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dnyanesh,&lt;/P&gt;&lt;P&gt;    The following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges: R_test for tab-field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is similar to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF R_test OCCURS 10, &lt;/P&gt;&lt;P&gt;         SIGN(1), &lt;/P&gt;&lt;P&gt;         OPTION(2), &lt;/P&gt;&lt;P&gt;         LOW  LIKE f, &lt;/P&gt;&lt;P&gt;         HIGH LIKE f, &lt;/P&gt;&lt;P&gt;      END   OF R_test. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can try assigning LOW and HIGH value dynamically depending upon table and field.&lt;/P&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;Regards,&lt;/P&gt;&lt;P&gt;Kinshuk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jun 2006 15:51:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-26T15:51:45Z</dc:date>
    <item>
      <title>Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398502#M192831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create ranges dynamically....&lt;/P&gt;&lt;P&gt;Suppose user enters tabelname and fieldname&lt;/P&gt;&lt;P&gt;then I want to create ranges accordingly....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Dnyanesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:28:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398502#M192831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-26T15:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398503#M192832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tamboli,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges are like a select option like a low and a high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose for me lets take the date. low - 22/06/06, high - 26/06/06. I need to create a range for this dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ws_date type sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges f_date for ws_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f_date-low = 20060622.&lt;/P&gt;&lt;P&gt;f_date-high = 20060626.&lt;/P&gt;&lt;P&gt;f_date-sign = 'I'.&lt;/P&gt;&lt;P&gt;f_date-option = 'BT'.&lt;/P&gt;&lt;P&gt;append f_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now this range f_date will have the value between 22/06/06 to 26/06/06. If you have to check the value between these two dates you check by this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ws_prdate = 20060624. (24/06/06)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ws_prdate in f_date.&lt;/P&gt;&lt;P&gt;   write: / "Valid date".&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves ur issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398503#M192832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-26T15:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398504#M192833</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;check below code.............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RANGES: d_proto FOR rspotype-deldate,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear : d_proto.&lt;/P&gt;&lt;P&gt;refresh:d_proto&lt;/P&gt;&lt;P&gt;d_proto-option = 'EQ'.&lt;/P&gt;&lt;P&gt;d_proto-sign = 'I'.&lt;/P&gt;&lt;P&gt;d_proto-high = '20061231'.&lt;/P&gt;&lt;P&gt;d_proto-low = '20060101'.&lt;/P&gt;&lt;P&gt;append d_proto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laxman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:42:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398504#M192833</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-06-26T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398505#M192834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,  ranges and select-options are really internal tables.  So you can achieve this just be creating a dynamic internal table.  Please see the program below.  This should show you want you need to do .  Here the example is creating a range for the MATNR of MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001.

type-pools: slis.

field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,
               &amp;lt;dyn_wa&amp;gt;,
               &amp;lt;fs&amp;gt;.

data: it_fldcat type lvc_t_fcat.

data: imara type table of mara with header line.

selection-screen begin of block b1 with frame title text-001.
parameters: p_tabnm(30) type c default 'MARA'.
parameters: p_field(30) type c default 'MATNR'.
parameters: p_matnr type mara-matnr.
selection-screen end of block b1.

start-of-selection.

* Build the range
  perform build_dyn_itab.

* Add a range to the range
  assign component 'SIGN' of structure  &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs&amp;gt;.
  &amp;lt;fs&amp;gt; = 'I'.
  assign component 'OPTION' of structure  &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs&amp;gt;.
  &amp;lt;fs&amp;gt; = 'EQ'.
  assign component 'LOW' of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs&amp;gt;.
  &amp;lt;fs&amp;gt; = p_matnr.
  append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.

* Do the selection.
  select * from mara into table imara
               where matnr in &amp;lt;dyn_table&amp;gt;.

  loop at imara.
    write:/ imara-matnr, imara-mtart.
  endloop.


************************************************************************
*  Build_dyn_itab
************************************************************************
form build_dyn_itab.

  data: new_table type ref to data,
        new_line  type ref to data,
        wa_it_fldcat type lvc_s_fcat.

  clear wa_it_fldcat.
  wa_it_fldcat-fieldname  = 'SIGN'.
  wa_it_fldcat-datatype = 'CHAR'.
  wa_it_fldcat-intlen = 1.
  wa_it_fldcat-outputlen = 1.
  append wa_it_fldcat to it_fldcat .

  clear wa_it_fldcat.
  wa_it_fldcat-fieldname  = 'OPTION'.
  wa_it_fldcat-datatype = 'CHAR'.
  wa_it_fldcat-intlen = 2.
  wa_it_fldcat-outputlen = 2.
  append wa_it_fldcat to it_fldcat .

  clear wa_it_fldcat.
  wa_it_fldcat-fieldname  = 'LOW'.
  wa_it_fldcat-ref_field = p_field.
  wa_it_fldcat-ref_table = p_tabnm.
  append wa_it_fldcat to it_fldcat .

  clear wa_it_fldcat.
  wa_it_fldcat-fieldname  = 'HIGH'.
  wa_it_fldcat-ref_field = p_field.
  wa_it_fldcat-ref_table = p_tabnm.
  append wa_it_fldcat to it_fldcat .

* Create dynamic internal table and assign to FS
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
               exporting
                  it_fieldcatalog = it_fldcat
               importing
                  ep_table        = new_table.

  assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.

* Create dynamic work area and assign to FS
  create data new_line like line of &amp;lt;dyn_table&amp;gt;.
  assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.

endform.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398505#M192834</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-26T15:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398506#M192835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dnyanesh,&lt;/P&gt;&lt;P&gt;    The following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ranges: R_test for tab-field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is similar to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF R_test OCCURS 10, &lt;/P&gt;&lt;P&gt;         SIGN(1), &lt;/P&gt;&lt;P&gt;         OPTION(2), &lt;/P&gt;&lt;P&gt;         LOW  LIKE f, &lt;/P&gt;&lt;P&gt;         HIGH LIKE f, &lt;/P&gt;&lt;P&gt;      END   OF R_test. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can try assigning LOW and HIGH value dynamically depending upon table and field.&lt;/P&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;Regards,&lt;/P&gt;&lt;P&gt;Kinshuk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 15:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398506#M192835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-26T15:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic Ranges</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398507#M192836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please don't forget to award points for any helpful answers and mark as solved when solved completely.  Also, you might consider revisited other recent posts and doing the same.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jun 2006 17:30:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-ranges/m-p/1398507#M192836</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-26T17:30:15Z</dc:date>
    </item>
  </channel>
</rss>

