cancel
Showing results for 
Search instead for 
Did you mean: 

Adding row to input enable table

Former Member
0 Kudos

Hi Everyone,

If suppose there is 5 rows input enable table and one button "ADD ROW" .when i click on button "ADD ROW" It should add one row at the end of fifth row.

I read for deleting rows on SAP Technical will it be helpful to my case. How do i proceed?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hallo,

This has been covered many times in SCN. With simple search you would get lots of info.

Basically you need to insert a context_element to the context node which is binded to the table.

For example if you have details context node.

data: lo_nd_details type ref to if_wd_context_node,
        ls_details type wd_this->element_details,
        lo_new_element type ref to if_wd_context_element.
 
  lo_nd_details = wd_context->get_child_node( name = wd_this->wdctx_details ).
 
* append a line to the node
  lo_new_element =  lo_nd_details->bind_structure( new_item = ls_details
                                  set_initial_elements = abap_false ).

you insert it on a desired index by supplying index parameters.

* append a line to the node
  lo_new_element =  lo_nd_details->bind_structure( new_item = ls_details
                                  set_initial_elements = abap_false 
                                   index = 1 ).

The above code inserts empty row. If you wanted to fill some columns then you can set the values in ls_details structure.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi johnright,

Not you can do it easily.

Make button.

ON_ACTION of your button :-

Go to code wizard. There you select the node which displays as a table. click on append check box.

This will generate your code.

Now check your application.

Reply in case of any issue.

Thanks & Regards,

Monishnkar C

Former Member
0 Kudos

thanx