Skip to Content
author's profile photo Former Member
Former Member

get entity BTPartner

Hi,

I am trying to get the GUID for my contact in context node BTPARTNERCONTACT in the lead component.

I am writing the following code in the get_partnerno:

method GET_PARTNERNO.

DATA: current TYPE REF TO if_bol_bo_property_access.

  • value = 'BTPartner not bound'. "#EC NOTEXT

IF iterator IS BOUND.

current = iterator->get_current( ).

ELSE.

current = collection_wrapper->get_current( ).

ENDIF.

value = cl_crm_uiu_bt_partner=>get_partner2( current ).

DATA : lr_part TYPE REF TO cl_crm_bol_entity,

lv_mode_en TYPE string,

ET_ADSMTP TYPE bapiadsmtp,

iv_partner type BU_PARTNER.

lr_part ?= typed_context->partner->collection_wrapper->get_current( ).

*THIS LINE IS GIVING AN EXCEPTION ANY IDEA????

lv_mode_en = lr_part->get_property_as_string( iv_attr_name = 'PARTNER_GUID' ).

CALL FUNCTION 'BUPA_ADDRESS_GET_DETAIL'

EXPORTING

  • IV_PARTNER =

IV_PARTNER_GUID = lv_mode_en

  • IV_ADDRNUMBER =

  • IV_ADDRGUID =

  • IV_VALDT = SY-DATLO

  • IMPORTING

  • ES_ADDRESS = ADDRESS.

TABLES

ET_ADSMTP = ET_ADSMTP.

lr_part->set_property( iv_attr_name = 'e_mailsmt' iv_value = ET_ADSMTP-E_MAIL ).

.

endmethod.

I am getting an exception here

lr_part ?= typed_context->partner->collection_wrapper->get_current( ).

is this the correct way 2 get an entity?

Please help!!!

Regards

Shilpi

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 04, 2008 at 10:02 AM

    Hi Shilpi,

    In this method the Current refers to the entity BTPARTNERCONTACT.

    You need to back trace from BTPARTNERCONTACT to BTPARTNER and for that you need to use the method get_partner( ).

    You cannot do this using me->typed_context since this is not a part of your context node it is a part of your controller class.

    I hope this helps.

    Regards,

    S Sarma.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 04, 2008 at 09:51 AM

    Hello Shilpi,

    This is not the correct way to get the partner entity. I think you are trying to access a method of lr_part when it is not initialised that is the reason why you get the error.

    What you can do is use is you need to get the parent entity relation and back trace it till you reach the partner.

    Once you reach the partner entity you can get the guid.

    In cl_crm_bol_entity there is a method to GET_PARENT( ) use this method to do so.

    Regards,

    S Sarma

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      lr_part1 ?= ME->TYPED_CONTEXT->workaddress->COLLECTION_WRAPPER->GET_CURRENT( ).

      Class ZL_BT108H_L_DETAIL_CN10,Method GET_PARTNERNO

      Field "WORKADDRESS->COLLECTION_WRAPPER->GET_CURRENT(" is unknown. It is

      not contained in one of the specified tables nor is it defined by a

      "DATA" statement. "DATA" statement.

      Why am i getting this error?

      Regards

      Shilpi

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.