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: 

Create subtotal in Hierarchial ALV at item level

Former Member
0 Kudos

Hi ,

Is it possible to create Subtotal in hierarchial ALV

at item level . When I try to do that in my report ,

I get message

" Subtotals cannot be calculated using item characteristics ".

Also setting flag IT_SORT-subtot = 'X' , did not work .

Please advise .

Thanks ,

K T .

4 REPLIES 4

former_member181966
Active Contributor
0 Kudos

Checkout thread !!

Hope this’ll give you idea!!

<b>P.S award the points.!!! !!!</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

0 Kudos

Hi ,

I am using the hierarchial ALV not a simple ALV ,

Using

Call Function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' .

This is where subtotal function does not seem to work at item level .

Thanks ,

K T .

LucianoBentiveg
Active Contributor
0 Kudos

Yes, is posible, look sort table, you have problems in there. Example (This is working for me):

pt_sort-spos = 1.

pt_sort-fieldname = 'DESC_FLTYP'.

pt_sort-tabname = 'GT_HEAD'.

pt_sort-up = 'X'.

pt_sort-subtot = 'X'.

APPEND pt_sort.

Former Member
0 Kudos

Hi, your setting of IT_SORT-subtot = 'X' is necessary, however u also need something like this in the catalog definition for the ALV:

gt_itab_catalog-fieldname = 'TOTWR'.

gt_itab_catalog-tabname = 'ITAB1'.

gt_itab_catalog-seltext_l = 'Total'.

gt_itab_catalog-just = 'R'.

gt_itab_catalog-col_pos = 9.

gt_itab_catalog-outputlen = 15.

<b> gt_itab_catalog-do_sum = 'X'.</b>

APPEND gt_itab_catalog.

Hope it helps.

Regards,

Gilberto Li