Skip to Content
0
Former Member
May 12, 2009 at 03:49 PM

Add text to alv report

23 Views

Hi expert,

In alv report totals are displayed as "TOTAL", And i need to display grand total as "GRAND TOTAL" as a text, but it over wright the text as "TOTAL" as "GRAND TOTAL".

I will return the code below.

FORM subtotal_text CHANGING p_total TYPE any

p_subtot_text TYPE slis_subtot_text.

DATA: text TYPE string.

data: v_len type i,

V_LINE TYPE I.

v_len = lines( it_output ).

IF p_subtot_text-criteria = 'LIFNR'.

LOOP AT it_output INTO wa_output.

  • ON CHANGE OF wa_output-lifnr.

CONCATENATE wa_output-name 'TOTAL' INTO text SEPARATED BY SPACE.

p_subtot_text-display_text_for_subtotal = text.

CLEAR text.

  • ENDON.

ENDLOOP.

ENDIF.

  • if sy-index = v_len.

  • p_subtot_text-display_text_for_subtotal = 'GRAND TOTAL'.

  • endif.

  • ENDLOOP.

Thank you,

Dinesh.B