<?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: Changing OO Reference variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069379#M1504438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, Marcin.  That was the answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jul 2010 11:33:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-27T11:33:24Z</dc:date>
    <item>
      <title>Changing OO Reference variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069377#M1504436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Day Ladies and Gentle,men,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am endeavouring to make a change to a BADI method attached to HR transaction PTMW.  I need to modify a value in a field in structure p2002. Because the p2002 data is only accessible via the interface attached to, in this case, the object I_RECORD, I can only read it by dereferencing (is that the right term?) the object a couple of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I've done this I can read the p2002 structure data into my work area ls_p2002, and modify the data I need to.  My question is, how do I write this information back to either a) the i_record object or b) to a new object copying the i_record data but with my new p2002 data for passing out via the e_time_data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   
method process_it2002.
**************************************************************** 
*  Import I_RECORD    TYPE REF TO  IF_PT_TD_CONTROL
*         I_TIME_DATA TYPE         TIM_BLP_REQUEST_TAB
*  Export E_MESSAGES  TYPE         BAPIRET2_T
*         E_TIME_DATA TYPE         TIM_BLP_REQUEST_TAB
**************************************************************** 
 
  data:
        ls_it2002 type p2002,
        ls_data   type ref to cl_pt_td_it2002,
        ls_time   type ref to CL_PT_TD_CONTROL,
        ls_p2002  type p2002.

  field-symbols: &amp;lt;fs1&amp;gt; type any.

  ls_time ?= i_record.
  ls_data ?= i_record-&amp;gt;data.
  ls_p2002 = ls_data-&amp;gt;if_pt_td_it2002~p2002.

  if ls_p2002-subty = 'TRNG'.
    ls_p2002-stdaz = ( ls_p2002-enduz - ls_p2002-beguz ) / 3600.           "My Code Change
   
* need to get ls_p2002 back into i_record or a copy of this object so I can
* update e_time_data.   
  endif.

*  append i_time_data to e_time_data.

endmethod. 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks, Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 10:11:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069377#M1504436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-26T10:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Changing OO Reference variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069378#M1504437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the method &lt;EM&gt;IF_PT_TD_IT2002~SET_DATA&lt;/EM&gt; serves this purpose. So the solution would be directly changing I_RECORD with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
....
ls_data-&amp;gt;IF_PT_TD_IT2002~SET_DATA( ls_p2002 ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jul 2010 10:36:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069378#M1504437</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-07-26T10:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Changing OO Reference variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069379#M1504438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, Marcin.  That was the answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 11:33:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-oo-reference-variable/m-p/7069379#M1504438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-27T11:33:24Z</dc:date>
    </item>
  </channel>
</rss>

