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: 

Modify Subtotals ALV

Former Member
0 Kudos

hi all,

I want to modify subtotals in alv OO, somebody knows how can i do that?

regards.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

While modifying field catalog , try the following.


Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.

LOOP AT i_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'LOSGR'.
<lfs_fieldcat>-coltext = text-007.
<lfs_fieldcat>-do_sum = c_x.
ENDCASE.

ENDLOOP.

Or if you want to use field symbols.

data: total type ref to data,
subtotal1 type ref to data.

field-symbols <total> like gt_sflight.
field-symbols <subtotal1> like gt_sflight.

call method grid1->get_subtotals
importing
ep_collect00 = total
ep_collect01 = subtotal1.
assign total->* to <total>.
assign subtotal1->* to <subtotal1>.

Hope this helps.

Thanks

Arun kayal

3 REPLIES 3

Former Member
0 Kudos

HI ,

which type of alv function module u are using...

let me know clearly...

Thanks & Best Regards,

Praveen.

0 Kudos

>

> which type of alv function module u are using...

> Praveen.

If you Read the question carefully, This is regarding the OOALV. so no Function modules involved.

Former Member
0 Kudos

Hi,

While modifying field catalog , try the following.


Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.

LOOP AT i_fieldcat ASSIGNING <lfs_fieldcat>.
CASE <lfs_fieldcat>-fieldname.
WHEN 'LOSGR'.
<lfs_fieldcat>-coltext = text-007.
<lfs_fieldcat>-do_sum = c_x.
ENDCASE.

ENDLOOP.

Or if you want to use field symbols.

data: total type ref to data,
subtotal1 type ref to data.

field-symbols <total> like gt_sflight.
field-symbols <subtotal1> like gt_sflight.

call method grid1->get_subtotals
importing
ep_collect00 = total
ep_collect01 = subtotal1.
assign total->* to <total>.
assign subtotal1->* to <subtotal1>.

Hope this helps.

Thanks

Arun kayal