04-26-2006 9:26 AM
hi,
i have an ALV REPORT,displaying the fields such as po item(ekpo-menge).but i am unable to perform total and sub total,it gives me a information message 'total cannot b performed'.
can any one help me, how to total and subtotal.
04-26-2006 9:34 AM
Hi Cyrilvictor,
You could try using these options.
Fieldname - NO_TOTLINE
If this field is set, only subtotals, but no totals, are displayed.
Value range - SPACE, 'X'
Fieldname - NUMC_TOTAL
If this field is set, the user can calculate totals for fields of datatype NUMC (normally, users are not allowed to do this).
Value range - SPACE, 'X'
Fieldname - TOTALS_BEF
If this field is set, the ALV displays totals calculated as the first rows in the grid control. Subtotals are displayed before a new value of the subtotals criterion.
Value range - SPACE, 'X'
Regards,
Aniket
Please mark useful posts.
04-26-2006 9:41 AM
HI,
while mentioning the fieldcatalog for menge specify do_sum .then it will not give the info message.
X_FIELDCAT-SCRTEXT_M = 'quantity'.
X_FIELDCAT-FIELDNAME = 'MENGE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
<b> X_FIELDCAT-DO_SUM = 'X'.</b>
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
REGARDS
vijay
04-26-2006 9:42 AM
04-26-2006 9:43 AM
while creting field catalog for the field give th eoptin X_FIELDCAT-DO_SUM = 'X'.
this may help u.
rams
04-26-2006 9:50 AM
Hi,
If the field DO_SUM is set, the ALV uses this field to calculate the total (this corresponds to the generic totals function in the toolbar).
Data: FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
FIELDCAT_LN-FIELDNAME = 'FIELD3'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
For subtotal,
TYPE-POOLS: SLIS.
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1. Sort first on column FIELD1.
GS_SORT-UP = 'X'. Ascending order.
GS_SORT-SUBTOT = 'X'. Display sub-total at change of
FIELD1.
APPEND GS_SORT TO GT_SORT.
Regards,
Sumana
04-26-2006 10:07 AM
Hi,
Please go through the following links. I am sure it will help you.
<a href="http://www.sapfans.com/forums/viewtopic.php?t=20386">http://www.sapfans.com/forums/viewtopic.php?t=20386</a>
<a href="http://www.sapfans.com/forums/viewtopic.php?t=85191">http://www.sapfans.com/forums/viewtopic.php?t=85191</a>
<a href="http://www.sapfans.com/forums/viewtopic.php?t=88401">http://www.sapfans.com/forums/viewtopic.php?t=88401</a>
Please reward helpful answer.
Regards,
Amit Mishra