Hi Jerry Cui
you can fetch the data in do_init_context method for displaying default values when ever your login into web ui the data will displayed in your table view.
CREATE DATA ls_structure_name
example code: this is for value node.. ( for custome structure "zstruture").
types : BEGIN OF TY_LINE,
your strucute fields..
END OF TY_LINE.
data : lr_valuenode type ref to cl_bsp_wd_value_node,
wa_line type ref to ty_line.
CREATE DATA wa_line.
CREATE OBJECT LR_VALUENODE
EXPORTING
IV_DATA_REF = wa_line.
typed_context->opptdetails->collection_wrapper->add( lr_valuenode ).
the above code is for one record if you have more then one record then loop the records and convert that records into collection. have to pass the total collection into your context node. see the below attached pic.
here i have used the standard structure that i have converted into collection assign to the node level..
just go through this link..
SAP CRM WEB UI : 57.VALUE NODE - DISPLAYING CUSTOM TABLE ON WEB UI
Thanks & Regards,
Srinivas.