<?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 Read Protected Attributes from another class reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835799#M1472311</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 using BADI_RECN_CONTRACT to check the condition currencies in the contract. When I use the reference if_recd_condition_mngr and call the method get_currency, it gives me only first condition currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want all the condition currencies to be checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see in the class cl_recn_condition_mngr_cn, there is an protected attribute MTO_CONDITION where I get all the condition values. But I'm not able to read as it is protected attribute. I've shown my code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ld_contract TYPE REF TO cl_recn_contract,
        lo_condition TYPE REF TO if_recd_condition_mngr,
        lc_condition TYPE REF TO cl_recn_condition_mngr_cn.
  DATA: lt_cond TYPE re_t_recd_condition,
        lt_condref TYPE REF TO RE_T_IF_RECD_CONDITION.
* additional check
  ld_contract ?= io_object.
  l_curr = ld_contract-&amp;gt;get_recncncurr( ).
  lo_condition = ld_contract-&amp;gt;mo_condition_mngr.
  lc_condition ?= lo_condition.
*  lt_condref = lc_condition-&amp;gt;MTO_CONDITION.
  l_condcurr = lo_condition-&amp;gt;get_currency( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please tell me how can I access protected attribute ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JMB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Mar 2010 07:36:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-31T07:36:49Z</dc:date>
    <item>
      <title>Read Protected Attributes from another class reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835799#M1472311</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 using BADI_RECN_CONTRACT to check the condition currencies in the contract. When I use the reference if_recd_condition_mngr and call the method get_currency, it gives me only first condition currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want all the condition currencies to be checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see in the class cl_recn_condition_mngr_cn, there is an protected attribute MTO_CONDITION where I get all the condition values. But I'm not able to read as it is protected attribute. I've shown my code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: ld_contract TYPE REF TO cl_recn_contract,
        lo_condition TYPE REF TO if_recd_condition_mngr,
        lc_condition TYPE REF TO cl_recn_condition_mngr_cn.
  DATA: lt_cond TYPE re_t_recd_condition,
        lt_condref TYPE REF TO RE_T_IF_RECD_CONDITION.
* additional check
  ld_contract ?= io_object.
  l_curr = ld_contract-&amp;gt;get_recncncurr( ).
  lo_condition = ld_contract-&amp;gt;mo_condition_mngr.
  lc_condition ?= lo_condition.
*  lt_condref = lc_condition-&amp;gt;MTO_CONDITION.
  l_condcurr = lo_condition-&amp;gt;get_currency( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please tell me how can I access protected attribute ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JMB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 07:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835799#M1472311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T07:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read Protected Attributes from another class reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835800#M1472312</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;Protected data members are accessible from within members of their base-class; from within members of the friends of their base-class; and from within members and friends of any classes derived from that base-class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you can access the protected data of the class only by the member functions of that class or the member functions&lt;/P&gt;&lt;P&gt;of the friend class. and inherited classes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 16:29:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835800#M1472312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-01T16:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read Protected Attributes from another class reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835801#M1472313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello JMB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use the method which returns you all condition objects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: ld_contract TYPE REF TO cl_recn_contract,
        lo_cond_mngr      TYPE REF TO if_recd_condition_mngr,
        lo_cond_mngr_cn TYPE REF TO cl_recn_condition_mngr_cn.
  DATA: lt_cond TYPE re_t_recd_condition,
        lt_condref TYPE REF TO RE_T_IF_RECD_CONDITION.
* additional check
  ld_contract ?= io_object.
  l_curr = ld_contract-&amp;gt;get_recncncurr( ).

  lo_cond_mngr = ld_contract-&amp;gt;mo_condition_mngr.
"  lo_cond_mngr_cn ?= lo_cond_mngr.

  DATA: lto_conditions     TYPE RE_T_IF_RECD_CONDITION.

  CALL METHOD lo_cond_mngr-&amp;gt;GET_LIST
    EXPORTING
      eto_condition = lto_conditions.

" Now LOOP over these instances
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 18:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835801#M1472313</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-04-01T18:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read Protected Attributes from another class reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835802#M1472314</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;Thank u very much. I dont know how did I miss that method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JMB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Apr 2010 04:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835802#M1472314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-03T04:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read Protected Attributes from another class reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835803#M1472315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello JMB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me it clear why you missed this method - because you did not clearly distinguish between an "object" and its corresponding "object manager" (see coding below).&lt;/P&gt;&lt;P&gt;Every manager object has a method to retrieve its collection of "sub-ordinated" objects:&lt;/P&gt;&lt;P&gt;- Condition Manager =&amp;gt; conditions&lt;/P&gt;&lt;P&gt;- Resubmission Manager =&amp;gt; resubmissons&lt;/P&gt;&lt;P&gt;- Partner Manager =&amp;gt; partners&lt;/P&gt;&lt;P&gt;- ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, my recommendation is to use naming conventions for these clearly distinct objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: ld_contract TYPE REF TO cl_recn_contract,
        lo_condition TYPE REF TO if_recd_condition_mngr,
        lc_condition TYPE REF TO cl_recn_condition_mngr_cn.
  DATA: lt_cond TYPE re_t_recd_condition,
        lt_condref TYPE REF TO RE_T_IF_RECD_CONDITION.

...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Apr 2010 09:00:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-protected-attributes-from-another-class-reference/m-p/6835803#M1472315</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-04-04T09:00:46Z</dc:date>
    </item>
  </channel>
</rss>

