Application Development and Automation 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: 
Read only

total in ALV Grid Display using oops

Former Member
0 Likes
1,186

Hi ,

I have a requirement where in i have to calculate the total of the column selected.

earlier i that button was greyed out.Now after i had enabled that button and In the fieldcatalog

i have made the field do_sum as 'X'.but still i am getting an message'Desired operation cannot be performed for column'.

the button type is 1.

Please share your inputs on the same.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
990

For getting total you need to fill up the IT_SORT table parameter in call method go_grid->set_table_for_first_display

Hi ,

I have a requirement where in i have to calculate the total of the column selected.

earlier i that button was greyed out.Now after i had enabled that button and In the fieldcatalog

i have made the field do_sum as 'X'.but still i am getting an message'Desired operation cannot be performed for column'.

the button type is 1.

Please share your inputs on the same.

Thanks in Advance.

6 REPLIES 6
Read only

former_member194669
Active Contributor
0 Likes
991

For getting total you need to fill up the IT_SORT table parameter in call method go_grid->set_table_for_first_display

Read only

0 Likes
990

Hi,

IT_SORT is required for SUBTOTAL.

Regards

Abhii

Read only

Former Member
0 Likes
990

Hi Ramanan,

When you have used DO_SUM , the total will be automatically displayed at the bottom of the column & I am not getting why you need to calculate total after clicking on the button.

If you want this to be done that way you to register events for the clicked button & all other processing.

Regards

Abhii

Read only

Former Member
0 Likes
990

Hi raman

do as suggested below:

for example, if the filed is net total then

wa_fieldcat-row_pos = 0.

wa_fieldcat-col_pos = 1.

wa_fieldcat-fieldname = 'NET_BAL'.

wa_fieldcat-do_sum = 'X'.

wa_fieldcat-seltext_s = 'Net Total'.

wa_fieldcat-seltext_m = 'Net Total'.

wa_fieldcat-seltext_l = 'Net Total'.

APPEND wa_fieldcat TO t_fieldcat.

CLEAR wa_fieldcat.

regards,

munvar

Read only

Former Member
0 Likes
990

Thanks for your replies.

In the fieldcatalog all my fields are char type.

so it not possible to calculate total.

Read only

Former Member
0 Likes
990

Thanks for ur replies:)