on 09-27-2013 1:45 PM
Hi,
I am trying to create dynamically a text view but I get an error stating that:
"first child element in a container with "MatrixLayout" must be of type "MatrixHeadData"
This is my code:
lo_text = cl_wd_text_view=>new_text_view( bind_text = 'ORG_DATA.ORG_NAME'
id = lv_viewid ).
CALL METHOD cl_wd_matrix_head_data=>new_matrix_head_data
EXPORTING
element = lo_text
RECEIVING
control = lo_matrix.
CALL METHOD cl_wd_matrix_data=>new_matrix_data
EXPORTING
element = lo_text
RECEIVING
control = lo_matrixd.
lo_text->set_layout_data( the_layout_data = lo_matrixd ).
lo_new_group->add_child(
EXPORTING
* index = " INDEX
the_child = lo_text
).
Any help is appreciated.
Thanks,
Tim
CALL METHOD cl_wd_matrix_head_data=>new_matrix_head_data
EXPORTING
element = lo_text
RECEIVING
control = lo_matrix.
CALL METHOD cl_wd_matrix_data=>new_matrix_data
EXPORTING
element = lo_text
RECEIVING
control = lo_matrixd.
lo_matrixd is your matrix data not head one because you have created it by CALL METHOD cl_wd_matrix_data=>new_matrix_data but lo_matrix is your header data.
Now you are using your normal Lo_matrixd for adding in below code.
lo_text->set_layout_data( the_layout_data = lo_matrixd ).
Change it by, lo_matrix
lo_text->set_layout_data( the_layout_data = lo_matrix ).
This will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello issue is you are creating a new UI element that should be head data for your TC.
Remove:
CALL METHOD cl_wd_matrix_data=>new_matrix_data
EXPORTING
element = lo_text
RECEIVING
control = lo_matrixd.
lo_text->set_layout_data( the_layout_data = lo_matrixd ).
and add:
cl_wd_matrix_head_data=>new_matrix_head_data( lo_text ).
For more Info : read the this document , it have some code for dynamic programing:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes matrixheaddata should be the 1st element.
Refer http://paperstreetenterprises.com/web-dynpro-dynamically-adding-screen-elements/ for example on how to use matrix layout.
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.