05-09-2007 1:56 PM
i need to have subtotal based on location. how can i do subtotal in ALV list.
05-09-2007 2:24 PM
Hi Nidhi
This can be done as follows. While populating the field catalog, use the following statement:
data: wa_fieldcat_1 TYPE slis_fieldcat_alv.
wa_fieldcat_1-subtot = 'X'. (for the corresponding field for which subtotal is req)
This should solve the problem.
PLZ REWARD POINTS IF HELPFUL
05-09-2007 1:59 PM
Hi Nidhi,
Yes, u can do subtotals in alv.
Just add <b>SUBTOTAL</b> in the fieldcatalog of the particular field.
I_FIELDCAT-DO_SUM = 'X'.
Reward if helpful.
Thanks,
pritha
Message was edited by:
Pritha Agrawal
05-09-2007 1:59 PM
Hello,
Data: I_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV.
*---Sort
WA_SORT-SPOS = '1'.
WA_SORT-FIELDNAME = 'LINE'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO I_SORT.
CLEAR WA_SORT.
Pass this in FM,
IT_SORT = I_SORT
Regards,
Vasanth
05-09-2007 2:00 PM
Hi Nidhi,
Use FM <b>REUSE_ALV_EVENTS_GET</b> to get all events in ur ALV report.then use event <b>SUBTOTAL_TEXT</b> to print subtotal.
following are the events that u can use in ALV :
CALLER_EXIT
USER_COMMAND
TOP_OF_PAGE
TOP_OF_COVERPAGE
END_OF_COVERPAGE
FOREIGN_TOP_OF_PAGE
FOREIGN_END_OF_PAGE
PF_STATUS_SET
LIST_MODIFY
TOP_OF_LIST
END_OF_PAGE
END_OF_LIST
AFTER_LINE_OUTPUT
BEFORE_LINE_OUTPUT
REPREP_SEL_MODIFY
<b>SUBTOTAL_TEXT</b>
GROUPLEVEL_CHANGE
Reward points if helpful.
Regards,
Hemant
05-09-2007 2:24 PM
Hi Nidhi
This can be done as follows. While populating the field catalog, use the following statement:
data: wa_fieldcat_1 TYPE slis_fieldcat_alv.
wa_fieldcat_1-subtot = 'X'. (for the corresponding field for which subtotal is req)
This should solve the problem.
PLZ REWARD POINTS IF HELPFUL