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
Similar Messages
-
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. -
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 -
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 -
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 -
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. -
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. -
How to print header and footer in SET_TABLE_FOR_FIRST_DISPLAY
Hello Experts,
How to print header and footer while using the method SET_TABLE_FOR_FIRST_DISPLAY, any tips from the experts will be appreciated.
Regards,
BabuHi,
there are four events for printing: print_end_of_list, print_top_of_list, print_end_of_page and print_top_of_page. More information about implementing these events is in this bible for ALV:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
Cheers -
How to display 2 layouts with 2 different Header and Footer in a template.
Hi,
I am using XML Publisher 5.5. I have created one template which is having two layouts. I am using <?Start: Body?> and <?end body?> for displaying Headers and footers. Now my problem is, I need to display first layout with it's associated Header and footer and then second layout with other header and footer. But the two layouts should come in single template file. How is it possible?. Is there any work around? Please help me as this is the urgent requirement to my client.
Thanks.
Siva.No problem. Select Insert -> Break from the menu bar. Then select a "Section Break" - Next page.
Header 1
<?start:body?>
Page 1
<?end: body?>
Footer 1
==================Section Break (Next Page)=================
Header 2
<?start:body?>
Page 2
<?end: body?>
Footer 2
Worked like a charm.
Klaus -
Resetting Header and Footer in RTF templates
Hi,
I developed an RTF template (template 1). This template contains start:body and end body for printing the header and footer in all pages. After printing this template then i have to call another template(template 2) from this. I called the template (template 2) using call statement. But the probelm is that the header and footer of template1 is printed in the output of template2 .
I dont want to print this header and footer for template 2. Can anyone please suggest me in doing this. I placed start:body and end body in the second template with the assumption that 1st template's header and footer will be overwritten. But if i preview then am getting the error
Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
Run XDO Start
RTFProcessor setLocale: en-us
FOProcessor setData: C:\Documents and Settings\kpoda\Desktop\Invoice Printing Efficiencies\Sample XML Data\Sample Output4.xml
FOProcessor setLocale: en-us
each
Please sugget.
ThanksHi,
Do you have two templates (template1 & template2) that you want to display in the same document where the pages for template1 has one set of header and footers; and template2 has another set of header and footer?
If that is the case you can simply create a new section in your rtf template so you have section1 and section2.
In the body of section1 you call template1 and template2 in the body of section2.
You can then have different header and footers for the two templates in the same document.
BR Kenneth -
Remove filename header and footer
Hello! When you open a HTML file in Acrobat it puts the path to the filename in the header and footer automatically. How can I remove this?
I went to Header/Footer and tried to update or remove, but it says there is no option. How do I do this?
In another issue, Is there any plugin that will let me "press enter" to move the body of text downwards in the PDF, similar to Microsoft Word? I imported a bunch of company listings from a HTML document and I am trying to space them out 3 to a page and I need to shift the body of text down to the next page break. Is this possible with Acrobat or an affordable program/plugin?
Kind Regards,
KevinHave you tried using the Touch Up Text tool for both of your issues? Touch Up Text will not work in an automated way, but you can use it to manually edit existing text on the page. Not sure about any plugins that remove headers/footers, although there might be a way in Acrobat's help files that outline how to prevent it from automatically embedding on converted HTML pages from web browsers.
-
I am missing header and footer in numbers
after I updated to Numbers 3.01 I miss the footer and header in my docs
and can't find any posiibility how to do that.
In the older versions there were always header and footer.
Can anyone please help?
Thanks
plet's hope and wait ;-)
Meanwhile there are some workarounds that can work for some headers (though, for footers, you're limited to page number). See this in Print Preview:
You can set up extra Header Rows in your table and have them repeat on each printed page. The Table Name only shows on the first printed page, so you may want to uncheck Table Name before printing:
See this thread for an example of how this workaround worked for one user.
SG -
How to Add Header and Footer in Flat file
HI All,
I am using ODI 11g.
MY interface is populating data from joining to 2 tables through sql query and Loads in to Flat file.
But i need to add Header and Footer in the Flat file.
In the below 3 lines
The 1st line is header ....2nd line is Data ....3rd line is Footer.
Any ideas how to work on this.
HSB9KT.KTPRTO.EBSDATA.D0000000 20120626020636
CFFE00263 SOLGSR014991340000527894536058173880207SOLNE06242012072420120000009048382650000247MRS
T00000000000000000000
Thanks,
LonyHi Drieux,
i am able to add Header and Footer in this.
But i want the header like Its like HSB9KT.KTPRTO.EBSDATA.D0000000 || SYSDATE (YYYYMMDDHHMMSS)
In my Out put i only see header as HSB9KT.KTPRTO.EBSDATA.D0000000 .
I have added a Variable where i am using SELECT to_char(sysdate,'YYYYMMDDHHMMSS') FROM DUAL query.
create header (HSB9KT.KTPRTO.EBSDATA.D0000000 #v_DATE)
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FFT_SOLSNP$CRLOAD_FILE=/home/tarak/FFT_SOL.datSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=descrSNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=1SNP$CRLENGTH=994SNP$CRPRECISION=994SNP$CR$$SNPS_END_KEY*/
Any idea why this sysdate part is not showing in Header.
Maybe you are looking for
-
How to reuse a Joomla database?
Client wants to have a BC site, but the info from the current site is in Joomla. How can I build them a site besides the 4 main html pages? Can the database be reused from the Excel file? Rather use Dreamweaver than Joomla any day.
-
Error in compiling Flex application (1).
hi experts, i have created a small Iview in VC. It was compiling an running till two days back. Today it has started giving deplyoment error. <b>Error in compiling Flex application (1).</b> here is the trace. can anyone please tell me what might be t
-
Mac OS X 10.4.11 - iTune 7 can't access Store
I cant access iTune Store, can someone help please?
-
Running with iPod: Is it okay?
The main reason I got an iPod was so I could go jogging with it. I recently got a new ipod video, and have now heard that it might not be a good idea to go jogging with it. Is it okay to run with an iPod as long as I use an armband?
-
Can't select at log in with magic track pad
when I get to the log in screen I can move my curser but can't select nothing when I tap the magic track pad I end up hooking up a wired mouse to select user name to input it