<?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: Outdated question about a temporary bug on ADT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479855#M2001701</link>
    <description>&lt;P&gt;In my opinion your first implementation should be preferred as it reduces the member access. Pay attention that you cannot write your member from outside as it is declared read only.&lt;/P&gt;&lt;P&gt;What should work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(lo_instance) = new zcl_x( ).

write lo_instance-&amp;gt;my_interface_string.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Apr 2022 18:00:02 GMT</pubDate>
    <dc:creator>BiberM</dc:creator>
    <dc:date>2022-04-07T18:00:02Z</dc:date>
    <item>
      <title>Outdated question about a temporary bug on ADT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479854#M2001700</link>
      <description>&lt;P&gt;This question was a temporary bug of ADT.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 17:51:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479854#M2001700</guid>
      <dc:creator>simonegaffurini</dc:creator>
      <dc:date>2022-04-07T17:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Outdated question about a temporary bug on ADT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479855#M2001701</link>
      <description>&lt;P&gt;In my opinion your first implementation should be preferred as it reduces the member access. Pay attention that you cannot write your member from outside as it is declared read only.&lt;/P&gt;&lt;P&gt;What should work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data(lo_instance) = new zcl_x( ).

write lo_instance-&amp;gt;my_interface_string.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Apr 2022 18:00:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479855#M2001701</guid>
      <dc:creator>BiberM</dc:creator>
      <dc:date>2022-04-07T18:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Outdated question about a temporary bug on ADT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479856#M2001702</link>
      <description>&lt;P&gt;doing so in eclipse, I get my_interface_string with an underline and the error message "Field "MY_INTERFACE_STRING" is unknown."&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 18:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479856#M2001702</guid>
      <dc:creator>simonegaffurini</dc:creator>
      <dc:date>2022-04-07T18:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Outdated question about a temporary bug on ADT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479857#M2001703</link>
      <description>&lt;P&gt;At first, an Interface is a contract between a class &amp;amp; the outside. &lt;/P&gt;&lt;P&gt;This contract is here to expose a set of public methods regarding the same logic. &lt;/P&gt;&lt;P&gt;A class should use one or several interfaces to exchange with the outside (using public method in class is bad)&lt;/P&gt;&lt;P&gt;So now, looking your code, what is the responsibility of your interface ?  store value ?  an interface is not instantiable. So why trying to do this ? &lt;/P&gt;&lt;P&gt;Your interface, should have setter &amp;amp; getter method, and not the way to store the value, This is the responsibility of the class. &lt;/P&gt;&lt;P&gt;Nevertheless, the answer of your question is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INTERFACE zif_x.&lt;BR /&gt;  DATA: my_interface_string TYPE string. " READ-ONLY.&lt;BR /&gt;ENDINTERFACE.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CLASS zcl_x DEFINITION&lt;BR /&gt;            FINAL&lt;BR /&gt;            CREATE PUBLIC .&lt;BR /&gt;  PUBLIC SECTION.&lt;BR /&gt;    INTERFACES zif_x.&lt;BR /&gt;    METHODS: constructor.&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;CLASS zcl_x IMPLEMENTATION.&lt;BR /&gt;  METHOD constructor.&lt;BR /&gt;    zif_x~my_interface_string = 'hello'.&lt;BR /&gt;  ENDMETHOD.&lt;BR /&gt;ENDCLASS.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;&lt;BR /&gt;  DATA lo_ref TYPE REF TO zif_x.&lt;BR /&gt;  lo_ref = NEW zcl_x( ).&lt;BR /&gt;  write lo_ref-&amp;gt;my_interface_string.&lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;  DATA lo_ref2 TYPE REF TO zcl_x.&lt;BR /&gt;  lo_ref2 = NEW #( ).&lt;BR /&gt;  write lo_ref2-&amp;gt;zif_x~my_interface_string.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Apr 2022 06:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/outdated-question-about-a-temporary-bug-on-adt/m-p/12479857#M2001703</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-04-08T06:57:39Z</dc:date>
    </item>
  </channel>
</rss>

