cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve this error ?

11-18-2021 8:44 AM
1539 views 5 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

I want to add a Table to Transparent container in Web dynpro component. An error occurred when I run the pgm.

My source as below:

Data: lo_api type ref to if_wd_view_controller,

lo_view type ref to if_wd_view,

lr_tc type ref to cl_wd_transparent_container,

lr_table type ref to cl_wd_table.

lo_api = wd_this->wd_api( ).

lo_view ?= lo_api. " Program dummp here

cl_wd_grid_data =>new_grid_data( element = lr_data ).

lr_tc ?= wd_this->lo_view->get_element( id = 'TC2' ).

lr_tc->add_child( lr_table ).

Error message in ST22 as below:

Runtime errors: MOVE_CAST_ERROR.

Exception: CX_SY_MOVE_CAST_ERROR

The reason for the exception is: the current of the source variable does not fit into the target variable.

source type:"\FUNCTION-POOL=WDR_RG_PROXY_FACTORY\CLASS=LCL_VIEW_CTLR_PROXY"

target type:"\INTERFACE=IF_WD_VIEW"

Please suggest me how to resolve this error,thanks!

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

ThorstenHoefer
Active Contributor

Hi Samuel,

do you implement the method wddomodifyview? Here you have already the parameter view.

you can reference the view with

view->get_element( ...)

https://help.sap.com/viewer/fc79a39b30fe4d9aa983bad6787ab9ad/1809.000/en-US/027e2651d7066e62e1000000...

0 Likes

Thanks for your advice!

Answers (0)