Skip to Content
avatar image
Former Member

Webdynpro ALV settings Calculation options

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Dec 20, 2012 at 05:09 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Dec 21, 2012 at 06:56 AM

    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

    Add comment
    10|10000 characters needed characters exceeded