04-29-2015 9:15 AM
Hi all,
i made a alv report whose output looks like this:
and i want to add two rows more at the end of the report.
The expected output looks like :
I want to add total text in front of count summation and another row beneath it for total no of services.
I tried following this link " SAPTechnical.COM - Display subtotal text in ALV grid" , but i am not able to achieve the desired output.
Could someone please help me in finding out the proper solution for this issue. Its urgent.
Thanks,
Saurabh.
04-29-2015 10:04 AM
Hi Saruabh,
The requirement is clear, kindly do let us know what is the output you are receiving or share the code.
Regards
Rajkumar Narasimman
04-29-2015 11:09 AM
This is the code for fieldcatalog:
"
FORM fieldcatalog.
wa_fieldcat-fieldname = 'SR_NO'.
wa_fieldcat-col_pos = 1.
wa_fieldcat-key = 'X'.
wa_fieldcat-key_sel = 'X'.
wa_fieldcat-seltext_l = 'Sr_No'.
APPEND wa_fieldcat TO it_fieldcat .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'PROC_NAME'.
wa_fieldcat-col_pos = 2.
wa_fieldcat-key = 'X'.
wa_fieldcat-key_sel = 'X'.
wa_fieldcat-seltext_l = 'Procdure Name'.
APPEND wa_fieldcat TO it_fieldcat .
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'SCOUNT'.
wa_fieldcat-col_pos = 3.
wa_fieldcat-key = 'X'.
wa_fieldcat-key_sel = 'X'.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-seltext_l = 'Total'.
APPEND wa_fieldcat TO it_fieldcat .
CLEAR wa_fieldcat.
ENDFORM. "
My current output:
I want to add total text in the yellow row and another text total no of service below it.
04-30-2015 8:13 AM
Dear Saurabh,
why u can't go for FM. 'REUSE_ALV_COMMENTARY_WRITE it mainly used to display the no. of records in output at the Header LEVEL.
Thanks
Nishant
04-30-2015 8:39 AM
Hi Nishant,
thanks for the reply, but will it work to get the "total" text in the yellow row.
It should look like "Total : 15" in the last row. 15 is the summation of 'total' column and i would also like to add another line below the total text saying "total no of services: ".
05-01-2015 3:37 PM
I don't think you can do this in an ALV grid display. But if you are ok with ALV list display, try using BEFORE_LINE_OUTPUT event. This is not a recommended approach due to performance reasons.
Thanks
Juwin