cancel
Showing results for 
Search instead for 
Did you mean: 

Get attribute content of other component

Former Member
0 Kudos

Hi,

Iu2019ve enhanced the BTPAYMENT component and the BTPRICINGSET context node to change the dropdown list box of the payment condition.

But I need to know the distribution channel to make the dropdown list box.

Anybody could tell me how I can get the distribution channel content (attribute of the component u201CBTORGSETu201D) into the method u201CGET_Vu201D in the BTPRICINGSET context node of the BTPAYMENT component ?

thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Arun Kumar,

Thank you very much for your answer,

Sorry, I still need some details about it.

I tried to access the "parent" in the u201CGET_Vu201D method, but I wasn,t able to find BTOrderHeader and BTHeaderOrgmanSet.

Please. Do you know where exactly I have to call the method get_related_entity?

Thank you very much.

former_member193352
Active Contributor
0 Kudos

Hi Orival,

call method get_custom_controller, you'll get details of the related entities in the view controller class.

Thanks

Vishal

former_member192716
Contributor
0 Kudos

Hi,

In Get_V method write the below before the code in my previous post,


Data: current type ref to if_bol_bo_property_access.

current = collection_wrapper->get_current( ).

Regards,

Arun

Former Member
0 Kudos

Hi Arun,

If I follow as per your suggestion, still I am getting the Data of node attributes but not the Parent attributes. Can you please suggest ?

My requirement: It is 'Sales Agreement' component. It has attachment (GS_CM) component embedded. I've to reach the Agreement details for some other purpose inside of the node attributes of GS_CM view which is embedded to Agreement component.

In the debug I can see under the 'Parent' reference the agreement details. (which is a step before we go to access the actual data of that node).

Please advice...

Thanks

AG

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

I was able to solve the problem with your answers,

Thanks for your inputs

Former Member
0 Kudos

Hi there...

Can you please provide the way how you could able to read the Parent attribute values being inside of its node attribute ?

My requirement is also somehow similar but I am always pointing to get the node values but not the parent attribute values.. .

Appreciate your earliest response... Thanks

AG

Former Member
0 Kudos

Hi,

So that I could get the needed data I had to access btadminh component as parent entity and call CRM_ORDER_READ FM in order to get all of order data from the memory,

check the code bellow, I hope it helps you:

*&-------------------------------------------------------------------

*& Variables

*&-------------------------------------------------------------------

  DATA:

    lr_entity      TYPE REF TO cl_crm_bol_entity, "Entity

    lr_current     TYPE REF TO   if_bol_bo_property_access, "Instance

    lv_guid        TYPE string, "Guid BTAdminH

    lt_orgman      TYPE crmt_orgman_wrkt, "sales area

    lw_orgman LIKE LINE OF lt_orgman, "sales area

    lt_orderadm_i  TYPE crmt_orderadm_i_wrkt, "order itm

    lw_orderadm_i  LIKE LINE OF lt_orderadm_i, "order itm

    lt_partner     TYPE crmt_partner_external_wrkt,"Partner

    lw_partner     LIKE LINE OF  lt_partner,                "Partner

    lt_header_guid TYPE          crmt_object_guid_tab,      "Header

    lw_header_guid LIKE LINE OF  lt_header_guid.            "Header

*&-------------------------------------------------------------------

*& Constants

*&-------------------------------------------------------------------

  CONSTANTS:

    lc_relation_btadminh   TYPE crmt_relation_name VALUE 'BTAdminH',

*   ATTRIBUTE CONSTANTS STRUCTURE

    BEGIN OF lc_attr,

      process_type TYPE name_komp VALUE 'PROCESS_TYPE',

      guid         TYPE name_komp VALUE 'GUID',

      pmnttrms     TYPE name_komp VALUE 'PMNTTRMS',

    END OF lc_attr.

*&-------------------------------------------------------------------

*& GET ORDER GUID

*&-------------------------------------------------------------------

* GET INSTANCE

  lr_current = collection_wrapper->get_current( ).

  lr_entity ?= lr_current.

* GET PARENT ENTITY

  WHILE lr_entity->get_name( ) NE lc_relation_btadminh.

    lr_entity = lr_entity->get_parent( ).

  ENDWHILE.

* GET PROCESSISNG ORDER GUID

  IF lr_entity IS BOUND.

    lv_guid = lr_entity->get_property_as_string( lc_attr-guid ).

  ENDIF.

* GET ORDER DATA

  lw_header_guid = lv_guid.

  APPEND lw_header_guid TO lt_header_guid.

*&-------------------------------------------------------------------

*& GET ORDER DATA (FROM MEMORY)

*&-------------------------------------------------------------------

  CALL FUNCTION 'CRM_ORDER_READ'

    EXPORTING

      it_header_guid       = lt_header_guid "Guid Ordem em processamento

    IMPORTING

      et_orderadm_i        = lt_orderadm_i  "Itens Ordem

      et_orgman            = lt_orgman      "Parceiro

      et_partner           = lt_partner     "Organização de vendas

    EXCEPTIONS

      document_not_found   = 1

      error_occurred       = 2

      document_locked      = 3

      no_change_authority  = 4

      no_display_authority = 5

      no_change_allowed    = 6

          OTHERS               = 7.


Former Member
0 Kudos

Thank you very much !!!

Former Member
0 Kudos

Hi Orival.

Maybe if you specify the components, views and context nodes would be more easy to guide you.

On the other hand, keep in mind that both components BTORGSET and BTPAYMENT have to be loaded in the WEB UI Session in order to "be able to share data between each other" and this might requires enhancements in the RUNTIME Repositories as well. The easy way could be to reuse code from the component BTORGSET in component BTPAYMENT.

Best regards.

former_member192716
Contributor
0 Kudos

Hi,

BTPricingSet and BTOrgSet have the same parent entity BTOrderHEader. First, read the parent entity then traverse to BTOrgSet relation.

I am away from my system so i cant provide the exact technical details.

Sample code,


data_ lr_entity type ref to cl_crm_bol_entity.

* Get the current entity
lr_entity ?= current.

* Loop back to parent entity.
while lr_entity->get_name( ) NE 'BTOrderHeader'.
 lr_entity = lr_entity->get_parent( ).
endwhile.

*From parent entity get relation of btorgset.
lr_entity = lr_entity->get_related_entity( 'BTHeaderOrgmanSet' ) .

Now you can read your desired field from lr_entity.

Regards,

Arun Kumar

Edited by: Arun Kumar on May 14, 2010 10:11 AM