cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP: Get parent container

Former Member
0 Kudos

Hello,

In my action handler method I have an ID of the element that triggered this event, lets call it ELEMENT_A.

I need to get UI element (let's call it container_element) that contains ELEMENT_A.

I know that this container_element is type of cl_wd_transparent_container.

How can this be done?

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

srinivasa_raghavachar
Participant
0 Kudos

Hi Georgy,

You could get reference to the UI element and then use GET_PARENT method to get the container. Ofcourse, you should use VIEW for this.

I have successfully used the following code to get refernce of a dropdown in a table. On similar lines, I guess you could get the container refernce.

data wd_table_cell_editor type ref to cl_Wd_view_element.

data wd_table_column type ref to cl_wd_table_column.

wd_table_cell_editor ?= wd_this->m_view->get_element( ID ).

wd_table_column ?= wd_table_cell_editor->get__parent( ).

DATA: THE_TABLE_CELL_EDITOR type ref to CL_WD_DROPDOWN_BY_KEY,

dropdown_value type string.

THE_TABLE_CELL_EDITOR ?= wd_table_column->GET_TABLE_CELL_EDITOR( ).

CALL METHOD THE_TABLE_CELL_EDITOR->GET_SELECTED_KEY

  • EXPORTING

  • CONTEXT_ELEMENT =

  • CONTEXT_NODE_PATH_NAME =

RECEIVING

VALUE = dropdown_value.

.

I have declared M_VIEW as an attribute(TYPE REF TO IF_WD_VIEW) in my view and used the following code in WDDOMODIFYVIEW method.

if first_time = abap_true.

wd_this->m_view = view.

endif.

Regards,

Srini.