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: 

Subtotal In ALV

Former Member
0 Kudos
77

Hi Experts,

I am creating an ALV output, inwhich I want to have the subtotal for particular field.

In the sorting internal table I did like

l_sort-subtot = 'X'.

Then in field cat I did like

l_fcat-do_sum = 'X'.

But still it is not displaying the result. How can I insert a line in ALV which will show the sub total.

Thanks and regards,

Venkat

5 REPLIES 5

Former Member
0 Kudos
62

This message was moderated.

Former Member
0 Kudos
62

Hi,

The requirement here : subtotal of 'Total Hours Work' should be displayed Weekly wise.

g_fieldcat-tabname   = 'I_INA2011'.
  g_fieldcat-fieldname = 'HRTOT'.        " It should be Integer type field i.e. other thabn char/date/time field
  g_fieldcat-coltext   = 'Total Hours Work'(006).
  g_fieldcat-do_sum    = 'X'.
  APPEND g_fieldcat TO i_fieldcat.
  CLEAR  g_fieldcat.

  i_vsort_line-spos = 3.
  i_vsort_line-fieldname = 'WEEK'.           " Sort the table on Week
  i_vsort_line-subtot = 'X'.
  APPEND i_vsort_line TO i_vsort. CLEAR i_vsort_line.

Former Member
0 Kudos
62

Hi,

Have u passed this sort table'l_sort' to the FM 'REUSE_ALV_GRID_DISPLAY'? It seems thats missing.

Regards,

Mansi.

Former Member
0 Kudos
62
gs_sort-spos = 1.
  gs_sort-fieldname = 'EBELN'.
  gs_sort-up = 'X'.
  gs_sort-subtot = 'X'.

  APPEND gs_sort TO gt_sort.

I355602
Product and Topic Expert
Product and Topic Expert
0 Kudos
62