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
699

Hi all,

Iam doing the subtotal based on id on alv output

Iam doing subtotal programtically

wa_sort-spos = 1.

wa_sort-fieldname = 'ID'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

wa_sort-comp = 'X'.

append wa_sort to it_sortcat.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = v_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

it_fieldcat = fieldcatalog[]

it_sort = it_sortcat[]----


i_save = 'X'

it_events = it_events

say i see like

id amount

1 1

1 2

1 3

1 4

10 --subtotal

2 1

2 4

2 6

11 -


subtotal

21 -


total. i don't need this .Right now iam seeing this

can any one tell how to achieve this

Thanks

1 ACCEPTED SOLUTION

Hi all,

Iam doing the subtotal based on id on alv output

Iam doing subtotal programtically

wa_sort-spos = 1.

wa_sort-fieldname = 'ID'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

wa_sort-comp = 'X'.

append wa_sort to it_sortcat.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = v_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

it_fieldcat = fieldcatalog[]

it_sort = it_sortcat[]----


i_save = 'X'

it_events = it_events

say i see like

id amount

1 1

1 2

1 3

1 4

10 --subtotal

2 1

2 4

2 6

11 -


subtotal

21 -


total. i don't need this .Right now iam seeing this

can any one tell how to achieve this

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
662

Hi,

Look at the sample program

http://www.sap-basis-abap.com/abap/alv-grid-list-with-sub-totals.htm

Regards

Sudheer

Read only

Former Member
0 Likes
662

hi,

while declaring fieldcatalog we have to give.

d_fieldcat_wa-fieldname = 'SALARY'.

d_fieldcat_wa-seltext_l = 'Salary'.

d_fieldcat_wa-do_sum = 'X'.

d_fieldcat_wa-col_pos = 1.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

Reward with points if helpful.

Read only

Former Member
0 Likes
662

Hi,

In your layout added the code as below :

gs_layout-no_totalline = 'X'.

By using this code you avoid displaying the total line.

Thanks,

Sri.