09-21-2010 11:16 AM
Hi everyone,
I have included 18 different reports into one reports.User can run any report by checking the check box of that report on selection screen.Outut of the report displays report no. alonfg with other fields as shown below:
Report no. Report description field 1 field 2........etc
1 abc
1 abc
1 abc
1 abc
2 def
2 def
2 def
No my requirement is to show total no. of each report as shown below :
Report no. Report description field 1 field 2........etc
1 abc
1 abc
1 abc
1 abc
Total: 4
2 def
2 def
2 def
Total: 3
i tried using subtotal but it doesnt work.....
waiting for your replies
09-21-2010 11:37 AM
tweak ur program,.
You mite be using an output table for 'REUSE_ALV_GRID_DISPLAY '.
Suppose having fields :
.Report number(25),
description(24),
For each report -at the final stage .(Might be after the loop is over)
Use describe itab statement to get the final report Count .
Append 'Total' - Count into Report number Field .
For next report as well.Same way get the count .
Appned each internal table to the final OUTPUT table for ALV.
so each time you will have a Seperate line for total with counts on the column 'Report number'.
09-21-2010 11:37 AM
tweak ur program,.
You mite be using an output table for 'REUSE_ALV_GRID_DISPLAY '.
Suppose having fields :
.Report number(25),
description(24),
For each report -at the final stage .(Might be after the loop is over)
Use describe itab statement to get the final report Count .
Append 'Total' - Count into Report number Field .
For next report as well.Same way get the count .
Appned each internal table to the final OUTPUT table for ALV.
so each time you will have a Seperate line for total with counts on the column 'Report number'.
09-21-2010 11:43 AM
Hi boby,
Thats really nice logic but it wont solve my problem.
Because user can sort the report no. field .
09-21-2010 11:48 AM
Ask user beforehand itself,in which format would they want the Report number field to be formatted- ascending/descending.
Make it done inside the program itself.and then go for Total logic.
Hope it solves your sorting issue.
Thanks!
09-21-2010 11:54 AM
first in fieldcatlog u can take do_sum = 'x'. this for grand total. depends on u r field
and then we have data declara type sortinfo_alv this slis type .
in that u can give sort-fieldname = for which field u can caliculate the subtotals
sort-subtot = 'x'.
sort-up = 'x' .
append sort into i_sort.
may be this one is helpful for u.
regards,
anji
09-22-2010 10:13 AM
wa_sort-fieldname = 'FIELD1'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
09-23-2010 10:17 AM