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

ALV Subtotal

Former Member
0 Likes
1,034

Hi All,

I am using Dynamic Internal Table with help of objects. I want to display subtotal.

I have made all the necessary changes but still I am not getting Subtotal.

Thanks,

Vipin.

Message was edited by:

Vipin

Hi All,

I am using Dynamic Internal Table with help of objects. I want to display subtotal.

I have made all the necessary changes but still I am not getting Subtotal.

Thanks,

Vipin.

Message was edited by:

Vipin

9 REPLIES 9
Read only

Former Member
0 Likes
1,006

Hi Vipin,

The do_sum = 'X' will activate the subtotal button on the toolbar. When you get your output, then you have to click the subtotal button to get the sub total.

Hope it clears the doubt.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
1,006

Hi Atish Sarda,

I am not getting Totals & SubTotals button on Toolbar

Regards,

Vipin.

Message was edited by:

Vipin

Read only

0 Likes
1,006

Hi Vipin

Change below code

clear wa_it_fldcat.

concatenate itab_g2-month '-' 'QUANT' into

wa_it_fldcat-fieldname.

wa_it_fldcat-datatype = 'NUM'.

concatenate itab_g2-month '-' 'QUANTITY' into

wa_it_fldcat-seltext.

<b>wa_it_fldcat-do_sum = 'X'</b>.

wa_it_fldcat-intlen = 15.

append wa_it_fldcat to it_fldcat .

Reward points if useful.

Regards,

Atish

Read only

0 Likes
1,006

wa_it_fldcat-fieldname = 'MATKL'.

wa_it_fldcat-datatype = 'CHAR'.

wa_it_fldcat-seltext = 'DIVISION'.

wa_it_fldcat-do_sum = ''.

wa_it_fldcat-intlen = 18.

append wa_it_fldcat to it_fldcat .

here you make wa_it_fldcat-do_sum = 'x'.

you get totals.

Read only

0 Likes
1,006

Vipin

If you want subtotal

You should declare like this and pass this sort to the FM.

DATA : LT_SORT TYPE slis_sortinfo_alv.

LT_SORT-fieldname = 'EBELN'.

LT_SORT-tabname = 'IT_STD_EKKO'.

LT_SORT-up = 'X'.

LT_SORT-subtot = 'X'.

APPEND LT_SORT TO P_SORT.

Make sure you should keep DO_SUM = 'X' for Totals

Thanks

Read only

0 Likes
1,006

Hi All,

I have done all the changes. But still Sub Total is not comming. Please solve this. It is urgent.

Thanks,

Vipin.

Read only

0 Likes
1,006

Hi Vipin ,

to get subtotal , first thing u have to see the data types , u have to pass correct data types then only u will get the subtotals.

<b>wa_it_fldcat-datatype = 'QUAN'.

wa_it_fldcat-do_sum = 'X'.</b>

Regards

Peram

Read only

0 Likes
1,006

Hi

Make all DO_SUM = 'X'.

Exam i have done this and working fine for me

DATA: I_SORT TYPE SLIS_T_SORTINFO_ALV,

X_SORT LIKE LINE OF I_SORT.

X_SORT-SPOS = <COLNUMBER>

X_SORT-FIELDNAME = 'PERSG'.

X_SORT-UP = 'X'.

X_SORT-SUBTOT = 'X'.

APPEND X_SORT TO I_SORT.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

Thanks

Read only

Former Member
0 Likes
1,006

Hi,

Do_sum (sum over column): the user can also call this function interactively. Value set: SPACE, 'X'.

'X' = a sum is calculated over this internal output table field.

define the property in field catalog.

Regards

suresh.D