<?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: Get reference and multiple values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-reference-and-multiple-values/m-p/7474250#M1555484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem in your code is that you reference to the structure that is getting copies of the internal table. So you always reference to the value of that structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to reference to the value of the internal table, you have to use a field-symbol when looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA lt_ids TYPE TABLE OF TDSR_CHAR20. * CHAR20 range
 
LOOP AT lt_ids ASSIGNIG &amp;lt;ls_id&amp;gt;.
  GET REFERENCE OF &amp;lt;ls_id&amp;gt;-low INTO ls_query-value_low. 
  APPEND ls_query TO lt_query.
  CLEAR ls_query
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Koen De Ruyck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I know this answer comes late, but this might be useful for other people...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Mar 2011 08:36:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-03-07T08:36:59Z</dc:date>
    <item>
      <title>Get reference and multiple values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-reference-and-multiple-values/m-p/7474249#M1555483</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'm using the MDM ABAP API to retrieve some records from my MDM backend. I'd like to recover multiple products by their id. However I don't know how to pass the list of ids. With just one id it works just fine :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA ls_query TYPE mdm_query.

ls_query-parameter_code  = 'Id'.                     
ls_query-operator        = 'EQ'.                       
ls_query-dimension_type  = mdmif_search_dim_field.     
ls_query-constraint_type = mdmif_search_constr_text.   
lv_search_id = '1234'.
GET REFERENCE OF lv_search_id INTO ls_query-value_low.
APPEND ls_query TO lt_query.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I'd like to use a list of ids. This doesn't work :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA lt_ids TYPE TABLE OF TDSR_CHAR20. * CHAR20 range

LOOP AT lt_ids INTO ls_id.
  GET REFERENCE OF ls_id-low INTO ls_query-value_low. 
  APPEND ls_query TO lt_query.
  CLEAR ls_query
ENDLOOP.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lt_query-value_low is of type DATA and always contains the same value (last ls_id-low value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand why my code doesn't work but I don't know how to use multiple ids as parameters...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pierre&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pierre DOMINIQUE on Nov 23, 2010 5:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Nov 2010 16:17:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-reference-and-multiple-values/m-p/7474249#M1555483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-23T16:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get reference and multiple values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-reference-and-multiple-values/m-p/7474250#M1555484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem in your code is that you reference to the structure that is getting copies of the internal table. So you always reference to the value of that structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to reference to the value of the internal table, you have to use a field-symbol when looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA lt_ids TYPE TABLE OF TDSR_CHAR20. * CHAR20 range
 
LOOP AT lt_ids ASSIGNIG &amp;lt;ls_id&amp;gt;.
  GET REFERENCE OF &amp;lt;ls_id&amp;gt;-low INTO ls_query-value_low. 
  APPEND ls_query TO lt_query.
  CLEAR ls_query
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Koen De Ruyck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I know this answer comes late, but this might be useful for other people...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 08:36:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-reference-and-multiple-values/m-p/7474250#M1555484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-03-07T08:36:59Z</dc:date>
    </item>
  </channel>
</rss>

