<?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: Cannot call methods of Reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162064#M1978112</link>
    <description>&lt;P&gt;This is a very generic error. The error can be one misplaced character. So in order to help you we definitely need the exact Code part. Type Definition and those two calls should be sufficient though. &lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 07:33:01 GMT</pubDate>
    <dc:creator>BiberM</dc:creator>
    <dc:date>2020-05-14T07:33:01Z</dc:date>
    <item>
      <title>Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162062#M1978110</link>
      <description>&lt;P&gt;I don't know how to formulate the question properly, sorry in advance.&lt;/P&gt;
  &lt;P&gt;I have a basic LIST class, and a REPORT class, report-&amp;gt;get_includes() returns TYPE REF TO LIST&lt;/P&gt;
  &lt;P&gt;When i try to compile the following code, i get the error saying i can't call a method from a reference&lt;BR /&gt; DATA(Y) = NEW REPORT( 'FOO' )-&amp;gt;GET_INCLUDES( ).&lt;BR /&gt; DATA(Z) = Y-&amp;gt;GET( 1 ).&lt;/P&gt;
  &lt;P&gt;When i change the return type of get_includes to TYPE LIST, i get the error saying "Y is not a reference variable"&lt;/P&gt;
  &lt;P&gt;So the errors say that i cannot call from a reference variable, but also have to call from a reference variable.&lt;/P&gt;
  &lt;P&gt;I hope i properly expressed myself, if i did not, i am happy to clarify.&lt;/P&gt;
  &lt;P&gt;Thanks in advance for any help!&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162062#M1978110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-05-14T07:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162063#M1978111</link>
      <description>&lt;P&gt;Hi  Former Member &lt;/P&gt;&lt;P&gt;Could you share a piece of the code, please?&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:31:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162063#M1978111</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-05-14T07:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162064#M1978112</link>
      <description>&lt;P&gt;This is a very generic error. The error can be one misplaced character. So in order to help you we definitely need the exact Code part. Type Definition and those two calls should be sufficient though. &lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:33:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162064#M1978112</guid>
      <dc:creator>BiberM</dc:creator>
      <dc:date>2020-05-14T07:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162065#M1978113</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;mateuszadamus&lt;/SPAN&gt;   &lt;SPAN class="mention-scrubbed"&gt;michael.biber2&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Thanks for the reply, here are the definitions:&lt;/P&gt;&lt;P&gt;Report:&lt;BR /&gt;METHODS GET_INCLUDES RETURNING VALUE(INCLUDES) TYPE REF TO LIST.&lt;/P&gt;&lt;P&gt;List:&lt;/P&gt;&lt;P&gt;GET IMPORTING VALUE(IN) TYPE I RETURNING VALUE(OUT) TYPE REF TO  DATA,&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162065#M1978113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-05-14T07:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162066#M1978114</link>
      <description>&lt;P&gt;I don't know Kevin, it works for me. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1808706-source.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1808707-result.jpg" /&gt;&lt;/P&gt;&lt;P&gt;You have to give more information, preferably the code. Otherwise I'm not able to figure out what the issue is.&lt;/P&gt;&lt;P&gt;regards,&lt;BR /&gt;Mateusz&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162066#M1978114</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-05-14T07:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162067#M1978115</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;mateuszadamus&lt;/SPAN&gt;  i tried your code and it worked for me too, and everything seems to be the same in my code. Did i make one stupid mistake?&lt;/P&gt;&lt;P&gt;(Also, is there a better way to post source code? For small pieces, screenshots are great, but what about longer pieces of code? Also thanks a lot again for your help, i really appreciate it!)&lt;/P&gt;&lt;P&gt;CLASS REPORT DEFINITION.&lt;BR /&gt;&lt;BR /&gt; PUBLIC SECTION.&lt;BR /&gt; METHODS: CONSTRUCTOR&lt;BR /&gt; IMPORTING VALUE(NAME) TYPE STRING,&lt;BR /&gt; GET_INCLUDES&lt;BR /&gt; RETURNING VALUE(INCLUDES) TYPE REF TO LIST.&lt;BR /&gt;&lt;BR /&gt; PRIVATE SECTION.&lt;BR /&gt; DATA SOURCE TYPE STRING_TABLE.&lt;BR /&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CLASS LIST DEFINITION.&lt;BR /&gt;&lt;BR /&gt; PUBLIC SECTION.&lt;BR /&gt; METHODS: CONSTRUCTOR,&lt;BR /&gt; ADD&lt;BR /&gt; IMPORTING&lt;BR /&gt; VALUE(IN) TYPE REF TO DATA,&lt;BR /&gt; REMOVE&lt;BR /&gt; IMPORTING&lt;BR /&gt; VALUE(IN) TYPE REF TO DATA,&lt;BR /&gt; GET&lt;BR /&gt; IMPORTING&lt;BR /&gt; VALUE(IN) TYPE I&lt;BR /&gt; RETURNING&lt;BR /&gt; VALUE(OUT) TYPE REF TO DATA,&lt;BR /&gt; INDEXOF&lt;BR /&gt; IMPORTING&lt;BR /&gt; VALUE(IN) TYPE REF TO DATA&lt;BR /&gt; RETURNING&lt;BR /&gt; VALUE(OUT) TYPE I.&lt;BR /&gt;&lt;BR /&gt; PRIVATE SECTION.&lt;BR /&gt; DATA CONTENT TYPE TABLE OF REF TO DATA.&lt;BR /&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CLASS REPORT IMPLEMENTATION.&lt;BR /&gt;&lt;BR /&gt; METHOD CONSTRUCTOR.&lt;BR /&gt;&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD GET_INCLUDES.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CLASS LIST IMPLEMENTATION.&lt;BR /&gt;&lt;BR /&gt; METHOD CONSTRUCTOR.&lt;BR /&gt;&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD ADD.&lt;BR /&gt; APPEND IN TO CONTENT.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD REMOVE.&lt;BR /&gt; DELETE CONTENT WHERE TABLE_LINE EQ IN.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD GET.&lt;BR /&gt; OUT = CONTENT[ IN ].&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt; METHOD INDEXOF.&lt;BR /&gt; DATA(INDEX) = -1.&lt;BR /&gt; READ TABLE CONTENT WITH KEY TABLE_LINE = IN TRANSPORTING NO FIELDS.&lt;BR /&gt; IF SY-SUBRC = 0.&lt;BR /&gt; INDEX = SY-TABIX.&lt;BR /&gt; ENDIF.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt;&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; DATA(Y) = NEW REPORT( 'FOO' )-&amp;gt;GET_INCLUDES( ).&lt;/P&gt;&lt;P&gt;DATA(Z) = Y-&amp;gt;GET( 1 ).&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:28:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162067#M1978115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-05-14T11:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162068#M1978116</link>
      <description>&lt;P&gt;Hi  Former Member &lt;/P&gt;&lt;P&gt;Change the name of your class from LIST to ZLIST and it will work. The LIST is a keyword in ABAP that's why you get an error.&lt;/P&gt;&lt;P&gt;I would suggest using LCL_ class naming convention.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Mateusz&lt;/P&gt;&lt;P&gt;Edit: LIST is a data element, as noticed by  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Edit2: As rightly pointed by  &lt;SPAN class="mention-scrubbed"&gt;stephkoester&lt;/SPAN&gt; the main issue is that class LIST was defined after the class REPORT. Having it defined before class REPORT would allow for code activation. That being said, having used class naming convention would trigger the correct syntax check error, which would point to the right issue.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162068#M1978116</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-05-14T11:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162069#M1978117</link>
      <description>&lt;P&gt;Hi  Former Member &lt;/P&gt;&lt;P&gt;Yes, definitely there is a better way to show code than pasting images. I was in a hurry...&lt;/P&gt;&lt;P&gt;There is a "Code" button on the toolbar of the message editor. This would be preferable, I guess.&lt;/P&gt;&lt;P&gt;regards,&lt;BR /&gt;Mateusz&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162069#M1978117</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-05-14T11:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162070#M1978118</link>
      <description>&lt;P&gt;Former Member Please post code with CODE button, like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS report DEFINITION.
  PUBLIC SECTION.
    METHODS:
      constructor
        IMPORTING VALUE(name) TYPE string,
      get_includes
        RETURNING VALUE(includes) TYPE REF TO list.
  PRIVATE SECTION.
    DATA source TYPE string_table.
