<?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: values from structured objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554535#M1563781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is that you do not know the Item Number (value to be sent in the parameter IM_ID). What is the value that you pass to this parameter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure how you would identify the Component ID, perhaps the method GET_ID of the class CL_COST_COMPONENT_NO_SERVICE could be used in your case. &lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ramneek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jan 2011 16:52:58 GMT</pubDate>
    <dc:creator>Ramneek</dc:creator>
    <dc:date>2011-01-26T16:52:58Z</dc:date>
    <item>
      <title>values from structured objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554532#M1563778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a developer and I have no intention to understand ABAP objects. I can only write a procedural things using modules and such.&lt;/P&gt;&lt;P&gt;But I need to write a code to get some values from a higly structured object. Here is my problem in detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a FM called ISM_ECP_KPI_GET_COST_ESTIMATE which returns the parametr EX_CE of type "class" CL_COST_ESTIMATE. This class has an atribute NUMBER_SERVICE which is type "class interface" CL_COST_COMPONENT_NO_SERVICE. This class interface has an atribute T_COMPONENTS which is of table type CKF_NS_COMPONENT_TABLE. This has a line type (structure) CL_COSTING_COMPONENT which again leads to another class interface;(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And finaly here, this class interface has an atribute PRICES where are my values. There are usually more lines in the atribute T_COMPONENTS and I need to access one by one to get the price from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody please help me out here and advice some ABAP coding how to access the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to anybody contributing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 12:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554532#M1563778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-25T12:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: values from structured objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554533#M1563779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attribute T_COMPONENTS in class CL_COST_COMPONENT_NO_SERVICE is private. So, you can't access it outside the class. There is a method GET_COMPONENT in the same class to get the component. Similarly, you can't access the PRICES outside the class as it is protected attribute. However, you can use the method GET_PRICE to get the price line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: o_cost_est TYPE REF TO cl_cost_estimate,
      o_services TYPE REF TO cl_cost_component_no_service,
      o_comp     TYPE REF TO cl_costing_component.

CALL FUNCTION 'ISM_ECP_KPI_GET_COST_ESTIMATE'
  IMPORTING
    ex_ce = o_cost_est.

o_services = o_cost_est-&amp;gt;number_service.

* you need to know the ID
DATA: lv_id TYPE ck_component_id.  "&amp;lt;&amp;lt;
o_services-&amp;gt;get_component( EXPORTING im_id = lv_id
                           IMPORTING ex_component = o_comp ).

* to get prices, need to call method GET_PRICE
DATA: lv_curtp TYPE ckf_price_line-curtp,  " &amp;lt;&amp;lt;
      lv_currency TYPE ckf_price_line-currency,  "&amp;lt;&amp;lt;
      lv_price TYPE ckf_price_line,
      lv_return TYPE i.
o_comp-&amp;gt;get_price(
  EXPORTING
    im_curtp       = lv_curtp
    im_currency    = lv_currency
  IMPORTING
    ex_price       = lv_price
    ex_return      = lv_return
  EXCEPTIONS
    not_found      = 1
    internal_error = 2
    OTHERS         = 3
       ).
IF sy-subrc &amp;lt;&amp;gt; 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 14:40:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554533#M1563779</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2011-01-25T14:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: values from structured objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554534#M1563780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the wonderful script. There is a small problem within the method GET_COMPONENT. It says, that the CONDITION_NOT_FOUND. sy-subrc is eq 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD get_component.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;    l_component_line TYPE ckf_ns_component_table_line.&lt;/P&gt;&lt;P&gt;  READ TABLE t_components INTO l_component_line&lt;/P&gt;&lt;P&gt;                              WITH TABLE KEY id = im_id.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    RAISE component_not_found.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  ex_component = l_component_line-component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 15:24:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554534#M1563780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-25T15:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: values from structured objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554535#M1563781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is that you do not know the Item Number (value to be sent in the parameter IM_ID). What is the value that you pass to this parameter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure how you would identify the Component ID, perhaps the method GET_ID of the class CL_COST_COMPONENT_NO_SERVICE could be used in your case. &lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ramneek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 16:52:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/values-from-structured-objects/m-p/7554535#M1563781</guid>
      <dc:creator>Ramneek</dc:creator>
      <dc:date>2011-01-26T16:52:58Z</dc:date>
    </item>
  </channel>
</rss>

