cancel
Showing results for 
Search instead for 
Did you mean: 

Make entries in a table in webdynpro abap

Former Member
0 Kudos

Hi all,

We have a requirement to make multiple entries in a Table in webdynpro ABAP.

We have created a table and inserted inputfield as cellEditor

but at runtime it is being displayed in readonly mode we cannot enter anything in that inputfield.

inputfield is binded with a context and table is not in readonly mode.

Please help in this regards

thanks & regards.....

Gaurav Makin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gaurav,

Make sure the context node bound to the table has cardinality 0..N.

When the app starts you probably need to read the table contents from the database or some other source and populate the contect node.

The table will allow the user to edit values only for the rows that have a corresponding element in the context node.

If the initial content is empty, i.e. no elements in the context node then the user will not be able to edit.

You will need to either initialize the context node with a bunch of elements if the number of entries is fixed and known beforehand, or provide a way for the user to create a new row.

You can do this by adding a toolbar to the table with a create button with a CREATE action and the following method:

method onactioncreate.

data:

lo_element type ref to if_wd_context_element,

lo_node type ref to if_wd_context_node.

lo_node = wd_context->get_child_node( name = 'your node name here' ).

lo_element = lo_node->create_element( ).

lo_node->bind_element( new_item = lo_element set_initial_elements = abap_false ).

endmethod.

Regards... Lucio Menzel

Former Member
0 Kudos

thanks Lucio,

the following code works fine, problem is solved

method onactioncreate.

data:

lo_element type ref to if_wd_context_element,

lo_node type ref to if_wd_context_node.

lo_node = wd_context->get_child_node( name = 'your node name here' ).

lo_element = lo_node->create_element( ).

lo_node->bind_element( new_item = lo_element set_initial_elements = abap_false ).

endmethod.

thanks & regards...

Gaurav Makin

Former Member
0 Kudos

award points please.

regards... Lucio

Former Member
0 Kudos

hi,

i have alreade rewarded full points.

thanks

Gaurav

Answers (0)