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: 

ALV display

Former Member
0 Kudos

Hi,

I need some details regarding the standard program BALVST03_GRID below it is showing the Currency wise subtotal. I tried to get the logic how it is working.

Can anybody explain me.

Thanks,

Pavan.

4 REPLIES 4

Former Member
0 Kudos

Hi Pavan,

While building the layout at

PERFORM E05_LAYOUT_BUILD USING GS_LAYOUT.

if we pass,

E05_LS_LAYOUT-no_totalline = 'X'.

then the subtotal will not be displayed by default.

Since no_totalline was set to initial, it is displaying the subtotal.

Hope this will help you.

Regards,

Vivek

PS: Award points if helpful

Former Member
0 Kudos

The DO_SUM is enabled for the fields. This is how it is calculating subtotals.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'SEATSOCC'.

LS_FIELDCAT-DO_SUM = 'X'.

APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.

*

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'PRICE'.

LS_FIELDCAT-DO_SUM = 'X'.

APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.

Former Member
0 Kudos

i didn't see the example prog..but i will try to explain how total and subtotals works in alv

there are two ways to get total for fields(columns)

1. fieldcatlog

set the do_sum to X to get total for that particular field.

2. layout:

if you want total for numc type fields just pass X to numc_sum in your layout.

3. if you want subtotal for a particular field then you have to pass sort table to your fm reuse....display.

in that table you have mention field and sub_tot = X and sorting order

then it will give subtotal for that field

Former Member
0 Kudos

in your example

you can see passing sorting table GT_SORT to reuse_....grid function module...

just copy that program to one z program and commet and gt_sort parameter and then check...

please award points if it is helpful to you