cancel
Showing results for 
Search instead for 
Did you mean: 

table UI is showing rows with empty data

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member40425
Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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 ).

Former Member
0 Kudos

Thanks lekha..

both names were diffierent. now issue is solved.

thanks a lot....

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

what is the datatype for this - lv_attr3

I guess you have only one table column to be shown right.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

thanks for the response.

lv_attr3 is string.

node is having cardinality 0.n and selection 0.1

table is binded with this node and i want to show only one cloumn.

But the rows r coming empty. its showing two empty rows.

Former Member
0 Kudos

Is the display empty rows checkbox checked for the TABLE UI element.

One thing you do, Create the Binding again for the TABLE UI element.