Skip to Content
0
Former Member
Nov 03, 2012 at 05:35 AM

MOVE_CAST_ERROR when BRFplus application is called in ABAP program

249 Views

Hi,

When I called my brfplus application in to an abap program Iam getting MOVE_CAST_ERROR dump in the line highlighted, please help

REPORT Z_TESTING_BRF.

DATA: LO_ADMIN_DATA TYPE REF TO IF_FDT_ADMIN_DATA,
LO_FUNCTION TYPE REF TO IF_FDT_FUNCTION,
LO_CONTEXT TYPE REF TO IF_FDT_CONTEXT,
LO_RESULT TYPE REF TO IF_FDT_RESULT,
LX_FDT TYPE REF TO CX_FDT,
lv_discount type if_fdt_types=>element_number.

CL_FDT_FACTORY=>GET_INSTANCE_GENERIC( EXPORTING IV_ID = '001E0BD7385C1EE2899E40EC332EC2C4'
IMPORTING EO_INSTANCE = LO_ADMIN_DATA ).

BREAK-POINT.
LO_FUNCTION ?= LO_ADMIN_DATA.
LO_CONTEXT ?= LO_FUNCTION->GET_PROCESS_CONTEXT( ).
LO_CONTEXT->SET_VALUE( IV_NAME = 'CUSTOMER' IA_VALUE = 'guru' ).
LO_CONTEXT->SET_VALUE( IV_NAME = 'S_DATE' IA_VALUE = 'guru' ).
LO_CONTEXT->SET_VALUE( IV_NAME = 'S_CARR_ID' IA_VALUE = 'guru' ).
LO_CONTEXT->SET_VALUE( IV_NAME = 'S_FROM_CIT' IA_VALUE = 'guru' ).
LO_CONTEXT->SET_VALUE( IV_NAME = 'S_TO_CITY' IA_VALUE = 'guru' ).
TRY.
LO_FUNCTION->PROCESS( EXPORTING IO_CONTEXT = LO_CONTEXT IMPORTING EO_RESULT = LO_RESULT ).
LO_RESULT->GET_VALUE( IMPORTING EA_VALUE = lv_discount ).
* WRITE: 'The price of', PRODUCT, 'is', (6) PRICE-NUMBER DECIMALS 2, PRICE-CURRENCY NO-GAP, '.'.
CATCH CX_FDT INTO LX_FDT.

endtry.

dump is below

Category ABAP Programming Error Runtime Errors MOVE_CAST_ERROR Except. CX_SY_MOVE_CAST_ERROR ABAP Program Z_TESTING_BRF

Application Component Not Assigned

Date and Time 02.11.2012 21:16:24

Short text

Dynamic type conflict when assigning references

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_MOVE_CAST_ERROR', was not

caught and

therefore caused a runtime error.

The reason for the exception is:

It was tried to assign a reference to a rereference variable using the

'CAST' operation ('?=' or 'MOVE ?TO').

However, the current content of the source variable does not fit into

the target variable.

source type: "\CLASS=CL_FDT_APPLICATION"

target type: "\INTERFACE=IF_FDT_FUNCTION"