01-13-2015 10:16 AM
How to group the similar fields in ALV report as the below what must be the code.
Here clearing doc are same so 4 itsm are grouped under into one.
After that I want to calculate the sum of pls refer the below screen shot.
First Colum is groped into one and amount in summed and show in the output how to do that.
01-13-2015 10:37 AM
Set SUM = 'X' in fieldcat for field "AMOUNT" and set "SORT" for Column "Clearing doc"
01-13-2015 12:05 PM
01-13-2015 12:22 PM
Hi,
DATA :
it_sort TYPE slis_t_sortinfo_alv,
t_sort TYPE slis_sortinfo_alv.
t_sort-fieldname = 'AUGBL'.
t_sort-spos = 1.
t_sort-up = 'X'.
APPEND t_sort TO it_sort.
CLEAR t_sort.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = it_sort[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
endif.
endform. " DISPLAY_ALV_REPORT
Regards,
Venkat.
01-13-2015 2:05 PM
can you please explain this in more detail ?
what about data in internal; table it_ekko
what about the table name ?
01-13-2015 5:38 PM
Hi,
Hope you are appending all values to the final internal table, passing internal table to alv grid function
module.
add the following sort syntax for the clearing document.
in field catalog for the amount field.
wa_fcat-do_sum = 'X'. " it will display total at last.
but using sort syntax for the field augbl sub total for the field is displayed.
Hope it helpful.
Regards,
Venkat.
01-14-2015 6:29 AM
wa_fcat-do_sum = 'X'. displays the whole row total but i have different requirement
01-15-2015 2:08 PM
First, execute The Consistency Check, and correct any inconsistency raised.
There, also display layout and look for field NO_MERGING, musy be initial
Then display your grid and thru menu remove every sort criteria and sort only on the field you want to group. What result do you get?
When (and if) okay, reexecute the consistency check and analyze the SORT internal table, so you should be able to code it.
NB: If Grid is input allowed, I fear you can no longer group fields.
Regards,
Raymond
01-15-2015 3:51 PM
Rejected already, and now reposted three times. So now locked.
Post questions once in one place. If your post is rejected, don't post again.