<?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: Access object attribute in table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176109#M124375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're headed the right direction, but I need to add a couple of items (that should have been included in my original post!).  I'm attempting to access the object's content in the context of a badi.  Given this, can I create a class to encapsulate my table as you provided in your example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the specifics:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implementation: &lt;/P&gt;&lt;P&gt;Z_MY_IMPLEMENTATION&lt;/P&gt;&lt;P&gt;Interface Name:&lt;/P&gt;&lt;P&gt;IF_EX_HRPAD00INFTYDB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method: &lt;/P&gt;&lt;P&gt;UPDATE_DB&lt;/P&gt;&lt;P&gt;Importing Parameter:&lt;/P&gt;&lt;P&gt;OPERATION_TAB Type HRAD_DBOPER_LOG_TAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of HRAD_DBOPER_LOG_TAB&lt;/P&gt;&lt;P&gt;  &amp;gt;&amp;gt;Line Type: HRAD_DBOPER_LOG&lt;/P&gt;&lt;P&gt;     &amp;gt;&amp;gt;one component of HRAD_DBOPER_LOG = NEW_PNNNN TYPE DATA (at runtime this gets populated with an object)&lt;/P&gt;&lt;P&gt;         &amp;gt;&amp;gt;I need to access Field INFTY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't like pasting all of my code in as I feel like a kid who is getting his friends to do his homework, but I (obviously) couldn't explain the situation generically without causing confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dwight Jones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2006 22:19:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-15T22:19:54Z</dc:date>
    <item>
      <title>Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176107#M124373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the syntax used to access an attribute of an object that is itself embedded within a cell of a table row?  I normally use field symbols to access complex structures, but that doesn't seem to work here (or I'm not doing it right!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 21:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176107#M124373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T21:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176108#M124374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003.


*---------------------------------------------------------------------*
*       CLASS lcl_temp DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_temp definition.

  public section.

    data: it001 type table of t001.

    methods: constructor.

endclass.


*---------------------------------------------------------------------*
*       CLASS lcl_temp IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_temp implementation.

  method constructor.

    select * into table it001 from t001.

  endmethod.

endclass.

data: a_object      type ref to lcl_temp.
data: a_object_list type table of ref to lcl_temp.
data: xt001 type t001.

start-of-selection.

* Create the object and put it in a internal table
create object a_object.
append a_object to a_object_list.

* Read the internal table in the first row and get the object
read table a_object_list into a_object index 1.


