Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Adding new container in other container

Hi experts,

I need to add container to other container dynamically.

It's my coding:

DATA lr_cont_pc TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.

DATA lr_cont TYPE REF TO cl_wd_uielement_container.

DATA lr_matrix TYPE REF TO cl_wd_matrix_data.

data lr_cont_2 TYPE REF TO cl_wd_uielement_container.

lr_cont ?= view->get_element( 'RIGHT_CONTAINER' ).

CALL METHOD CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER

EXPORTING

id = 'CONT_PC'

RECEIVING

control = lr_cont_pc.

lr_matrix = cl_wd_matrix_data=>new_matrix_data( lr_cont_pc ).

lr_cont_pc->set_layout_data( lr_matrix ).

CALL METHOD lr_cont->add_child

EXPORTING

index = 1

the_child = lr_cont_pc.

But I have dump:

OBJECTS_OBJREF_NOT_ASSIGNED

Access via 'NULL' object reference not possible.

Method: CREATE_NW7_BY_VIEW_ELEMENT of program CL_NW7_VIEW_ELEMENT_ADAPTER===CP

Thanks in advance

Evgeniy

Former Member
Not what you were looking for? View more on this topic or Ask a question