‎2011 Feb 14 7:45 PM
Hello experts,
I am using a ALV GRID with function ... and i have a problem with subtotals, how can i a take 2 columns as one in the subtotal
i mean i have 4 columns .... CODE1 DESC1 and CODE2 DESC2 and the amount columns AMOUN1 AMOUNT2
if i subtotalize by colums i am going to have 4 leveles plus the gran total.
HOw can i make te CODE1 and DESC1 act as just one colums ... that theyll be at the same level. So ill just have 2 leves plus the gran total.
Thx in advance .
‎2011 Feb 14 8:19 PM
Hello!
Im not sure if it's what you need, but this FIELDCAT-SP_GROUP defines a group in your fieldcat, and the columns added to this group act as one. I never tried using this, let us know if it works and fixes your problem.
See ya.
Thales Schmidt
‎2011 Feb 15 6:51 AM
in Fieldcar Cat loge
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
Use this condition where u Defin. tax for Column Name
*Total
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-key = ''.
*wa_fieldcat-do_sum = 'X'.
wa_fieldcat-emphasize = 'C300'.
wa_fieldcat-outputlen = 20.
wa_fieldcat-seltext_l = 'Current Total '.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
at end of Field Use
gs_sort-fieldname = 'TXT50'.
gs_sort-spos = 2.
gs_sort-up = 'X'.
‎2011 Feb 15 6:52 AM
in Fieldcar Cat loge
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
Use this condition where u Defin. tax for Column Name
*Total
wa_fieldcat-fieldname = 'TOTAL'.
wa_fieldcat-key = ''.
*wa_fieldcat-do_sum = 'X'.
wa_fieldcat-emphasize = 'C300'.
wa_fieldcat-outputlen = 20.
wa_fieldcat-seltext_l = 'Current Total '.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR wa_fieldcat.
at end of Field Use
gs_sort-fieldname = 'TOTAL'.
gs_sort-spos = 2.
gs_sort-up = 'X'.
Edited by: Shailesh Dhanani on Feb 15, 2011 7:52 AM
‎2011 Feb 15 6:57 AM
Hello
http://wiki.sdn.sap.com/wiki/display/Snippets/DisplaysubtotaltextinALV+grid
this z usefull for u pls try it.
‎2011 Feb 15 7:14 AM
In the sort parameter (type LVC_T_SORT in OO or SLIS_T_SORTINFO_ALV in old REUSE library)
- Define all key fields as sort criteria CODE1, DESC1 -> UP = 'X'
- Only define only one field as sub-total level, e.g. text DESC1 -> SUBTOT = 'X'
Ref: [Fields of the Sort Table|http://help.sap.com/saphelp_erp2004/helpdata/en/9e/2c7b38180fee45e10000009b38f8cf/frameset.htm]
Regards,
Raymond
‎2011 Feb 15 12:24 PM
Hi,
R u sure, you will need six (6) cloumns. Will three (3) columns will not suffice.
In the field catlogue just mark the field do_sum = 'X' for the Amount column.
Rest cloumns do the sorting.
Hope this will help.
Regards,
Dadarao.