2006 Jul 12 6:10 AM
Hi all,
Apparently, I have an internal table with the following structure:
<u>itab_cust</u>
Customer No
Customer Name
Country
Sales Organization
Total_sold
However, if I want to generate a report, using the above table, to summarize total customer and total sales amount group by sales organization and country, how can I achieve the above? Please note that internal table itab_cust has bundled with all the data.
Appreciate your advise.
Best regards,
Patrick
2006 Jul 12 6:18 AM
Hi patrick,
1. We will have to follow the following steps.
2.<b> first collecting the summary sales org and country wise</b>
a) make new internal table say, sumtab
which has only the followng fields
sales org (keep same field name)
country (keep same field name)
cust_count <b>(for customer count)</b>
total_sold (keep same field name)
b) LOOP AT ITAB_CUST
MOVE-CORRESPONDING ITAB_CUST TO SUMTAB.
SUMTAB-CUST_COUNT = 1.
COLLECT SUMTAB.
ENDLOOP.
3. Then u can just print out this summary data.
4. Thats all !
regards,
amit m.
Hi all,
Apparently, I have an internal table with the following structure:
<u>itab_cust</u>
Customer No
Customer Name
Country
Sales Organization
Total_sold
However, if I want to generate a report, using the above table, to summarize total customer and total sales amount group by sales organization and country, how can I achieve the above? Please note that internal table itab_cust has bundled with all the data.
Appreciate your advise.
Best regards,
Patrick
2006 Jul 12 6:17 AM
You can simply develop a ALV Grid report using the user can go the totals / sub totals by themselves. They can do the subtotals by specific columns.
Regards,
Ravi
note : Please mark all the helpful answers
2006 Jul 12 6:18 AM
Hi patrick,
1. We will have to follow the following steps.
2.<b> first collecting the summary sales org and country wise</b>
a) make new internal table say, sumtab
which has only the followng fields
sales org (keep same field name)
country (keep same field name)
cust_count <b>(for customer count)</b>
total_sold (keep same field name)
b) LOOP AT ITAB_CUST
MOVE-CORRESPONDING ITAB_CUST TO SUMTAB.
SUMTAB-CUST_COUNT = 1.
COLLECT SUMTAB.
ENDLOOP.
3. Then u can just print out this summary data.
4. Thats all !
regards,
amit m.
2006 Jul 12 7:17 AM
hi Patrick,
that's the advantage of an alv-grid /list. that the user can design his own layouts with totals, subtotals , groups,...
you just need to fill that:
x_save = 'X'.
gs_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = c_tabname
IS_VARIANT = gs_variant
IS_layout = lay
I_SAVE = x_save
TABLES
T_OUTTAB = gridtab
EXCEPTIONS
OTHERS = 1.Andreas
Message was edited by: Andreas Mann
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |