Hi Jepoy,
Please find the below steps to do the same
Steps:
- Create field, TEMP in the final structure.
- Assign the Field as tech field in field catalog
- Assign the purchase document to the field
- Consider the same field in IT_SORT too.
- Create the event for SUBTOTAL_TEXT as shown below.
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
3. Inside the subtotal_text method, write the code like this.
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
"Data Declarations
DATA: L_DOC TYPE CHAR50 VALUE 'PURCHASE DOCUMENT',
L_TEMP TYPE CHAR30.
"Get the Subtotal document number
L_TEMP = p_subtot_text-display_text_for_subtotal.
"Append Purchase document word
CONCATENATE L_DOC L_TEMP INTO L_DOC SEPARATED BY SPACE.
p_subtot_text-display_text_for_subtotal = L_DOC.
ENDFORM.
Also please find the below link..
Display subtotal text in ALV grid - Code Gallery - SCN Wiki
Regards
Rajkumar Narasimman