Skip to Content
0
Former Member
Aug 13, 2008 at 07:47 AM

Subtotal text print in alv grid report

75 Views

HI all,

I am trying to print the text for the column e.g. "SUBTOTAL TEXT" when i click on event button on the tool bar.

total is getting generated but text is not printing i am giving the code what i had written please tel me what changes should be done in this code .

***********Code

FORM sub_get_event .

CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE 'SUBTOTAL_TEXT'.

DATA: l_s_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 4

IMPORTING

ET_EVENTS = i_event

EXCEPTIONS

LIST_TYPE_WRONG = 0

OTHERS = 0.

  • Subtotal

READ TABLE i_event INTO l_s_event

WITH KEY name = slis_ev_subtotal_text.

IF sy-subrc = 0.

MOVE c_formname_subtotal_text TO l_s_event-form.

MODIFY i_event FROM l_s_event INDEX sy-tabix.

ENDIF.

ENDFORM. " sub_get_event

&----


*& Form subtotal_text

&----


  • Build subtotal text

----


  • P_total Total

  • p_subtot_text Subtotal text info

----


FORM subtotal_text CHANGING

p_total TYPE any

p_subtot_text TYPE slis_subtot_text.

  • Material level sub total

IF p_subtot_text-criteria = 'KWMENG'.

p_subtot_text-display_text_for_subtotal = 'Total '(009).

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = it_repid

I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE' "#EC *

IS_LAYOUT = it_lay

IT_FIELDCAT = it_fldct[]

IT_EVENTS = i_event

TABLES

t_outtab = it_outtb

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "Alv_Display

Thank you,

Supriya.