on 07-17-2013 3:39 PM
Hi, experts. I'm beginner in Web Dynpro.
I have some table ALV with checkbox column. I need calculate the values in column for that rows where checkbox is checked ( = ‘X’) and display sum in corresponding column (Price). How its making using aggregate property of alv for column (cl_salv_wd_aggr_rule), but I need do it only for checked rows.
Thank you very much.
How can I do it ?
Alex, instead of trying to alter the way standard aggregation work I would suggest to put a total row at the bottom which will show the total based on the check box state.
For the aggregation rule functionality available you can check this link.
http://wiki.sdn.sap.com/wiki/display/WDABAP/Aggregations+in+Web+Dynpro+ABAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Read the node at first as a table operation. Fallow the codes below.
i is
DATA lo_nd_alv_main TYPE REF TO if_wd_context_node.
DATA lt_alv_main TYPE wd_this->Elements_alv_main.
DATA ls_alv_main TYPE wd_this->Element_alv_main.
* navigate from <CONTEXT> to <ALV_MAIN> via lead selection
lo_nd_alv_main = wd_context->get_child_node( name = wd_this->wdctx_alv_main ).
lo_nd_alv_main->get_static_attributes_table( importing table = lt_alv_main ).
delete lt_alv_main where price = 'X'.
This will delete the checked box values from your internal table and by looping that table you can do as,
loop at lt_alv_main into ls_alv_main.
CALL METHOD lv_value->if_salv_wd_field_settings~get_field
EXPORTING
fieldname = 'LUGGWEIGHT'
RECEIVING
value = lr_field_amnt.
CALL METHOD lr_field_amnt->if_salv_wd_aggr~create_aggr_rule
EXPORTING
aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total
RECEIVING
value = lv_aggr_rule.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.