Skip to Content
0
Former Member
Oct 15, 2006 at 12:39 PM

Dump when using Widening Cast

36 Views

Hi,

Variable declaration

DATA:

lo_busobj TYPE REF TO if_reca_bus_object,

lo_sub TYPE REF TO zcl_reor_rental_request_ci,

lo_parent TYPE REF TO cl_reor_rental_request.

this is the super class -> cl_reor_rental_request

this is the sub class ->zcl_reor_rental_request_ci

lo_busobj - > this refrence contains the reference to the object 'cl_reor_rental_request'

I want to call the redefined method of my class zcl_reor_rental_request_ci. so for this i assign the object of the class (zcl_reor_rental_request_ci) to the interface reference. BUT

The problem is the already assigned referance of the super class has some attributes assigned in it so I need to copy those attributes in my sub class object and then pass it to the interface reference variable so that all operation are carried out as in normal case, otherwise if i direclty assign the newly created subclass object to the interface reference variable it will call the redefined method but the nothing will happen.

For this reason i tried to assign the super class object to the sub class object i.e WIDENING CAST but it gives a dump

*****************Part of DUMP************************
However, the current content of the source variable does not fit into the target variable.
 source type: "CLASS=CL_REOR_RENTAL_REQUEST"
 target type: "CLASS=ZCL_REOR_RENTAL_REQUEST_CI"

Help is very much appreciated.

Regards,

Khusro Habib