Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8653

Re: ALV Grid with header inside the report

$
0
0

Hi Jepoy,

Please find the below steps to do the same

 

Steps:

  1. Create field, TEMP in the final structure.
    1. Assign the Field as tech field in field catalog
    2. Assign the purchase document to the field
    3. Consider the same field in IT_SORT too.
  2. 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


Viewing all articles
Browse latest Browse all 8653

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>