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

cast exception

I am getting an exception:

An exception has occurred

Exception Class

CX_SY_MOVE_CAST_ERROR - Source type \CLASS=CL_CRM_BOL_ENTITY_COL is not compatible, for the purposes of assignment, with target type \CLASS=CL_CRM_BOL_ENTITY

Method:

ZL_BT108H_L_DETAIL_IMPL=>EH_ONSEL_PROSPECT

Exception point:

lv_builbcW = lr_builheader->get_related_entities( iv_relation_name = 'BuilMarketingRel').//exception point

method EH_ONSEL_PROSPECT.

CALL METHOD SUPER->EH_ONSEL_PROSPECT

EXPORTING

HTMLB_EVENT = HTMLB_EVENT

HTMLB_EVENT_EX = HTMLB_EVENT_EX

.

DATA : industry(4) type c,

query_service TYPE REF TO cl_crm_bol_dquery_service,

query_result TYPE REF TO if_bol_entity_col,

lr_builheader TYPE REF TO cl_crm_bol_entity,

lv_builbcw TYPe REF TO cl_crm_bol_entity,

lv_builbc TYPE REF TO if_bol_entity_col,

lr_partnerno TYPE string.

query_service = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).

IF query_service IS BOUND.

CALL METHOD query_service->add_selection_param

EXPORTING

iv_attr_name = 'PARTNER'

iv_sign = 'I'

iv_option = 'EQ'

iv_low = lr_partnerno.

query_result = query_service->get_query_result( ).

lr_builheader = query_result->get_first( ).

endif.

CHECK lr_builheader IS BOUND.

lv_builbcW = lr_builheader->get_related_entities( iv_relation_name = 'BuilMarketingRel').//exception point

lv_builbcw ?= lv_builbc.

Can anyone please help!!

Regards

Shilpi

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 08:27 AM

    Hello Shilpi,

    pay attention the types of your CLASS and returning INTERFACE

    lv_builbcw ==> CL_CRM_BOL_ENTITY

    lr_builheader->get_related_entities(..) ==> IF_BOL_ENTITY_COL

    that means that you need to use casting ?=

    Good Luck

    Eli Steklov

    Add a comment
    10|10000 characters needed characters exceeded

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.