08-30-2006 10:11 PM
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.
08-30-2006 10:27 PM
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
08-30-2006 10:32 PM
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.
08-31-2006 12:25 AM
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
08-31-2006 12:33 AM
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