Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to add extra rows to alv output

former_member200679
Participant
0 Kudos

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.

5 REPLIES 5

rajkumarnarasimman
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

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: ".

Juwin
Active Contributor
0 Kudos

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