cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with dynamic Road Map Steps

saket_abhyankar
Active Participant
0 Kudos

Hi

I have written following code in the WDDOMODIFYVIEW method of a view to create RoadMapStep UI element dynamically.

'item_line' var contains int value

**************************

data: idv type n.

data: idvs type string.

idv = 1.

lr_road_map->remove_all_steps( ).

do item_line times.

concatenate 'A' idv into idvs.

lr_road_map_step = cl_wd_road_map_step=>new_road_map_step( id = idvs ).

lr_road_map->add_step( lr_road_map_step ).

idv = idv + 1.

clear idvs.

enddo.

**************************

The code running fine for the 1st time but for 2nd time (ie when user have interaction on the screen) it's giving dump with error message 'View Element with ID A1 in View V_DISPLAY_DETAIL Already Exists'.

When I debug the prog, there was uncaught exception in lr_road_map->add_step( lr_road_map_step ). this step.

I think it's giving prob because all the steps created in before interaction are not getting cleared. I want to clear remove all the previous Road Map Steps & their IDs. Please suggest the solution or another way to achieve the same result.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sacket,

This happens because you have to remove the UI element from the view every time you rebuild

the roadmap. Maybe you could use something like:

data: lo_container type ref to cl_wd_uielement_container.

data: idv type n.

data: idvs type string.

idv = 1.

lr_road_map->remove_all_steps( ).

do item_line times.

concatenate 'A' idv into idvs.

lo_container ?= wd_this->iv_view->get_element( 'CONTAINER_THAT_HAS_ROADMAP' ).

lo_container->remove_child( id = idvs ).

lr_road_map_step = cl_wd_road_map_step=>new_road_map_step( id = idvs ).

lr_road_map->add_step( lr_road_map_step ).

idv = idv + 1.

clear idvs.

enddo.

Regards,

Alexandros Kontopoulos

Edited by: Alexander Kontopoulos on Jan 11, 2009 11:31 PM

Edited by: Alexander Kontopoulos on Jan 11, 2009 11:33 PM