on 01-20-2007 10:56 AM
I am searching for a method /methods in order to show totals in an ALV in WD4A.
The individual lines contain prices and I would like to show the client the total of the individual lines (dynamically).
Is there a way to accomplish this?
Regards,
Henry
Hi Hendry,
You can use calculations for totaling field values. Add the below code to the WDDOINIT() method of the view. It will create aggregation rule that will display the total at the end of the ALV.
* declare field and field settings object
data:
lr_field_settings type ref to if_salv_wd_field_settings.
data:
lr_field type ref to cl_salv_wd_field,
lr_aggr_rule type ref to cl_salv_wd_aggr_rule.
* get field and create aggregation rule of type total
lr_field = lr_field_settings->get_field( 'FIELDNAME' ).
lr_field->if_salv_wd_aggr~create_aggr_rule( ).
lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule( ).
lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
Hope it helps
Regards
Rakesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works just fine.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.