* Access the table from the object to write it out.
loop at a_object-&amp;gt;it001 into xt001.
  write:/ xt001-bukrs, xt001-butxt.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 21:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176108#M124374</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-15T21:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176109#M124375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're headed the right direction, but I need to add a couple of items (that should have been included in my original post!).  I'm attempting to access the object's content in the context of a badi.  Given this, can I create a class to encapsulate my table as you provided in your example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the specifics:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implementation: &lt;/P&gt;&lt;P&gt;Z_MY_IMPLEMENTATION&lt;/P&gt;&lt;P&gt;Interface Name:&lt;/P&gt;&lt;P&gt;IF_EX_HRPAD00INFTYDB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method: &lt;/P&gt;&lt;P&gt;UPDATE_DB&lt;/P&gt;&lt;P&gt;Importing Parameter:&lt;/P&gt;&lt;P&gt;OPERATION_TAB Type HRAD_DBOPER_LOG_TAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of HRAD_DBOPER_LOG_TAB&lt;/P&gt;&lt;P&gt;  &amp;gt;&amp;gt;Line Type: HRAD_DBOPER_LOG&lt;/P&gt;&lt;P&gt;     &amp;gt;&amp;gt;one component of HRAD_DBOPER_LOG = NEW_PNNNN TYPE DATA (at runtime this gets populated with an object)&lt;/P&gt;&lt;P&gt;         &amp;gt;&amp;gt;I need to access Field INFTY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't like pasting all of my code in as I feel like a kid who is getting his friends to do his homework, but I (obviously) couldn't explain the situation generically without causing confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dwight Jones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 22:19:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176109#M124375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-15T22:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176110#M124376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post the code where you are trying to access via field-symbols?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2006 23:38:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176110#M124376</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-15T23:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176111#M124377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_FIELD&amp;gt;    TYPE string.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_STRUC&amp;gt;    TYPE HRPAD_DBOPER_LOG.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_SUBSTRUC&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt;    TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE operation_tab INTO ls_operation_tab INDEX 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN ls_operation_tab-new_pnnnn TO &amp;lt;GENERAL_SUBSTRUC&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_struc_type = 'INFTY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN l_struc_type TO &amp;lt;GENERAL_FIELD&amp;gt;.&lt;/P&gt;&lt;P&gt;     ASSIGN COMPONENT &amp;lt;GENERAL_FIELD&amp;gt;     OF&lt;/P&gt;&lt;P&gt;            STRUCTURE &amp;lt;GENERAL_SUBSTRUC&amp;gt;  TO&lt;/P&gt;&lt;P&gt;                      &amp;lt;GENERAL_VALUE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     l_infotype = &amp;lt;GENERAL_VALUE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;I get a short dump b/c &amp;lt;GENERAL_VALUE&amp;gt; is not getting set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 13:34:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176111#M124377</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T13:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176112#M124378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please change as the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FIELD-SYMBOLS &amp;lt;GENERAL_FIELD&amp;gt; TYPE string.
FIELD-SYMBOLS &amp;lt;GENERAL_STRUC&amp;gt; TYPE HRPAD_DBOPER_LOG.
FIELD-SYMBOLS &amp;lt;GENERAL_SUBSTRUC&amp;gt; TYPE ANY.
&amp;lt;b&amp;gt;*FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; TYPE string.
FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; .&amp;lt;/b&amp;gt;

READ TABLE operation_tab INTO ls_operation_tab INDEX 1.

ASSIGN ls_operation_tab-new_pnnnn TO &amp;lt;GENERAL_SUBSTRUC&amp;gt;.

l_struc_type = 'INFTY'.

&amp;lt;b&amp;gt;*ASSIGN l_struc_type TO &amp;lt;GENERAL_FIELD&amp;gt;.&amp;lt;/b&amp;gt;
ASSIGN COMPONENT &amp;lt;b&amp;gt;l_struc_type&amp;lt;/b&amp;gt; OF
                  STRUCTURE &amp;lt;GENERAL_SUBSTRUC&amp;gt; TO
                             &amp;lt;GENERAL_VALUE&amp;gt;.

l_infotype = &amp;lt;GENERAL_VALUE&amp;gt;.



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this works for ya.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 14:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176112#M124378</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-16T14:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176113#M124379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Rich.  I'm still getting a "Field symbol has not yet been assigned" short dump error.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One question--did you intend this?&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; TYPE string.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That gives a compile error.  I tried with &amp;lt;GENERAL_VALUE&amp;gt; TYPE ANY without success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the error is arising because &amp;lt;GENERAL_SUBSTRUC&amp;gt; is a data object rather than a table.  What gets passed into GENERAL_SUBSTRUC looks something like &lt;SPAN __jive_macro_name="A"&gt;&lt;/SPAN&gt;.  INFTY is the second component.  I know that there must be an easy way to get at the component, but I can't figure out the syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure p0006 is getting passed into the new_pnnnn if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 16:09:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176113#M124379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-16T16:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Access object attribute in table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176114#M124380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh sorry, I meant to comment the first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; TYPE string.
FIELD-SYMBOLS &amp;lt;GENERAL_VALUE&amp;gt; .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2006 16:12:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-object-attribute-in-table/m-p/1176114#M124380</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-02-16T16:12:01Z</dc:date>
    </item>
  </channel>
</rss>

