<?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: check if the FM is dynamically called using a variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-if-the-fm-is-dynamically-called-using-a-variable/m-p/12243946#M1985460</link>
    <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;vijayashri&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The name of the function used in a static function call is enclosed in single quotes.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'SOME_FUNCTION'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, if you LV_SEC_STR variable does not start with a single quote, then I would assume that it contains a name of a variable.&lt;/P&gt;&lt;P&gt;The second part, check if the variable is declared locally or globally, is more complicated. You have to find the place where the variable is declared and check if it is a global or local declaration. I would first look for all occurrences of the variable in the source code. Then look for the context of the findings:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;is it a usage or declaration of the variable &lt;/LI&gt;&lt;LI&gt;if it is a declaration, then is it a local or global&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
    <pubDate>Fri, 09 Oct 2020 08:41:49 GMT</pubDate>
    <dc:creator>MateuszAdamus</dc:creator>
    <dc:date>2020-10-09T08:41:49Z</dc:date>
    <item>
      <title>check if the FM is dynamically called using a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-if-the-fm-is-dynamically-called-using-a-variable/m-p/12243945#M1985459</link>
      <description>&lt;P&gt;hi ,&lt;/P&gt;
  &lt;P&gt;i have a requirement where i have to check if the FM is dynamically called using a variable and that variable is declared locally in the report.&lt;/P&gt;
  &lt;P&gt;i am using below code where lv_stat will have each line of the report.&lt;/P&gt;
  &lt;P&gt; IF lv_stat CS 'CALL FUNCTION'. &lt;/P&gt;
  &lt;P&gt; SPLIT lv_stat AT 'CALL FUNCTION' INTO lv_first_str lv_sec_str. &lt;/P&gt;
  &lt;P&gt; shift lv_sec_str left DELETING LEADING space.&lt;/P&gt;
  &lt;P&gt;next &lt;/P&gt;
  &lt;P&gt;- i have to check if lv_sec_str is a variable&lt;/P&gt;
  &lt;P&gt;- if it is a variable then check whether its declared locally. &lt;/P&gt;
  &lt;P&gt;I am not getting logic to write this.can anyone help.&lt;/P&gt;
  &lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 08:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-if-the-fm-is-dynamically-called-using-a-variable/m-p/12243945#M1985459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-10-09T08:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: check if the FM is dynamically called using a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-if-the-fm-is-dynamically-called-using-a-variable/m-p/12243946#M1985460</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;vijayashri&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;The name of the function used in a static function call is enclosed in single quotes.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'SOME_FUNCTION'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, if you LV_SEC_STR variable does not start with a single quote, then I would assume that it contains a name of a variable.&lt;/P&gt;&lt;P&gt;The second part, check if the variable is declared locally or globally, is more complicated. You have to find the place where the variable is declared and check if it is a global or local declaration. I would first look for all occurrences of the variable in the source code. Then look for the context of the findings:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;is it a usage or declaration of the variable &lt;/LI&gt;&lt;LI&gt;if it is a declaration, then is it a local or global&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
      <pubDate>Fri, 09 Oct 2020 08:41:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-if-the-fm-is-dynamically-called-using-a-variable/m-p/12243946#M1985460</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-10-09T08:41:49Z</dc:date>
    </item>
  </channel>
</rss>

