<?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: Can Data Declaration be dynamic? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329893#M1638087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Dec 2011 06:17:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-01T06:17:13Z</dc:date>
    <item>
      <title>Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329886#M1638080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to build dynamic select clause for a report . I pass all the select options from the report to Class.&lt;/P&gt;&lt;P&gt;In class I have an attribute my_ranges (type table of ref to data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the method build_dynamic_clause I write&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: l_range_1 type ref to data,
         l_range_2 type ref to data,
        like that til l_range_10.

*now i read table my_ranges with index addition to this individual variables*
read table my_ranges assigning l_range_1 index 1
like that till 10th index.

*Now I use this individual range variables in select like*
select * from (l_table_name) where field1 in l_range-&amp;gt;*
and field2 in l_range_2-&amp;gt;* 

Like that

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is I dont know how many select options is passed from the report . Currently the report is handling only up to 10 select options . I want to make that dynamic by declaring variables (l_range_1 to l_range_n ).&lt;/P&gt;&lt;P&gt;Depending on the my_ranges number of entries ,EACH variables should be declared dynamically and then we can use it in dynamic select .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kallu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 04:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329886#M1638080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-27T04:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329887#M1638081</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 this blog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="40639"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 07:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329887#M1638081</guid>
      <dc:creator>huseyindereli</dc:creator>
      <dc:date>2011-11-27T07:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329888#M1638082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you pass your ranges in table like parameter, I think you don't need any dynamic ranges defined inside the class. Simply loop at your ranges and build [dynamic where condition|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_DYNAMIC.htm] by concatenating each line. Then pass it to your select clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 16:50:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329888#M1638082</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-11-27T16:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329889#M1638083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually [this blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/15837] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;; (also by Horst Keller) might be more appropriate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham Robbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Nov 2011 21:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329889#M1638083</guid>
      <dc:creator>GrahamRobbo</dc:creator>
      <dc:date>2011-11-27T21:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329890#M1638084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply . But its not that easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 400 to 500 select options in the report . I dont want to declare this many select option ranges inside the class.&lt;/P&gt;&lt;P&gt;Moreover I am reusing the attributes to build the selection clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to declare this local variables inside the class method dynamcially( l_range_1 to l_range_n ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kallu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 04:26:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329890#M1638084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-28T04:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329891#M1638085</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;You can check my reply here for creating ranges dynamically inside the program &lt;SPAN __jive_macro_name="thread" id="1750853"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You say that the number of ranges in the parameter is not predictable, but the fields in the select query are fixed right. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the select query create a where clause with all fields have a range parameter. Fill the range table when an entry comes in parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from abc where f1 in r1 "&amp;lt;--if r1 is required then populate it, else leave it blank
                                 and f2 in r2 "&amp;lt;--if r2 is required then populate it, else leave it blank
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still I am bit confused with your question &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 05:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329891#M1638085</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-11-28T05:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329892#M1638086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont  want to declare ranges attributes(400-500) inside the class because there are so many of them which are passed to the class from the report . ie y I build up the my_ranges type ref to table of data inside the class for each select options in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a way my reqment is similar with the Indrajit in link that you gave me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet provided by you will cause the field symbol &amp;lt;fs&amp;gt; changed in each loop pass and point to a different range&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason I need separate range names (or pointers l_range_1 to l_range_n) is because I will use the same to populate 'where' clause of a select statement that gets executed after&lt;/P&gt;&lt;P&gt;the loop is over. So when the select statement gets executed, all the ranges should exist in class and be declared, else dynamic select clause will be syntactically incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess dynamic declaration of variables is not possible in ABAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kallu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: KALLU MANACAUD on Nov 28, 2011 9:57 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message : Code tags removed &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar on Nov 28, 2011 4:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 08:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329892#M1638086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-28T08:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329893#M1638087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 06:17:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329893#M1638087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-01T06:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can Data Declaration be dynamic?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329894#M1638088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;halo rshankar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the answer is no where related to the question that i asked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Takeing your own data declaration.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: prog TYPE string,
mess TYPE string,
sid TYPE string. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose i have an itab which contains this variable names ('prog',sid','mess').&lt;/P&gt;&lt;P&gt;I shud be able to do something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;data:(the value inside wa = &amp;gt;prog) type string.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kallu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: KALLU MANACAUD on Dec 2, 2011 9:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 08:42:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-data-declaration-be-dynamic/m-p/8329894#M1638088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-02T08:42:21Z</dc:date>
    </item>
  </channel>
</rss>

