Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to sum column in ALV

Former Member
0 Kudos
4,228

I am using REUSE_ALV_GRID_DISPLAY to produce an ALV report. I want to display the sum row for some of the columns but am unable to do so for some. Some work others dont.

They are all of type MBEW-SALK3 CURR 13. When I click on the Total button for some of the columns, the message pops up 'Desired operation cannot be performed for column'. Any idea why this must be happening. do_sum is set to 'X' and no_sum set to space.

5 REPLIES 5

Former Member
0 Kudos
721

Hi

Create a varaible with decimal data type simliar to your currency fields which is getting displyed in the output of the ALV report and pass do_sum = 'X'.

Regards

Srilaxmi

Former Member
0 Kudos
721

Hi Sajid,

I guess in your field catalog definition for the field you might have made some mistake,

change

ls_fieldcat-datatype = 'CURR'

to

ls_fieldcat-inttype = 'CURR'

Also use the below attributes in the fieldcatalog

ls_fieldcat-ref_field = <--- give the ref field name 
ls_fieldcat-ref_table = <------- giv eth e ref table name.

Regards

Abhii

Former Member
0 Kudos
721

hi sajid,

In fieldcatalog of ALV you have to pass

*wa_fieldcat is define as workarea of fieldcatlog

WA_FIELDCAT-REF_FIELD = ' '.

WA_FIELDCA-REF_TABLE = ' '.

OR

you can also use in fieldcatalog of alv to display sum

WA_FIELDCAT-INTTYPE = 'C'.

Regards

Gaurav

Former Member
0 Kudos
721

hi sajid,

In fieldcatalog of ALV you have to pass

*wa_fieldcat is define as workarea of fieldcatlog

WA_FIELDCAT-REF_FIELD = ' '.

WA_FIELDCA-REF_TABLE = ' '.

OR

you can also use in fieldcatalog of alv to display sum

WA_FIELDCAT-INTTYPE = 'C'.

Regards

Gaurav

Former Member
0 Kudos
721

u can pass do_sum = 'X'

example:


CLEAR w_alv.
  w_alv-fieldname = 'MNGLG'.
  w_alv-tabname   = 'ITAB''.
  w_alv-seltext_m = 'Manuf. Qty'.
  w_alv-seltext_l = 'Manuf. Qty'.
  w_alv-outputlen = 10.
  w_alv-do_sum = 'X'.
  APPEND w_alv TO t_alv.
  CLEAR w_alv.