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: 

Total in REUSE_ALV_BLOCK_LIST_APPEND

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

10 REPLIES 10

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

Hi

Check This Link

0 Kudos

Excellent Debarshi. It has worked. Great.

0 Kudos

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

0 Kudos

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..

0 Kudos

I have resolved it. Thanks a lot for all your helps.

Best wishes,

Atanu

0 Kudos

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

Former Member
0 Kudos

Atanu,

Use FIELDCAT-REPTEXT_DDIC = text-001 where text-001 defines the text of the field.