12-01-2009 6:01 AM
How do I display a blank line in ALV header
For eg i want if i want the ALV header to display as follows
Document Datewise Report as of 31/10/2009
<-- BLANK LINE
Run On : 01/12/2009
12-01-2009 6:19 AM
You need to use
CALL METHOD cl_dd_document=>new_line.
Please check below link
http://wiki.sdn.sap.com/wiki/display/Snippets/header+inalv+oops
a®
12-01-2009 6:23 AM
Hi,
Are you using 'REUSE_ALV_COMMENTARY_WRITE' for displaying the header?
If yes, then I think it is not possible. Instead, use the events table to achieve it.
Use the 'REUSE_ALV_EVENTS_GET' FM to get all possible events and then modify
the events internal table to specify the form name to handle top-of-page event.
eg.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
* EXCEPTIONS
* LIST_TYPE_WRONG = 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.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
FORM TOP_OF_PAGE.
* Use write statements to display the header data.
ENDFORM.
In write statement use '/' to go to new line. So to insert an empty line you can use something like
write : 'some text' / / 'some text' .
Hope this helps.
Regards,
Bhavesh.
12-01-2009 7:21 AM
Hi,
I did as u instructed.
Earlier this is how i created the header text
W_HEAD = 'Document Datewise Report(HEADER)'.
LINE-TYP = 'A'.
LINE-INFO = W_HEAD.
APPEND LINE TO V_STANDARD_HEADER.
<<BLANK LINE to be displayed here before next line of header>>
V_EVENT-FORM = 'TOP-OF-PAGE'.
V_EVENT-NAME = 'TOP-OF-PAGE'.
APPEND V_EVENT TO V_GT_EVENTS.
<<Build field catalog>>
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = V_STANDARD_HEADER.
ENDFORM
Now i commented the above 6 lines & called REUSE_ALV_EVENTS_GET before callingREUSE_ALV_GRID_DISPLAY.
In the TOP_OF_PAGE i have written WRITE statements.
But the report now displays nothing in the header part
12-01-2009 8:20 AM
Hi,
Keep the 'I_CALLBACK_TOP_OF_PAGE' parameter blank. And pass the events table to 'IT_EVENTS' parameter of the
'REUSE_ALV_GRID_DISPLAY' FM.
Regards,
Bhavesh.
12-01-2009 6:29 AM
HI,
If you are using OO ALV you can use the CALL METHOD cl_dd_document-NEW_LINE.
If you are using normal ALV , Append an Initial line to the Internal Table that you are passing to the 'REUSE_ALV_COMMENTARY_WRITE' which you use to display the top of page of normal ALV.