Skip to Content
0
Former Member
Nov 11, 2004 at 02:16 PM

Modify Standard Abstract Classes.

310 Views

I would like to know what is the approach to extend a

Standard Delivered Abstract Class.

I tried the following approach, but it doesnt seem to work.

I want to add some methods to the standard Abstract Class

CL_CRM_AUI_ENTITY. So i created a copy(not inheritance )

-> ZCL_CRM_AUI_ENTITY and added a new abstract method to this class.

The Class CL_CRM_AUI_ONEORDER implements the methods of the abstract class. I implemented the new method here.

Now in my Application :

The following code works - <b>Reference to the standard delivered abstract class cl_crm_aui_entity.</b>

data : lv_bol_entity type ref to cl_crm_bol_entity lv_aui_entity type ref to cl_crm_aui_entity.

....

....

IF lv_bol_entity is bound.

lv_aui_entity ?= lv_bol_entity.

ENDIF.

The following code <b>does not</b> work and gives me a CX_SY_MOVE_CAST_ERROR.

data : lv_bol_entity type ref to cl_crm_bol_entity,

lv_aui_entity type ref to <i><b>zcl_crm_aui_entity</b></i>.

....

....

IF lv_bol_entity is bound.

lv_aui_entity ?= lv_bol_entity.

CATCH...

ENDCATCH.

ENDIF.

Is the solution then to modify the standard delivered abstract class or can we work around this?

Thanks.