on 07-09-2009 10:04 AM
Hi,
I have created an application that uses a web dynpro alv grid. I want to display totals - is there a setting that can do this automatically - if so, can you please tell me how to do this? Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can take help of following code snippet to create totals for a particular column
Data: lr_function_settings TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column TYPE REF TO cl_salv_wd_column,
lt_column type salv_wd_t_column_ref,
ls_column type salv_wd_s_column_ref.
Data: lr_field_amnt type REF TO CL_SALV_WD_FIELD.
* get reference of ALV component
lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_EARNED_ALV( ).
wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
* get function settings
lr_function_settings ?= wd_this->alv_config_table.
* display columns in correct order
lr_column_settings ?= wd_this->alv_config_table.
lt_column = lr_column_settings->get_columns( ).
loop at lt_column into ls_column.
CASE ls_column-id.
when 'AMOUNT'
* aggregate field
CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD
EXPORTING
FIELDNAME = 'AMOUNT'
RECEIVING
VALUE = lr_field_amnt.
* create aggregate rule as total
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.
endcase.
Regards
Manas DUa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
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.