on 11-28-2008 6:47 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.