cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete particular line item in table control using webdynpro

Former Member
0 Kudos

1.First we select the delete icon it will navigate to popup window 2. in that we enter yes button means deleted line item  is not  refelected in the table control but it is deleted in  database table and message will be populating in initial screen .i need to refresh in table control thats my issue..

Give some sample code for my issue...

Accepted Solutions (1)

Accepted Solutions (1)

chengalarayulu
Active Contributor
0 Kudos

Hi Prabhu,

I think you are using popup for confirmation. Just map the node to the context of Popup View which is bound to Table. Then it will be easy to delete. just follow the below steps .

on action YES,

     Data:      lo_element type ref to if_wd_context_element,

                   lo_nd_table type ref to if_wd_context_node.

<<<<<<< Get node reference >>>>>>>>

lo_element = wdevent->get_context_element( name =  'CONTEXT_ELEMENT' ).

method 1. lo_nd_table->remove_element( lo_element ).

method 2.

               data: lv_index type i.

     lv_index = lo_element->get_index( ).

lo_nd_table->remove_element( index = lv_index ).

Hope this will resolve.

Former Member
0 Kudos

Thanks to all of u.My issue is solved..

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Prabhu,

1. Make the delete button row as link_to_action UI element and give it the appropriate icon.

2. Now on the action of the link_to_action method.

do the following

data:

elem type if_wd_context_element,

node type if_wd_context_node.

elem = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).

node = wd_context->get_child_node( 'node_name' ).

node->remove_element( elem ).

The above code will remove the exact row that you pressed to delete.

3. To remove it from database.

get the key from the elem.

elem->get_attribute( exporting name = 'name' importing value = key ).

now delete from database using the delete query by passing the key....

Regards,

Fareez