cancel
Showing results for 
Search instead for 
Did you mean: 

To edit and save table UI element data to the database custom table

Former Member
0 Kudos

I have created a custom table with 4 fields. In layout i have kept a table and have done context binding. I have a button to save. At runtime, changes made in the table should be saved when save button is clicked to the custom table.Kindly help...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Get the attributes of the table in update it accordingly into your Z-table and sample code is already provided by Rama.

Thanks

KH

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

For step by step explanation, you can refer my document below.

http://scn.sap.com/docs/DOC-2366

ramakrishnappa
Active Contributor
0 Kudos

Hi Jonathan,

Hope there is action created for button SAVE.

Now, write the below code to read data from context


        data lo_node   type ref to if_wd_context_node.

          data lt_data     type wd_this->elements_MY_NODE.

          lo_node    = wd_context->get_child_node( wd_this->wdctx_my_node ).

          lo_node->get_static_attributes_table( importing  table = lt_data ).

         

          " Now, update data to ztable

               modify ztable from table lt_data. " Note this logic you should put in a class

Regards,

Rama