<?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: How to access Instance Attribute in a Class Interface from FM ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159814#M1515705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You question only makes sense if&lt;/P&gt;&lt;P&gt;(1) the class / interface is part of the FM's interface (i.e. an IMPORTING - or perhaps CHANGING - parameter)&lt;/P&gt;&lt;P&gt;(2) the class / interface is defined as global variable in the TOP include of the function group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If either of these two options is applicable then the coding may look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
" (1) IMPORTING parameter: e.g. IO_INSTANCE TYPE REF TO class / interface name

IF ( io_instance IS BOUND ).
  io_instance-&amp;gt;abc = 'New value'.
ENDIF.


" (2) Global variable of function group, e.g. GO_INSTANCE TYPE REF TO class / interface name:
IF ( go_instance IS BOUND ).
  go_instance-&amp;gt;abc = 'New value'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, the public attribute ABC must be changeable (i.e. not READ-ONLY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Aug 2010 19:21:35 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2010-08-22T19:21:35Z</dc:date>
    <item>
      <title>How to access Instance Attribute in a Class Interface from FM ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159812#M1515703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following function module code, that passes the syntax, however in the class interface ABC, I have an attribute IJK that is Instance Attribute (Public).  When I modify the code like ABC-&amp;gt;IJK but it does not like it, the error is :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field "ABC" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question : How do I declare the Class Interface ABC in my Function Module  that will allow me to access the Instance Attribute ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION XYZ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not ABC=&amp;gt;EFG is initial.&lt;/P&gt;&lt;P&gt;    output = ABC=&amp;gt;EFG.&lt;/P&gt;&lt;P&gt;    shift output left deleting LEADING space.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Aug 2010 14:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159812#M1515703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-18T14:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Instance Attribute in a Class Interface from FM ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159813#M1515704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : reference typ ref to abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create object reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output = reference-&amp;gt;ijk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pr@t on Aug 19, 2010 8:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 03:22:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159813#M1515704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-19T03:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Instance Attribute in a Class Interface from FM ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159814#M1515705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You question only makes sense if&lt;/P&gt;&lt;P&gt;(1) the class / interface is part of the FM's interface (i.e. an IMPORTING - or perhaps CHANGING - parameter)&lt;/P&gt;&lt;P&gt;(2) the class / interface is defined as global variable in the TOP include of the function group&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If either of these two options is applicable then the coding may look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
" (1) IMPORTING parameter: e.g. IO_INSTANCE TYPE REF TO class / interface name

IF ( io_instance IS BOUND ).
  io_instance-&amp;gt;abc = 'New value'.
ENDIF.


" (2) Global variable of function group, e.g. GO_INSTANCE TYPE REF TO class / interface name:
IF ( go_instance IS BOUND ).
  go_instance-&amp;gt;abc = 'New value'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, the public attribute ABC must be changeable (i.e. not READ-ONLY).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Aug 2010 19:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159814#M1515705</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-08-22T19:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Instance Attribute in a Class Interface from FM ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159815#M1515706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your responses and helpful hints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I awarded the points.  Before your response I managed to resolve it with following syntax, similar to the one proposed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA dref TYPE REF TO ABC.&lt;/P&gt;&lt;P&gt;DATA: f2 LIKE dref-&amp;gt;EFG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not ABC-&amp;gt;EFG is initial.&lt;/P&gt;&lt;P&gt;output = ABC-&amp;gt;EFG.&lt;/P&gt;&lt;P&gt;shift output left deleting LEADING space.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Aug 2010 07:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-instance-attribute-in-a-class-interface-from-fm/m-p/7159815#M1515706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-24T07:30:43Z</dc:date>
    </item>
  </channel>
</rss>

