Thanks everyone whoever helped me with the idea of displaying Header and footer in ALV grid using CL_DD_DOCUMENT
FORM HTML_TOP_OF_PAGE USING DOCUMENT TYPE REF TO CL_DD_DOCUMENT. DATA: TEXT TYPE SDYDO_TEXT_ELEMENT. CALL METHOD DOCUMENT->ADD_GAP EXPORTING WIDTH = 100. TEXT = 'ALV HEADER'. CALL METHOD DOCUMENT->ADD_TEXT EXPORTING TEXT = TEXT SAP_STYLE = 'HEADING'. ENDFORM. "HTML_TOP_OF_PAGE
I now have both Header and footer for the ALV perfectly.
But I am not able to print them. When i check Print Preview then it shows the normal report without header/footer.
Why is that? How to acheive it?