on 09-08-2009 6:44 AM
Hi Experts,
I am new to dynpro ABAP. iam trying to add 2 rows to a table ui in the init method.
output i am getting is having two empty rows added to the table. But it is not showing any content.
this is my code
DATA lo_nd_mynode TYPE REF TO if_wd_context_node.
DATA lo_el_mynode TYPE REF TO if_wd_context_element.
DATA ls_mynode TYPE wd_this->element_mynode.
DATA lv_attr3 LIKE ls_mynode-attr3.
lo_nd_mynode = wd_context->get_child_node( name = wd_this->wdctx_mynode ).
lo_el_mynode = lo_nd_mynode->get_element( ).
DATA : begin of str11,
str4 type string,
end of str11.
DATA :itab41 like STANDARD TABLE OF str11.
DATA : watab LIKE LINE OF itab41.
watab-str4 = 'hai'.
APPEND watab to itab41.
watab-str4 = 'hello'.
APPEND watab to itab41.
lo_nd_mynode->bind_table( itab41 ).
i want to display two rows with data 'hai' & 'hello'. but empty rows r coming . plz help me
Hi,
I guess you have not done binding correctly.
Right click on table UI. And select create binding. Now select your context.
Select cell editor as Text View, Remember to check the check box for binding.
Regards
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lekha & Rohit,
i have checked everithing but still the same pblm is there.
Is there any thing missing in my code.
my only requirement is to show a table with 2 rows of data in the init method.
two empty rows r added with the above code. but attribute is not showing any values in table.
plz give me a solution.
Hi,
The Attribute name with in the NODE and the Name of the field of the table (Internal table) should be same.
Please check it out.
Or
Directly read the table and append records to the internal table of (node) type.
DATA lo_nd_mynode TYPE REF TO if_wd_context_node.
DATA lo_el_mynode TYPE REF TO if_wd_context_element.
DATA ls_mynode TYPE wd_this->element_mynode.
DATA lt_mynode TYPE wd_this->elements_mynode.
DATA lv_attr3 LIKE ls_mynode-attr3.
ls_mynode-attr3 = 'WA'.
append ls_mynode to lt_mynode.
ls_mynode-attr3 = '100'.
append ls_mynode to lt_mynode.
*Get Node reference
lo_nd_mynode = wd_context->get_child_node( name = wd_this->wdctx_mynode ).
lo_nd_mynode->bind_table( lt_mynode ).
Hi,
what is the datatype for this - lv_attr3
I guess you have only one table column to be shown right.
Regards,
Lekha.
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.