ENDCLASS.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 May 2020 11:39:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162070#M1978118</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-14T11:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162071#M1978119</link>
      <description>&lt;P&gt;It's because LIST is a data element (1 character) and not a class.&lt;/P&gt;&lt;P&gt;You should prefix classes with LCL_ to avoid this kind of problem, and also place the declarations in the right order (in your case, the class LIST is defined after TYPE REF TO list, so SAP considers LIST as the data element).&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162071#M1978119</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-14T11:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162072#M1978120</link>
      <description>&lt;P&gt;Thanks &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;, that solved the problem! I had to define LIST first.&lt;/P&gt;&lt;P&gt;Also thanks to you and  &lt;SPAN class="mention-scrubbed"&gt;mateuszadamus&lt;/SPAN&gt; for all the help on here, i am pretty new and dont know how this site works&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 12:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162072#M1978120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-05-14T12:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot call methods of Reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162073#M1978121</link>
      <description>&lt;P&gt;This is not the correct answer, because you can use nearly every word for local objects/variables. Even keywords can be used like he used report as local class object.&lt;/P&gt;&lt;P&gt;The problem why the code couldn't get activated is, that the class definition of list needs to be before definition of class report.&lt;/P&gt;&lt;P&gt;Greetings&lt;BR /&gt;Stephan &lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 13:37:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-call-methods-of-reference/m-p/12162073#M1978121</guid>
      <dc:creator>stekoester</dc:creator>
      <dc:date>2020-05-17T13:37:55Z</dc:date>
    </item>
  </channel>
</rss>

