cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Ui Element

Kishore25sap
Explorer
0 Kudos

Hi,

While Creating dynamic ui element am getting short dump ' Adapterfehler im FLOW_LAYOUT "_02" des Views "ZKI_WD_DEMO4.MAIN": Der LayoutData-Typ "MATRIX_HEAD_DATA" für das Kindelement "B1" ist nicht zulässig.

My Code like : 1st Creating rootuielement

2nd input field

3rd passing inputfield to new_matrix_data

add child to container

Regards

Kishore

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

As the ROOTUIelement is already available, get the reference of it and then set the LAYOUT as MATRIX for that..Before you set the layout you need to get the reference of layout element and use it. Please search forum as there are many threads on dynamic programming.

Former Member
0 Kudos

Seems to me that you have flow lauout and then matrix head data which are not relating each other. So verify you code and see that you create matrix layout and then add matrix head data and matrix data.

Kishore25sap
Explorer
0 Kudos

Hi Basker,

Thanks for reply

i create all the 3 matrix .

My code is:

LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).

lr_matrix_layout = cl_wd_matrix_layout=>new_matrix_layout(

lr_container ).

lr_label = cl_wd_label=>new_label(

id = 'LABEL4'

label_for = 'INPUT_ID'

TEXT = 'PLANT' ).

lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data(

lr_label ).

lr_input = CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD(

*EXPORTING

BIND_VALUE = 'DATA'

ID = 'INPUT_ID' ).

lr_matrix = cl_wd_matrix_data=>new_matrix_data(

lr_input ).

lr_input->set_layout_data( lr_matrix ).

LR_CONTAINER->ADD_CHILD( LR_INPUT ).

LR_CONTAINER->ADD_CHILD( LR_label ).

Error is Adapterfehler im MATRIX_LAYOUT "_03" des Views "ZKI_WD_DEMO4.MAIN": Das erste Kindelement in einem Container mit "MatrixLayout" muss vom Typ "MatrixHeadData" sein.

While debugging al these code are executed without error. am new to webdynpro abap pls suggest me.

Regards

kishore

Former Member
0 Kudos

You still have mistake, You might have missed out something in your coding. What i do normally is to create it statically and see everything is working and see the difference in creating dynamically. In this way you know which piece of code you missing.

saravanan_narayanan
Active Contributor
0 Kudos

Hello Kishore,

What I understood from the following lines is that you are trying to change the layout of the ROOTUIELEMENTCONTAINER to matrix layout. you have created the layout but you are not setting the layout to the container

LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).

lr_matrix_layout = cl_wd_matrix_layout=>new_matrix_layout(

lr_container ).

piece of code to set the layout

lr_container->set_layout( lr_matrix_layout ).

BR Saravanan