2008 Nov 18 12:13 PM
Dear All,
I want Total on each block pertaining to REUSE_ALV_BLOCK_LIST_APPEND. Is there any way out?Your help is gravely solicited.
Best wishes,
Atanu
2008 Nov 18 12:29 PM
hai..
try IN this way i have given a example for field NETWR.
fill the fieldcat and sortinfo table.
example if the field is 'NETWR'.
WA_FCAT-COL_POS = '4'.
WA_FCAT-FIELDNAME = 'NETWR'.
WA_FCAT-SELTEXT_M = 'NET PRICE'.
WA_FCAT-DATATYPE = 'CURR'.
WA_FCAT-DO_SUM = 'X'.
APPEND WA_FCAT TO LT_FCAT3.
WA_SORT-FIELDNAME = 'EBELN'.
WA_SORT-GROUP = 'UL'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO LT_SORT.
pass the lt_sort and lt_fcat in fm : reuse_alv_block_list_append.
you will get the totals and subtotals also.
2008 Nov 18 12:29 PM
hai..
try IN this way i have given a example for field NETWR.
fill the fieldcat and sortinfo table.
example if the field is 'NETWR'.
WA_FCAT-COL_POS = '4'.
WA_FCAT-FIELDNAME = 'NETWR'.
WA_FCAT-SELTEXT_M = 'NET PRICE'.
WA_FCAT-DATATYPE = 'CURR'.
WA_FCAT-DO_SUM = 'X'.
APPEND WA_FCAT TO LT_FCAT3.
WA_SORT-FIELDNAME = 'EBELN'.
WA_SORT-GROUP = 'UL'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO LT_SORT.
pass the lt_sort and lt_fcat in fm : reuse_alv_block_list_append.
you will get the totals and subtotals also.
2008 Nov 19 7:32 AM
Hi Vishwa,
Your suggestion is not working. Can anyone please tell me whether it is at all possible to have total for REUSE_ALV_BLOCK_LIST_APPEND?
Best wishes,
Atanu
2008 Nov 19 7:39 AM
Hi,
If you are doing sum on currency or quantity field....add these two lines in your fieldcatalogue...
wa_fcat-do_sum = 'X'.
wa_fcat-ref_tabname = '<ref tab name>'. " add it
wa_fcat-ref_fieldname = '<ref field name>'." add it
What Vishwa gave is ok...just add these two lines and see..
Regards
Debarshi
2008 Nov 19 7:43 AM
2008 Nov 19 7:56 AM
2008 Nov 19 8:10 AM
Only one issue is coming. The headng for the columns for which sum has been done has got changed. It is taking text of ref tablename and ref fieldname.
Best wishes,
Atanu
2008 Nov 19 8:15 AM
may be ur doing mistake at filed catalog setting.. proceede like this for every field..
WA_SORT-FIELDNAME = 'EBELN'.
WA_SORT-GROUP = 'UL'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO LT_SORT
Thanks,
sriii..
2008 Nov 19 8:16 AM
I have resolved it. Thanks a lot for all your helps.
Best wishes,
Atanu
2008 Nov 19 8:23 AM
Hi,
Ok.
Now you can rectify this by creating a table .
Now for the fields in the table will be those fields on which you are doing sum in your alv block append.
Say there is only one field...so create a table with one field..now for this field create a data element of the same type of the field you are using.
Now give this field a definition as of your wish and use this table as your ref_tabname and its field as
your ref_fieldname ...
Try it.
Regards
Debarshi
2008 Nov 19 8:19 AM
Atanu,
Use FIELDCAT-REPTEXT_DDIC = text-001 where text-001 defines the text of the field.