<?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: Could not used the variable in the inline declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187677#M1980460</link>
    <description>&lt;P&gt;Thanks &lt;A href="https://answers.sap.com/users/1091/sandra.rossi.html"&gt;Sandra Rossi&lt;/A&gt;  &amp;amp;  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt;  for the explanation, even in other languages like javascript also this is not possible, as it makes sense that the LHS type is dependent on the RHS type, but it will be based on the total RHS value type, in this case it will be &lt;/P&gt;&lt;P&gt;data(dyn_variable) =  (some value) + (dyn_variable(with undefined type))  =&amp;gt;  so an error.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2020 11:00:34 GMT</pubDate>
    <dc:creator>maheshpalavalli</dc:creator>
    <dc:date>2020-01-23T11:00:34Z</dc:date>
    <item>
      <title>Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187671#M1980454</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;I am trying to do a simple code like this one&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;loop at my_lines 
     reference into data(o_line).
  data(my_summ) = o_line-&amp;gt;my_quantity + my_sum. 
endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;(the objective is not to do a simple sum, this is just an example)&lt;/P&gt;
  &lt;P&gt;but, I have an error "my_sum is unknown"&lt;/P&gt;
  &lt;P&gt;is it a real limitation of the inline declaration ? &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 06:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187671#M1980454</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-01-22T06:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187672#M1980455</link>
      <description>&lt;P&gt;It looks like it is not possible, check the comment from  &lt;SPAN class="mention-scrubbed"&gt;horst.keller&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/05/23/abap-news-for-release-740-inline-declarations/#comment-349626"&gt;https://blogs.sap.com/2013/05/23/abap-news-for-release-740-inline-declarations/#comment-349626&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I couldn't understand the standard help terminology but I think they are talking about the same.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abendata_inline.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abendata_inline.htm&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Just like the statement DATA, an inline declaration does not open a local context for the current statement block. An inline declaration for a variable can only be made once within a context and the variable cannot yet be declared there using DATA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is this the same? that statement is super confusing for me &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 07:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187672#M1980455</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2020-01-22T07:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187673#M1980456</link>
      <description>&lt;P&gt;Typo in your code (my_summ -&amp;gt; my_sum).&lt;/P&gt;&lt;P&gt;No other choice than doing it in two steps:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(my_sum) = 0. 
loop at my_lines 
     reference into data(o_line).
  my_sum = o_line-&amp;gt;my_quantity + my_sum. 
endloop.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:32:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187673#M1980456</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-01-22T08:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187674#M1980457</link>
      <description>&lt;P&gt;I think you have right with this sentence &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Just like the statement DATA, an inline declaration does not open a local context for the current statement &lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;even if when we used FOR ... IN ...  the system do exactly the oposite &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:37:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187674#M1980457</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-01-22T08:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187675#M1980458</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; , yes I exactly do that. But ... I don't know why, but I did not like to use the DATA ... anymore. I try to avoid it as much as possible. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 08:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187675#M1980458</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-01-22T08:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187676#M1980459</link>
      <description>&lt;P&gt;This sentence explains that DATA(xxx) is just like DATA, it's not a new notion of "local context for the current statement block" like in other programming languages (in a method the same variable can be different if declared in separate { ... } blocks), and consequently DATA(xxx) cannot be repeated in the same "context" (procedures, instances of classes, classes, and programs).&lt;/P&gt;&lt;P&gt;It's more this sentence:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;The date type of the variable is determined by the operand type&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The compiler tries to determine the type of "my_sum" based on the types of the Right-Hand Side, but there is a kind of recursive determination because "my_sum" also appears in the RHS.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 09:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187676#M1980459</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-01-22T09:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187677#M1980460</link>
      <description>&lt;P&gt;Thanks &lt;A href="https://answers.sap.com/users/1091/sandra.rossi.html"&gt;Sandra Rossi&lt;/A&gt;  &amp;amp;  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt;  for the explanation, even in other languages like javascript also this is not possible, as it makes sense that the LHS type is dependent on the RHS type, but it will be based on the total RHS value type, in this case it will be &lt;/P&gt;&lt;P&gt;data(dyn_variable) =  (some value) + (dyn_variable(with undefined type))  =&amp;gt;  so an error.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 11:00:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187677#M1980460</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2020-01-23T11:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Could not used the variable in the inline declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187678#M1980461</link>
      <description>&lt;P&gt;But you're not using DATA. You're using data(my_sum)=0.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:00:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/could-not-used-the-variable-in-the-inline-declaration/m-p/12187678#M1980461</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-01-23T13:00:06Z</dc:date>
    </item>
  </channel>
</rss>

