cancel
Showing results for 
Search instead for 
Did you mean: 

how to populate table editor which has dropdown by index in a column

Former Member
0 Kudos

Hi Experts,

I have a table editor with 3 columns.

Column 1. DD By Index - Subjects

Column2: marks ( input field )

column3: Result ( text view)

On an action of button on top of the view, i am getting the data for column2 and 3 and populating the node but i am unable to populate the column 1 Dropdown by Index.

My Node looks like this:


Node_Parent
   Node_DD
      Subject_Text
   Marks
   Result

When i get the internal table for Node_parent i am not getting Node_dd in that, so i am populating Marks and Result. binding it.

again looping on lt_parent and binding the node_dd.

it works fine when there is one row in lt_parent, its going for dump when its more than 2 records.

What am i missing while binding the subnode Node_DD while looping?

Any clue is highly appreciated.

Note: I am not using Supply Function to populate the subnode.

Ajay

Edited by: ajay matam on Aug 1, 2011 12:40 PM

Accepted Solutions (1)

Accepted Solutions (1)

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

Get all element of the parent node ( you have a method to get all the elements)

loop at all_elements.

get child node's element here....

using element u can bind or read the records.

endloop.

I assume you are looping at the values but not at the elements.

Edited by: ssm on Aug 1, 2011 1:43 PM

Former Member
0 Kudos

Hi ,

Thanks for your help.

I was not pointing to the Parents node and element instance while looping.

i changed it as below and its working fine.

Loop

l_element = lo_parent_node->get_element ( sy-tabix )

lo_child_node = l_element->get_child_node ( 'Node_DD' ).

lo_child_node->bind_table ( new_items = lt_data ).

Endloop

Answers (2)

Answers (2)

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

node_parent should be 0 to N cardinality.

Node_Dd should be 0 to N cardinality.

if you want to set or read the values.

get the context_element of the node_parent.

get the child node...and then get the values of the child node

Former Member
0 Kudos

Hi,

Parent Node and Child node has cardinality 0 to N only.

I am getting the child node of the parent.

Lo_node_parent->get_child_node ( name = 'Node_dd' )

i am trying to bind an internal table to Lo_node_parent but i am getting a dump with error

"COMPONENTCONTRLLER.1.PARENT.2.NODE_DD.NODE_DD" does not exist.

Binding works when there is one record in Parent node

loop at lt_parent into ls_parent.

binding the child node

endloop.

above thing works fine when there is one record, but when there are more than 1 record i am getting the above error.

Ajay

Edited by: ajay matam on Aug 1, 2011 1:40 PM

Former Member
0 Kudos

Hi ajay,

What is the cardinality you are using for Node_DD, it should be 0-n,0-1 for both parent node also.

Check this once.. goto st22 and and find what error you are getting?

Cheers,

Kris.