<?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: Make export parameter point to an existing memory reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152252#M1977169</link>
    <description>&lt;P&gt;Please use comments for comments and not answers!&lt;/P&gt;&lt;P&gt;Regarding your problem, that can’t be done, simply because your ev_value is generic and linked to a data variable that has its own memory when it was declared. So that (outside) data variable is already assigned to your export parameter ev_value. You cannot reassign a variables memory to another variable. &lt;BR /&gt;you can only dereference a ref to data with -&amp;gt;* to a field-symbol.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2020 01:55:16 GMT</pubDate>
    <dc:creator>michael_piesche</dc:creator>
    <dc:date>2020-03-06T01:55:16Z</dc:date>
    <item>
      <title>Make export parameter point to an existing memory reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152250#M1977167</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;I have an internal table with a list of generic memory references and would like to be able to retrieve them using a method. What I would like is assign the memory reference to the export parameter of my method so I would be able to change the referenced data using the parameter. How can I accomplish this behaviour? My method looks like this at the moment but the result is that the export parameter is a copy of the referenced object so changing it wont update the referenced data. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;* SIGNATURE
   METHODS get_param
    IMPORTING
      iv_id_param TYPE clike
    EXPORTING
      ev_val      TYPE any.	 
* IMPL

  METHOD get_param.
    DATA: lr_ref TYPE REF TO data.

    FIELD-SYMBOLS: &amp;lt;fs_val&amp;gt; TYPE any.

    zif_cx_enh_param_map~get_param_ref(
      EXPORTING
        iv_id_param = iv_id_param
      IMPORTING
        er_ref      = lr_ref
    ).

    ASSIGN lr_ref-&amp;gt;* TO &amp;lt;fs_val&amp;gt;.
    ev_val = &amp;lt;fs_val&amp;gt;.
  ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 21:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152250#M1977167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-03-04T21:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Make export parameter point to an existing memory reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152251#M1977168</link>
      <description>&lt;P&gt;Not sure where the problem is. If you want to pass a reference to a data type, then you also need to pass it as a reference "TYPE REF TO data". In your case, you had to define a data type with separate memory assigned to it, before you even called get_param in order to receive the value for ev_val, so thats why those are two different objects in memory and only the value is copied.&lt;/P&gt;&lt;P&gt;If you therefore define your ev_val as "TYPE REF TO" and simply pass the references from method to another. However, then your method will be 'useless' since you could already call zif_cx_enh_param_map~get_param_ref directly. &lt;/P&gt;&lt;P&gt;But maybe you want to do some changes in your method, well in this case, you dereference it with the operator -&amp;gt;* like you did, do your changes to the field-symbol and it all happens for the same data in the memory.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* SIGNATURE
   METHODS get_param
    IMPORTING
      iv_id_param TYPE clike
    EXPORTING
      ev_val      TYPE REF TO data.

* IMPL&lt;BR /&gt;METHOD get_param.
    zif_cx_enh_param_map~get_param_ref(
      EXPORTING
        iv_id_param = iv_id_param
      IMPORTING
        er_ref      = ev_val
    ).
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does this solve your problem, or am I missing something?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 00:29:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152251#M1977168</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-03-05T00:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Make export parameter point to an existing memory reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152252#M1977169</link>
      <description>&lt;P&gt;Please use comments for comments and not answers!&lt;/P&gt;&lt;P&gt;Regarding your problem, that can’t be done, simply because your ev_value is generic and linked to a data variable that has its own memory when it was declared. So that (outside) data variable is already assigned to your export parameter ev_value. You cannot reassign a variables memory to another variable. &lt;BR /&gt;you can only dereference a ref to data with -&amp;gt;* to a field-symbol.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 01:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152252#M1977169</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-03-06T01:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Make export parameter point to an existing memory reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152253#M1977170</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;adaceroge&lt;/SPAN&gt;, please follow up on your open question.&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;comment answers or your question if there are still open issues.&lt;/LI&gt;&lt;LI&gt;otherwise mark an answer as accepted if it helped you solve your problem&lt;/LI&gt;&lt;LI&gt;or post an answer of yourself and accept it if you found another useful solution yourself&lt;/LI&gt;&lt;LI&gt;or redirect your question to another question that is related and was useful to solve your problem&lt;/LI&gt;&lt;LI&gt;in the end, close your question&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 13 May 2020 14:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/make-export-parameter-point-to-an-existing-memory-reference/m-p/12152253#M1977170</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-05-13T14:11:21Z</dc:date>
    </item>
  </channel>
</rss>

