07-31-2009 7:13 AM
Hi all,
add 1 to ls_sort-spos.
ls_sort-fieldname = 'kunrg'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
ls_sort-group = '*'.
append ls_sort to lt_sort.
CLEAR lt_SORT.
i write this type of code but i didn't get a sub total . and also didn't got a "KUNRG" field in group . here my table name is VBRK,
so please help me i face this problem from last 3 days. please help me out as soon as possible.
07-31-2009 7:34 AM
Hi Chauhan,
<li> You need to set DO_SUM ='X'. for the quantity field while building fieldcatalog for which total and subtotal should be calculated.
<li> Also you need to pass the below information through SORT table.
Let me know, if you need any further help.
Thanks
Venkat.O wa_sort-spos = 1. " Sort position
wa_sort-fieldname = 'BUKRS'.
wa_sort-tabname = 'IT_TAB'.
wa_sort-up = 'X'. "Ascending order
wa_sort-group = '*'. "Page break
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
07-31-2009 7:34 AM
Hi,
Please remember to use below statements.
While building the field catalog for the sub total fields, use
wa_fieldcat-do_sum = 'X'.
For SORT table,
lwa_sort-fieldname = c_matnr.
lwa_sort-tabname = c_t_final1.
lwa_sort-subtot = c_x.
lwa_sort-up = c_x.
lwa_sort-group = c_x.
APPEND lwa_sort TO lt_sort.
It will work.
Regards,
Santhosh.
07-31-2009 7:34 AM
Hi Chauhan,
<li> You need to set DO_SUM ='X'. for the quantity field while building fieldcatalog for which total and subtotal should be calculated.
<li> Also you need to pass the below information through SORT table.
Let me know, if you need any further help.
Thanks
Venkat.O wa_sort-spos = 1. " Sort position
wa_sort-fieldname = 'BUKRS'.
wa_sort-tabname = 'IT_TAB'.
wa_sort-up = 'X'. "Ascending order
wa_sort-group = '*'. "Page break
wa_sort-subtot = 'X'.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
07-31-2009 7:36 AM
07-31-2009 7:45 AM
Hi Keyur,
FOR TOTAL:
there is a property of fieldcatalog, that is do_sum.
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
FOR SUB TOTAL:
decleare: i_sort type standard table of slis_sortinfo_alv,
wa_sort type slis_t_sortinfo_alv.
wa_sort-spos = '1'.
wa_sort-fieldname = 'field1'.
wa_sort-tablename = 'i_final'
wa_sort-subtot = 'X'.
wa_sort-group = 'X'.
append wa_tab to i_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
it_sort = i_sort
Hope this can solve your pbs.
Regards,
Tutun