cancel
Showing results for 
Search instead for 
Did you mean: 

modify table

Former Member
0 Kudos

Hi Forum,

I have created one database table named ZBOOKINFO. I want to modify the records in it after displaying the table. I could able to display the table on the screen but unable to modify. Kindly help me.

Here is my code.

method wddoinit.

data : node_zbook type if_wd_context_node,

itab type standard table of zbookinfo.

select * from zbookinfo into table itab.

node_zbook = wd_context->get_child_node( name = 'node_zbook' ).

node_zbook->bind_table ( itab ).

endmethod.

regards

mallika

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Mallika,

As how you said the below snippet does only end in displaying the data for the user.

method wddoinit.

data : node_zbook type if_wd_context_node,
itab type standard table of zbookinfo.

select * from zbookinfo into table itab.

node_zbook = wd_context->get_child_node( name = 'node_zbook' ).
node_zbook->bind_table ( itab ).
endmethod.

If you have already managed to display the table in editable mode as how described in [here|; then you can create a toolbar button for saving the records on to the database. Within the action handler for this method you can try fetch all the data being displayed in the table into an internal table using the get_static_attributes_table method.

DATA: node_flighttab TYPE REF TO if_wd_context_node,
          lt_sflight TYPE if_resultview=>elements_node_flighttab.
 
 node_flighttab = wd_context->get_child_node( name = `NODE_FLIGHTTAB` ). " NODE_FLIGHTTAB is the node that you have bound to your table
node_flighttab->get_static_attributes_table( IMPORTING table = lt_sflight ). " Get all tables data into your internal table lt_sflight

You can then just say modify <database table> from <internal table> However note that this is not suggested in real time. This is only for your practice purpose.

Regards,

Uday

Answers (1)

Answers (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Mallika,

You have already raised a [thread |;earlier for the same issue and I have already replied for the same in that one. You have now re-created 2 new threads for the same issue. Check the earlier [thread |;for the solution.

Uday