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: 

ALV List

Former Member
0 Kudos

Hi abap gurus,

I am using ALV List in my program, I want to display the sub totals and want to draw a line at a new material.. can anyone help me..

Thanks & Regards

Guhapriyan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

U can do as

LOOP AT output into anotherworkarea.

AT END OF new material.

SUM.

APPEND .....

sy-uline.

ENDAT.

ENDLOOP.

Try this one.

Thanks & Regards,

Judith.

7 REPLIES 7

Former Member
0 Kudos

You can achieve it using sort criteria.

If you are using methods, then you can create a strucutre of type LVC_T_SORT, assign field name on which you want subtotal to LVC_T_SORT-FIELDNAME and set LVC_T_SORT-SUBTOT = 'X' and pass it to method SET_TABLE_FOR_FIRST_DISPLAY.

otherwise if you are using function module REUSE_ALV_LIST_DISPLAY then in that function module there is an import parameter IT_SORT of type SLIS_T_SORTINFO_ALV.

asign field name on which you want subtotal to SLIS_T_SORTINFO_ALV-FIELDNAME and set SLIS_T_SORTINFO_ALV-SUBTOT = 'X' and pass it to function REUSE_ALV_LIST_DISPLAY.

Courtesy : SDN forums

Manohar

Former Member
0 Kudos

Hi,

U can do as

LOOP AT output into anotherworkarea.

AT END OF new material.

SUM.

APPEND .....

sy-uline.

ENDAT.

ENDLOOP.

Try this one.

Thanks & Regards,

Judith.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

This sample code illustrates the dynamic subtotal.

http://www.sapgenie.com/abap/code/chap2304.txt

0 Kudos

Judith and Jayanthi,

The solutions you are proposing wont work in ALV List. Mano Sri has already provided the soltuion.

Regards

Raja

0 Kudos

Hi,

U have rewarded wrongly i guess plz check it once.

Thanks & Regards,

Judith.

0 Kudos

I am really Confused now :)!!

Nada Nada Nada!!

0 Kudos

yeah am very sorry, i tried to reward.. after which any click i get an error message that the message is locked for rewarding.

i am not able to change that...

am sorry....