Showing results for 
Search instead for 
Did you mean: 

read all partner in GET_I_ACT_STATUS

Active Participant
0 Kudos

Dear All,

I wand to read all parties involved in transaction in GET_I_ACT_STATUS method of status attribute

i write following code

DATA: lr_btstatus TYPE REF TO cl_crm_bol_entity,

lr_btadminh TYPE REF TO cl_crm_bol_entity,

lr_partset TYPE REF TO cl_crm_bol_entity,

lr_partner TYPE REF TO cl_crm_bol_entity.

data:lr_partner_coll type ref to if_bol_bo_col,

lr_prrtner_ent type ref to if_bol_bo_property_access,

lv_partner_guid type BU_PARTNER_GUID.

IF current IS BOUND.

lr_btstatus ?= current.

lr_btadminh = lr_btstatus->get_parent( ).

IF lr_btadminh IS BOUND.

lr_partset ?= lr_btadminh->get_related_entity( 'BTHeaderPartnerSet' ). " Get BTHeaderPartnerSet


IF lr_partset IS BOUND.

lr_partner ?= lr_partset->get_related_entity( 'BTPartnerAll' ). " Get BTPartnerAll

How can i read all partner using get_collection_wrapper( ).

please guide .

View Entire Topic
Active Participant
0 Kudos

Hi Vijay,

This code would be useful if you have btadminh context node also in the same view or event you can get it from custom controller if not there in the same view.

DATA: lr_btadminh TYPE REF TO cl_crm_bol_entity,
lr_partset TYPE REF TO cl_crm_bol_entity,
lr_coll   TYPE REF TO if_bol_entity_col,
lr_iterator TYPE REF TO if_bol_entity_col_iterator,
lr_current TYPE REF TO if_bol_bo_property_access,
lr_partner TYPE REF TO cl_crm_bol_entity.

lr_btadminh =me->typed_context->btadminh->collection_wrapper->get_current( ).
IF lr_btadminh IS BOUND.
lr_coll = lr_btadminh->get_related_entities(
                   iv_relation_name = 'BTHeaderPartnerSet' ). "#EC NOTEXT
          lr_current = lr_coll->get_current( ).

          lr_entity ?= lr_current.

          CHECK lr_entity IS BOUND.
        lr_coll = lr_entity->get_related_entities(
                   iv_relation_name = 'BTPartnerAll'' ).     "#EC NOTEXT

          lr_iterator ?= lr_coll->get_iterator( ).
          IF lr_iterator IS BOUND.
          lr_entity ?= lr_iterator->get_first( ).
            WHILE lr_entity IS BOUND.
            iv_attr_name = PARTNER_NO'                
            ev_result    = lv_partner_no ).

" Read you partner data and do your processing here              

              lr_entity ?= lr_iterator->get_next( ).

I hope this would resolve your issue. If yes please award the points