Skip to Content
0
Former Member
Aug 05, 2008 at 06:34 AM

accessing of context node

43 Views

Hi Experts,

I m stuck on this issue for a long time now.

Using component controller i had added the node WORKADDRESS of BP_CONT to my component BT108H_LEA.

Now i have written the following code in the event EH_ONSEL_CONTACT in order to get the email address for a contact selected.

The problem is with the last step

lr_workaddress ?= me->ztyped_context->workaddress->collection_wrapper->get_current( ).

if lr_workaddress is bound.

call method lr_workaddress->set_property( iv_attr_name = 'e_mailsmt' iv_value = 'rraturi' ).

endif.

I am not able to access workaddress node and hence the set property method is not being called.

Please help!!!!

method EH_ONSEL_CONTACT.

CALL METHOD SUPER->EH_ONSEL_CONTACT

EXPORTING

HTMLB_EVENT = HTMLB_EVENT

HTMLB_EVENT_EX = HTMLB_EVENT_EX

.

DATA : lr_part TYPE REF TO if_bol_bo_property_access,

lv_mode_en TYPE string,

ET_ADSMTP TYPE bapiadsmtp,

lv_bp_guid type crmt_object_guid,

dref TYPE REF TO data,

iv_partner type crmt_object_guid.

DATA: lv_ADSMTP type standard table of BAPIADSMTP.

DATA: lv_address type BAPIBUS1006_ADDRESS.

DATA: lr_part1 type ref to cl_crm_bol_entity.

DATA: lr_workaddress type ref to cl_crm_bol_entity.

lr_part ?= me->typed_context->BTPARTNERCONTACT->collection_wrapper->get_current( ).

if lr_part IS BOUND.

CALL METHOD lr_part->get_property_as_value

EXPORTING

iv_attr_name = 'BP_PARTNER_GUID'

IMPORTING

ev_result = lv_bp_guid.

ENDIF.

CALL FUNCTION 'BUPA_ADDRESS_GET_DETAIL'

EXPORTING

IV_PARTNER_GUID = lv_bp_guid

TABLES

ET_ADSMTP = lv_ADSMTP.

lr_workaddress ?= me->ztyped_context->workaddress->collection_wrapper->get_current( ).

if lr_workaddress is bound.

call method lr_workaddress->set_property( iv_attr_name = 'e_mailsmt' iv_value = 'rraturi' ).

endif.

endmethod.

Regards

Shilpi