Creating Header and Footer in ALV
hi,
can anyone please tell how will you create Header and Footer in ALv and Classical Report.
Hi,
In classical report use events 'top-of-page' for header and 'end-of-page' for footer.
in ALV
follow this link
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/header-footer-display-in-alv-grid-for-layout-description-344391
Regards and Best wishes.
Similar Messages
-
Header and Footer in ALV.. URGENT
Hi All,
I want to print Header and Footer in ALV list/grid. Like in header, i want page no.( 1 of 10), UserName, Report Name etc.. and in Footer, I need selection screen criteria. For this I am using a function module (FM_SECECTOIN_CRITERIA_PRINT).
Where exactly should i code this part in my program.
Regards,
Parvez.Check this link -
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
http://www.sap-img.com/fu037.htm
http://www.sap-img.com/abap-function.htm
Regards,
Amit -
Header and Footer for ALV Layout
Hi All,
I have used the following code to create the Header and Footer Areas for ALV Report.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'build_comment'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
Now the space is available for both Header and Footer...
But i would like to display the Text in Header and Footer areas...
How to insert the Texts....????
Can you help me please.....???
Regards
PavanHi,
Try with following example program:
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT AZEMPNO AZEMPNAME AZDEPTCD BZDEPTNAME AZDESGCD CZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON AZDEPTCD EQ BZDEPTCD
INNER JOIN ZDESG_MST AS C
ON AZDESGCD EQ CZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*& Form LAYOUT
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
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. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*& Form LSORT
*FORM LSORT USING P_FIELD P_TABLE P_UP.
ADD 1 TO L_POS.
IT_SORT-SPOS = L_POS.
IT_SORT-FIELDNAME = P_FIELD.
IT_SORT-TABNAME = P_TABLE.
IT_SORT-UP = P_UP.
APPEND IT_SORT.
*ENDFORM. " LSORT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
ENDFORM.
*& Form F_WRITE_SUMMARY
Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.
Regards,
Bhaskar -
Header and footer in ALV using CL_SALV_TABLE
How to add header and footer for an ALV report using CL_SALV_TABLE. I know how to add header lr_table->set_top_of_list_print( lr_header )
but how do I make it aligned center.
Also how to add a footer
I want it to look like Current page of total pages
What is the system variable for total pages.Hi,
this should be the Method:
SET_END_OF_LIST_PRINT
Best Regards -
How to create Header and Footer template
Hi,
I am wondering if this is possible, if yes , can some help me please?
At present we have preprinted stationary for invoices and now the plan is to get rid of preprinted stationary and print header and footer via oracle reports directly. The address on header has to be dynamic because our organization has multiple offices across various countries. I am wondering if its possible to create a separate report only with a header and footer and reference it in other reports so that when printed both are merged and presented as single invoice. My reports knowledge is around basic level but i am good at plsql , if someone hear can please guide me HOW TO implement this logic I will be very grateful.
We are using Oracle reports 6
Thanks
Aali
Edited by: aali on 05-Jul-2010 05:44
Edited by: aali on 05-Jul-2010 06:09Hello,
You can set the header and footer dynamically.
In the report layout section. There is one option called Edit Margin beside the Help iconic button.
When you will press that button Edit Margin it will open for the new look your report fields and frames inside the black dense lined frame. So at the top of that main frame you can set the Header and same at the bottom you can set the Footer.
And in your case if you want to set dynamic. Then while running the report. Send the dynamic values into the parameters and when you will create field in layout section Header/Footer then set the source as parameter which you passed. So, it will change dynamically.
-Ammad -
OLE - Creating header and footer in Word document using abap
Hi All,
I'm using OLE to create a WORD document from abap.
I need to insert a logo in the header and a footer text.
Does any one know how to insert a header/footer with abap ole ?
I tried to insert the logo as picture with:
call method of o_inlineshapes 'AddPicture' = o_logo
exporting
#1 = 'C:\logo3.jpg'.
but I can't put it in the place I want..
thanks,
Michalcall method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'. " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
#1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'.
call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'. " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
#1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'. -
How to define header and footer in ALV
Hi All,
I have created one Report program where i have to display data in both alv grid and alv list display.
Reqt are:
1. The report output must contain standard header & footer.
2. The header must display the count of the materials displayed, the user name & system date.
3. The footer must display the name of the SAP system, Operating System of Application Server, Current GUI Status
& Release Status of SAP System.
I am using Fm REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DSIPLAY.
this top of page n end of page is part of slis_t_events only.
In list display FM, i m not getting any option to define top of page form.
Any pointers on this.
Thanks,
Mamtahii Mamta..
Try this .it will solve TOP-OF-PAGE problem. Pass TOP_OF_PAGE under FM REUSE_ALV_GRID_DISPLAY
eg.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ALV_LAYOUT
I_CALLBACK_PROGRAM = SY_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE' " TOP_OF_PAGE
I_GRID_TITLE = I_TITLE_ITEM
IT_FIELDCAT = I_FIELDCAT[]
I_SAVE = 'A'.
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_ITEM.
Form TOP_OF_PAGE.
* *ALV Header declarations
DATA: T_HEADER1 TYPE SLIS_T_LISTHEADER,
WA_HEADER1 TYPE SLIS_LISTHEADER,
T_LINE LIKE WA_HEADER1-INFO,
LD_LINES TYPE I,
LD_LINESC(10) TYPE C.
* Title
WA_HEADER1-TYP = 'H'.
WA_HEADER1-INFO = 'COMPLETE LC Records displayed'.
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR WA_HEADER1.
* Date
WA_HEADER1-TYP = 'S'.
WA_HEADER1-KEY = 'Date: '.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO WA_HEADER1-INFO. "todays date
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1.
DESCRIBE TABLE IT1 LINES LD_LINES.
LD_LINESC = LD_LINES. " No of Records in internal Table
CONCATENATE 'Total No. of Records in Database : ' LD_LINESC
INTO T_LINE SEPARATED BY SPACE.
WA_HEADER1-TYP = 'A'.
WA_HEADER1-INFO = T_LINE.
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1, T_LINE.
WA_HEADER1-TYP = 'A'.
WA_HEADER1-INFO = sy-uname. "User Name
APPEND WA_HEADER1 TO T_HEADER1.
CLEAR: WA_HEADER1, T_LINE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER1.
endform.
Reards,
Apoorv -
Hi All,
What is the use of Header and Footer Area (Top of List & End of List ) in ALV table. Can any one explain me..
Thanks,
Susilhi ,
In the below link there is an example for creating top of list end end of list.. in this the header and footer are displayed outside the ALV table.. My question is what is the use of the header and footer even I can use UI's to display the header and footer...
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0ee06d0-d475-2b10-ddad-bc4bf134cfb8?overridelayout=true
Thanks,
Susil. -
Need to add Header and footer in an alv grid display output.
How can I add header and footer in an alv grid dispay output.
For the grid display, I am using the function module "REUSE_ALV_GRID_DISPLAY".HI,
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_html_end_of_list = 'END_OF_LIST_HTML'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
DATA: ls_text TYPE sdydo_text_element,
l_grid TYPE REF TO cl_gui_alv_grid,
f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
ls_text = 'Footer title'.
adds and icon (red triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'IL'.
adds test (via variable)
CALL METHOD end->add_text
EXPORTING
text = ls_text
sap_emphasis = 'strong'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Bold text'
sap_emphasis = 'strong'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'Nor'.
adds new line (start new line)
CALL METHOD end->new_line.
display text(bold)
CALL METHOD end->add_text
EXPORTING
text = 'Yellow '
sap_emphasis = 'str'.
adds and icon (yellow triangle)
CALL METHOD end->add_icon
EXPORTING
sap_icon = 'IC''.
display text(normal)
CALL METHOD end->add_text
EXPORTING
text = 'Mor'.
*set height of this section
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 14.
ENDFORM. "end_of_list_html.
This will solve it. Post if you need more help in this.
Regards,
Madhu. -
How to place header and footer in OO-ALV program using class
How to place header and footer in OO-ALV program using class tell me wat r the class we shold use and their attributes as well
Hi Venkatesh,
Take a look at this how to [ABAP Objects - ALV Model - Using Header and Footer|https://wiki.sdn.sap.com/wiki/x/xdw]
it's explaining how to define the classes and use it for display an ALV with Header and Footer.
Regards,
Marcelo Ramos -
Header and Footer in Block ALV Display
Hi All,
My requirement includes to ALV Block List Display with header and footer.
I have made two forms TOP_OF_PAGE and END_OF_PAGE . I have pass the form and name of event to an internal table it_events.
This it_events[] is then passed to FM ' REUSE_ALV_BLOCK_LIST_APPEND' . But only Top of Page is working.
Am I missing any thing in the code? or I have to use something else.
Pls Help
Regards,
NibhaHi,
For end_of_page you need to use Events as follows:
*TO CAPTURE EVENTS AND HANDLE
DATA : it_event TYPE slis_t_event,
wa_event TYPE slis_alv_event.
*& Form BUILD_EVENTCAT
FORM build_eventcat .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_event
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
READ TABLE it_event INTO wa_event WITH KEY name = 'END_OF_LIST'.
wa_event-form = 'END_OF_PAGE'. " Sub-routine that will be used to write
MODIFY it_event FROM wa_event INDEX sy-tabix. " Modify it_event
CLEAR wa_event.
ENDFORM. " F_BUILD_EVENTCAT
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = g_t_alv_layout2
it_fieldcat = g_t_fieldcat2[]
it_events = it_event[]
TABLES
t_outtab = <fs_final_itab>.
Regards,
Mansi. -
How to create schema for Header and Footer with pipe delimiter file BPEL11g
Hi all,
I have issule creating Schema for Header and Footer with body file .The file format is Pipe delimiter.The following format below like is...
Softeware Components:File Adapter(Read) 11g,
1|1211|000|577|5444
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|0000|57|6988|4554|sfdgh|5448|3333|ituu|44445|55546|544|788|7788
1|4544|000|yted
I hope get the sollution for this from this Forum..Please help me out..Thankyou.You mean how many rows or columns..?
If coloumns means 5 and rows only one(1). -
How to create Schema Header and footer with Pipe delimiter file..?
Hi all,
I have issue with creating Schema Header and footer with body file ..The file format is Pipe delimiter.. The follwing file below like is...
Adapters:File Adapter(Read)-11g.
1|000|2025|SDFG|54787
1|2055|244|9566|000|000|044|2577|361147|45554|wweqw|52555|564|000|647|464
1|2027|344|4566|000|000|044|8577|361147|45554|wweqw|82555|564|000|647|844
1|2024|444|6566|000|000|044|9577|361147|45554|wweqw|12555|564|000|647|544
1|2023|544|8566|000|000|044|5577|361147|45554|wweqw|52555|564|000|647|442
1|2022|644|3566|000|000|044|7577|361147|45554|wweqw|02555|564|000|647|448
1|0000|546|25544|454
If you have sollution for this, please help me out..Thank you.You mean how many rows or columns..?
If coloumns means 5 and rows only one(1). -
Can you create a template that has a header and footer to forms?
Can you create a template that has a header and footer to forms?
Yes but how are they going to create the Landscape versions?
The problem with doing it in Pages '09 as rotated content is that the Headers and Footers are not rotated and there is inherent clumsiness in the rotated content usually being too large for the page when viewed at 90°.
Best to make it in two or more separate documents.
Peter -
How to set a page header and footer of an excel file i'm creating
Hello !
SORRY MY ENGLISH is very BAD.
I tried to set page header and footer in Excel sheet with ABAP ole
DATA : BEGIN OF enter,
x(1) TYPE x VALUE '0D',
END OF enter.
DATA : format(255) TYPE c.
FORM set_page_sheet.
CALL METHOD OF excel 'ActiveSheet' = sheet.
CALL METHOD OF sheet 'PageSetup' = pagesetup.
SET PROPERTY OF pagesetup 'Orientation' = xllandscape.
SET PROPERTY OF pagesetup 'PrintTitleRows' = '$9:$12'.
CLEAR format.
ERROR
CONCATENATE 'PAGESHEET' enter-x 'PAGE &P/&N' INTO format.
ERROR
SET PROPERTY OF pagesetup 'RightHeader' = format.
CLEAR format.
CONCATENATE ' Text 1 ' enter-x 'Text 2'
enter-x 'Text 3 ' INTO format.
SET PROPERTY OF pagesetup 'RightFooter' = format.
FREE OBJECT pagesetup.
ENDFORM. " set_page_sheet
Activate report -
ERROR - The enter-x must by data type c or another then data type x
Thanks for answer.Try to define ENTER this way & try
class cl_abap_char_utilities definition load.
DATA : BEGIN OF enter,
x type c value cl_abap_char_utilities=>cr_lf,
END OF enter.
PS : I am not 100% sure about this.
a®
Maybe you are looking for
-
Need help with applet related problems
First of all hello to everyone. I'm new to this forum. I usually can solve my problems google-ing around, but this time I just ran out of ideas. I'm trying to develop a jni applet that can run native code for performance. I used netbeans so far and t
-
I've recently been having troubles saving an open PDF file. I'm getting the error message: "The document could not be saved. The file may be read-only, or another user may have it opened. Please save the document with a different name or in a differe
-
Importing Word doc into Previously Existing Project Corrupts Related Topics
Hi, I had a few extra topics that I documented in a Word document and imported that document into an existing HTML Help project in RoboHelp. After doing this, it used the CSS file called by the new folder it added for those new topics (based on the n
-
Jakarta Commons -- File Upload does not work with Application Server
Hi ALl, I tried Jakarta Commons file upload. In the netbeans, I copied the common jar files "commons-io-1.2.jar" and "commons-fileupload-1.1.1.jar" in the netbeans-5.5\enterprise3\apache-tomcat-5.5.17\common\lib and set the class paths. It is working
-
Page coon be displayed with more data
Hi, I am having an issue with BSP , when I display 30 or 40 records using <htmlb:tableView > it works fine But when I try to display more records lets say 1K its showing Page cannot be displayed Could you please help Thanks,