cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the reference of the ROADMAP element placed in the view

Former Member
0 Kudos

Dear ALL,

I have placed a UI element on the view.

I want to add few steps to it dynamically.

My question is:

1. How to get the reference of the roadmap element placed on the view?

Thank you,

Regards,

Shashikanth. D

Accepted Solutions (0)

Answers (1)

Answers (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Shashikanth,

Please refer to this [article|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a092160b-6165-2b10-e9a2-d484e6b8a9ac], check page no. 21, it says something about creating roadstep dynamically.

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi Arjun,

Yes i know that there are few methods in a class called CL_WD_ROAD_MAP to add few steps to it.

I want to know how to get the reference of that UI element.

I tried calling the method GET_ELEMENT of the interface 'IF_WD_CONTEXT_ELEMENT' and tried to assign the reference to that reference variable of the class CL_WD_ROAD_MAP.

If there is any such a process, please let me know.

Thank you,

Regards,

Shashikanth. D

arjun_thakur
Active Contributor
0 Kudos

Hi,

In one of the post I read this code, check it out, it might help.

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

Arjun

Former Member
0 Kudos

Hi Arjun,

I have seen that post earlier, and i have a query regarding the code which you pasted and the one present there.

The question is:

the statement lr_road_map->remove_all_steps( ). to get executed, we need a reference of the ROADMAP UI element in that reference variable.

How you are trying to get the value?

Thank you,

Regards,

Shashikanth. D

arjun_thakur
Active Contributor
0 Kudos

Hi,

Try this:


data view type ref to if_wd_view.
  data road_map_step type ref to cl_wd_road_map_step.
  data road_map type ref to cl_wd_road_map.

  view = wd_this->m_view.
  road_map ?= view->get_element( 'ROADMAP' ).
  road_map_step = cl_wd_road_map_step=>new_road_map_step(
    view = view
    description = 'More' ).

Regards

Arjun