cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro ALV settings Calculation options

Former Member
0 Kudos

Hi Experts,

Can you please let me know whether it is possible to add an extra Calculation option in the 'Calculation' tab of Webdynpro ALV settings? We have options for Total, Minimum, Maximum and Mean. Is there any ALV configuration settings that can take care of an additional option added here?

Thanks and Regards,

Rishin Chaudhuri

Accepted Solutions (0)

Answers (2)

Answers (2)

mangesh_sonawane
Participant
0 Kudos

Hi

Please check the below link

http://scn.sap.com/community/web-dynpro-abap/blog/2006/01/09/wda--user-defined-functions-in-alv

like this you can give functionality to your buttons

Regards ,

Mangesh Sonawane

mangesh_sonawane
Participant
0 Kudos

hi

see the link below,

http://saptechnical.com/Tutorials/WebDynproABAP/Totals/ALV.htm

CALL METHOD L_VALUE->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD

EXPORTING

FIELDNAME = 'PRICE'

RECEIVING

VALUE = l_colsum .

data : agg_sum type ref to CL_SALV_WD_AGGR_RULE.

CALL METHOD l_colsum->IF_SALV_WD_AGGR~CREATE_AGGR_RULE( ).

CALL METHOD l_colsum->IF_SALV_WD_AGGR~GET_AGGR_RULE

RECEIVING

VALUE = agg_sum.

CALL METHOD agg_sum->SET_AGGREGATION_TYPE

EXPORTING

VALUE = IF_SALV_WD_C_AGGREGATION=>AGGRTYPE_TOTAL .

Regards,

Mangesh Sonawane

Former Member
0 Kudos

Hi Mangesh,

Thanks for your input.

The above shows how to use the existing calculation functions provided by standard ALV settings. My question was, apart from these available functions, can we add any custom functions through some ALV settings configuration?

E.g. we have 4 types functions available - Total, Minimum, Maximum, Average. I want to have another function to calculate 'Median'. Can we achieve this other than enhancing the standard ALV logic?

Inputs will be appreciated.

- Rishin

I039810
Employee
Employee
0 Kudos

Hi Rishin,

It is possible to define new functions in the ALV - this is done by adding new buttons to the ALV toolbar and handling the functions as per your requirements.

This should be objects of type CL_SALV_WD_FUNCTION

Example:

  DATA: mr_functions type ref to IF_SALV_WD_FUNCTION_SETTINGS,

MR_FUNC_CALC type ref to CL_SALV_WD_FUNCTION,

MR_BUTTON_CALC type ref to CL_SALV_WD_FE_BUTTON.

  mr_functions ?=  mr_alv_model.
  CALL METHOD mr_functions->create_function
    EXPORTING
      id    = 'CALC'
    RECEIVING
      value = mr_func_calc.
  CREATE OBJECT mr_button_calc.

In the web dynpro view, you have to define a method for ALV event ON_FUNCTION.

I hope this helps.

Regards,

Shalini.