How to display page no in ALV Footer?
Hi
When I take print of long ALV List then footer and header is not repeat on each page. I want to repeat the footer on each page and also display the page no. there. How can I do this? please give me help.
Thanks
Iftikhar Ali
Islamabad.
Refer the links -
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
Alv page no 1 of 10 in footer
Regards,
Amit
Similar Messages
-
How to display page-no in alv list
Hi All,
I am trying to display pag number using events 'top-of-page'.
when i write sy-pagno in top-of-page form its printing only 1, if i press page down i need to change the page number. it should display current pag number. How to achieve this. thanks.
regards
vishalwe can print the pageno .I was also trying for the same finally succeded
It can be done in the following manner
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
<b>gs_sort-group = '* '. "<<<new page</b>
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
gs_sort-group = ' '. "<<<new page
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2. -
How to Display Page Numbers in ALV Report HTML End of page Event
hai Gurus
Greetings
Please tell me how to get current page noumber and total number of pages in ALV Report (in HTML End of Page Event)
i tried with sy-pagno system field but it is not working
so please guide me
Thanks
Rameshcheck below code....
*Work area for Layout
gf_layout type slis_layout_alv,
*Work area for HEADER FOOTER
gf_header type slis_listheader,
*Work area for Field catalogue
gf_fieldcat type slis_fieldcat_alv.
it_top_page type slis_t_listheader,
*Internal table for Field catalogue
it_fcat type slis_t_fieldcat_alv.
perform:fill_layout,
prepare_header,
field_catlog,
display_report.
Form fill_layout
form fill_layout .
gf_layout-colwidth_optimize = 'X'.
endform. " fill_layout
Form field_catlog
form field_catlog .
data : lf_fcat type line of slis_t_fieldcat_alv,
l_cnt type i.
clear : lf_fcat, l_cnt.
Employee Number
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPLID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-003.
append lf_fcat to it_fcat.
clear lf_fcat.
*Last Name
add 1 to l_cnt.
lf_fcat-fieldname = 'USERNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-004.
append lf_fcat to it_fcat.
*First Name
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-005.
append lf_fcat to it_fcat.
*Known As
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPSTATUS'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-006.
append lf_fcat to it_fcat.
clear lf_fcat.
*System UserID
add 1 to l_cnt.
lf_fcat-fieldname = 'COSTCENTER'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-007.
append lf_fcat to it_fcat.
clear lf_fcat.
*EMail ID
add 1 to l_cnt.
lf_fcat-fieldname = 'DEPTDESC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-008.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employment Status
add 1 to l_cnt.
lf_fcat-fieldname = 'LOC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-009.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area
add 1 to l_cnt.
lf_fcat-fieldname = 'TITLE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-010.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area Text
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'HDATE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-011.
append lf_fcat to it_fcat.
clear lf_fcat.
*Country Grouping text
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-012.
append lf_fcat to it_fcat.
clear lf_fcat.
*Cost Center
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-013.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employee Group
add 1 to l_cnt.
lf_fcat-fieldname = 'MGMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-014.
append lf_fcat to it_fcat.
clear lf_fcat.
*Organizational Unit
add 1 to l_cnt.
lf_fcat-fieldname = 'DIV'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-015.
append lf_fcat to it_fcat.
clear lf_fcat.
*Supervisor
add 1 to l_cnt.
lf_fcat-fieldname = 'BUSUNIT'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-016.
append lf_fcat to it_fcat.
clear lf_fcat.
endform. " field_catlog
Form display_report
form display_report .
data : l_repid type sy-repid.
clear l_repid.
l_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = l_repid
is_layout = gf_layout
it_fieldcat = it_fcat
i_callback_top_of_page = 'TOP-OF-PAGE'
tables
t_outtab = it_employee
exceptions
program_error = 1
others = 2.
endform. " display_report
Form PREPARE_HEADER
form prepare_header.
data:l_header1(20),
l_header2(60).
data:l_header3(20),
l_header4(60).
l_header1 = 'Met Life Census Data'.
l_header2+40(8) = 'Run Date'.
write sy-datum to l_header2+50(10).
header
gf_header-typ = 'S'.
gf_header-key = l_header1.
gf_header-info = l_header2.
append gf_header to it_top_page.
clear gf_header.
endform. " PREPARE_HEADER
form top-of-page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = it_top_page.
endform. "TOP-OF-PAGE
*& Form end_of_list_html
output at the end of the list - not in printed output *
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+0(20) = 'Total Employees'.
LS_TEXT+40(10) = g_count.
CALL METHOD END->ADD_TEXT
EXPORTING
TEXT = LS_TEXT
SAP_EMPHASIS = 'STRONG'.
*adds new line (start new line)
CALL METHOD END->NEW_LINE.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 10.
ENDFORM. -
How to print Page No. in ALV footer.
I am using the follwoing code but when I got print the page numbers are not displaying. I was copy the code from one of group message.
Please tell where I am making mistakes means why page numbers are not displaying at footer.
I want to print 30 rows on each page and display the page no. in footer of each page.
REPORT zift_test_alv.
Report Name: PS Report *
Created by: IALI *
Tables ( To support selection screen )
TABLES:
MSEG.
S E L E C T I O N S C R E E N *
*SELECT-OPTIONS: PostDate FOR BSIS-BUDAT.
SELECTION-SCREEN: Begin of block B01 WITH FRAME TITLE TITLE01.
SELECT-OPTIONS: so_plant FOR mseg-werks. " Plant
SELECTION-SCREEN: end of block B01.
D A T A D E C L A R A T I O N *
Types
types: begin of slis_print_alv1,
no_print_selinfos(1) type c, " display no selection infos
no_coverpage(1) type c, "
no_new_page(1) type c, "
reserve_lines type i, " lines reserved for end of page
no_print_listinfos(1) type c, " display no listinfos
no_change_print_params(1) type c, " don't change linesize
no_print_hierseq_item(1) type c, "don't expand item
print_ctrl type ALV_S_Pctl,
end of slis_print_alv1.
types: begin of slis_print_alv.
include type alv_s_prnt.
include type slis_print_alv1.
types: end of slis_print_alv.
types: begin of slis_alv_event,
name(30),
form(30),
end of slis_alv_event.
types: slis_t_event type slis_alv_event occurs 0.
TYPES: BEGIN OF ty_mseg,
WBS type mseg-PS_PSP_PNR,
MSEG_WERKS TYPE MSEG-WERKS, " Plant
ABLAD TYPE MSEG-ABLAD, " Unloading Point
WEMPF TYPE MSEG-WEMPF, " Goods Receiptent
MBLNR TYPE MSEG-MBLNR, " Material Do Number
end of ty_mseg.
Internal tables and work areas
DATA:
IT_MSEG type table of TY_MSEG,
GV_TITLE type LVC_TITLE.
DATA: gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
r_alv_template type ref to ZCL_BT_ALV_TEMPLATE.
Data declarations for the ALV grid
DATA: r_grid TYPE REF TO cl_gui_alv_grid.
DATA: alv_fieldcat TYPE slis_t_fieldcat_alv,
wa_alv_fieldcat TYPE slis_fieldcat_alv,
alv_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
Initialization.
select single max( ddtext ) from dd02t into TITLE01 where tabname = 'MSEG'
and ddlanguage = sy-langu."#EC *
D A T A S E L E C T I O N *
START-OF-SELECTION.
SET COUNTRY 'PK'.
" Getting data from MSEG
SELECT APS_PSP_PNR AWERKS AABLAD AWEMPF A~MBLNR
FROM mseg AS A
INTO table it_mseg
WHERE a~werks in so_plant.
A~PS_PSP_PNR IN SO_WBS.
*BREAK-POINT.
A L V P R O C E S S I N G *
END-OF-SELECTION.
PERFORM alv_setup.
PERFORM display_alv.
FORM alv_setup.
CLEAR wa_alv_fieldcat.
REFRESH alv_fieldcat.
wa_alv_fieldcat-key = ''.
wa_alv_fieldcat-fieldname = 'WBS'.
wa_alv_fieldcat-seltext_s = 'WBS'.
wa_alv_fieldcat-seltext_m = 'WBS Element'.
wa_alv_fieldcat-seltext_l = 'WBS Element'.
APPEND wa_alv_fieldcat TO alv_fieldcat.
wa_alv_fieldcat-key = ''.
wa_alv_fieldcat-fieldname = 'ABLAD'.
wa_alv_fieldcat-seltext_s = 'Un Ld Pnt'.
wa_alv_fieldcat-seltext_m = 'Un Lding Pnt'.
wa_alv_fieldcat-seltext_l = 'Un Loading Point'.
APPEND wa_alv_fieldcat TO alv_fieldcat.
wa_alv_fieldcat-key = ''.
wa_alv_fieldcat-fieldname = 'MSEG_WERKS'.
wa_alv_fieldcat-seltext_s = 'Plant'.
wa_alv_fieldcat-seltext_m = 'Plant'.
wa_alv_fieldcat-seltext_l = 'Plant'.
APPEND wa_alv_fieldcat TO alv_fieldcat.
wa_alv_fieldcat-key = ''.
wa_alv_fieldcat-fieldname = 'WEMPF'.
wa_alv_fieldcat-seltext_s = 'Good Rec'.
wa_alv_fieldcat-seltext_m = 'Good Rec'.
wa_alv_fieldcat-seltext_l = 'Good Receipt'.
APPEND wa_alv_fieldcat TO alv_fieldcat.
wa_alv_fieldcat-key = ''.
wa_alv_fieldcat-fieldname = 'MBLNR'.
wa_alv_fieldcat-seltext_s = 'Mat Doc'.
wa_alv_fieldcat-seltext_m = 'Mat Doc'.
wa_alv_fieldcat-seltext_l = 'Mat. Doc. No.'.
APPEND wa_alv_fieldcat TO alv_fieldcat.
ENDFORM. " alv_setup DMBTR
FORM display_alv.
gd_repid = sy-repid.
Configure layout of screen
alv_layout-colwidth_optimize = 'X'.
alv_layout-zebra = 'X'.
alv_layout-no_min_linesize = 'X'.
Now call display function
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP_OF_PAGE_SETUP' "Ref to form
is_layout = alv_layout
it_fieldcat = alv_fieldcat
i_grid_title = text-005
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
TABLES
t_outtab = IT_mseg
EXCEPTIONS
program_error = 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.
perform build_events.
perform build_print_params.
ENDFORM. " display_alv
FORM top_of_page_setup.
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
wa_header-typ = 'H'.
wa_header-info = 'Test Report '.
APPEND wa_header TO t_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM. " top_of_page_setup
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name =
slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name =
slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_ PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_ PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50) .
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
Regards
Iftikhar Ali
IslamabadHi,
just populate ur eventcat like this , may be this can help u
form zf_eventcat using p_it_eventcat type slis_t_event.
data l_eventcat type slis_alv_event.
clear l_eventcat.
*Get all the events.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = p_it_eventcat
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.
TOP-OF-PAGE FORM
clear l_eventcat.
read table p_it_eventcat into l_eventcat with key
name = slis_ev_top_of_page.
if sy-subrc = 0.
move 'ZF_TOP_OF_PAGE' to l_eventcat-form.
modify p_it_eventcat from l_eventcat index sy-tabix
transporting form.
endif.
PF_STATUS_SET FORM
clear l_eventcat.
read table p_it_eventcat into l_eventcat with key
name = slis_ev_pf_status_set.
if sy-subrc = 0.
move 'ZF_PF_STATUS_SET' to l_eventcat-form.
modify p_it_eventcat from l_eventcat index sy-tabix
transporting form.
endif.
USER_COMMAND FORM
clear l_eventcat.
read table p_it_eventcat into l_eventcat with key
name = slis_ev_user_command.
if sy-subrc = 0.
move 'ZF_USER_COMMAND' to l_eventcat-form.
modify p_it_eventcat from l_eventcat index sy-tabix
transporting form.
endif.
endform. " zf_eventcat
reward if helpful -
How to display page numbers in report
hi all,
i would like to know how to display page numbers in this format " 1 of 5" in the report.
Any help would be much appreciated.
thanks
seemaHi,
Check this too...
Page No. in ALV output
If you query is solved, kindly close the thread.
Regards,
Anjali
Message was edited by: Anjali Devi Vishwanathan -
Hi,
I would like to know how to display page numbers in an ALv display(both grid display and list display).I tried to use the system variable sy-pagno .But couldn't get the desired output.Hi,
I don't think you will be able to display page numbers in case of ALV Grid, unless you are in the list view. In case you are using the ALV Grid, you have to implement the top_of_page method (an event handler) for ALV Grid class and write the page number there. The page numbers will be displayed once you choose the list view.
Hope this helps.
Regards
Message was edited by: Shehryar Khan -
Display Page number in ALV List.
Dear Friends,
I want to display page numbers in ALV list print output. But I dont know how to do that without using objects.
Please suggest.
Regards,
Madan.TRY LIKE THIS
data : ifieldcat type slis_t_fieldcat_alv,
wfieldcat type slis_fieldcat_alv,
IEVENT TYPE SLIS_T_EVENT,
WEVENT TYPE SLIS_ALV_EVENT..
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IEVENT
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 IEVENT INTO WEVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WEVENT-FORM = 'TOP_OF_PAGE'.
MODIFY IEVENT FROM WEVENT INDEX SY-TABIX.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOPOFPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IFIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IEVENT
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 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.
FORM TOP_OF_PAGE.
WRITE : /10 'HeadinG OF ALV'.
WRITE : 100 SY-PAGNO.
ENDFORM.
ONE THING IS THERE YOU CAN USE WRITE FOR ONLY LIST DISPLAY NOT FOR GRID DISPALY.
REGARDS
SHIBA DUTTA -
How to display the fields in ALV Output without using Field catalog?
How to display the fields in ALV Output without using Field catalog?
Could you pls tell me the coding?
Akshitha.Hi,
u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
data: itab type table of mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = itab
CHANGING
ct_fieldcat = lt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*Pass that field catalog into the fillowing FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_grid_title = 'REPORTING'
is_layout = gt_layout
it_fieldcat = lt_fieldcat[]
tables
t_outtab = itab. -
Displaying page number in ALV grid display
Hi,
Is it possible to display page number in an ALV grid display?
If yes, how?
I tried it in top of page event, but it didnt work.
Harmeet.hi,
check out the sample code....
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'F00007_USER_COMMAND'
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
it_fieldcat = g_t_fieldcat[]
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab = g_t_final_report[]
EXCEPTIONS
program_error = 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.
FORM TOP_OF_PAGE *
FORM top_of_page.
write : sy-pagno.
ENDFORM. "top_of_page
Reward Appropriate points.
Regards,
Mansi. -
Displaying Page No in ALV Grid top of page
Dear All,
I have tio display the page number in ALV grid top of page .
That is 001 of 100
next page 002 of 100
this page number should increase / decrease depending upon page up and page down also on scrolling the ALV bar .
How to achieve this?
RegardsHi Rajendra,
I guess you need to write your logic to get the page numbers. Check the below link.
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
Thanks
Satya
Edited by: Rob Burbank on Aug 24, 2010 5:57 PM -
How to display Page numbers in XMLreport(on PDF)
hi all,
we have a requirement where we need to display page numbers(e.g.page 1 of 10),on an XML report.
can anybody suggest me the solution.Hi,
Check this too...
Page No. in ALV output
If you query is solved, kindly close the thread.
Regards,
Anjali
Message was edited by: Anjali Devi Vishwanathan -
How to Display Sub-Columns using ALV Grid
Hi ,
Could someone tell me how to display sub-columns under a parent column using ALV Grid. Do we have any standard Program which has this scenario. Please let me know.
Thanks,
Abaper.
Message was edited by:
ABAP'eryou can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
check below
BCALV_DND_01 Drag ALV Row to Tree Folder
BCALV_DND_02 Drag Icons from Tree to Rows of the Grid
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
Rewards if useful............
Minal -
Display page numbers in alv display
Hai all,
I am using fm REUSE_ALV_HIERSEQ_LIST_DISPLAY for the alv display.
I am also passing the 'top_of_page' subroutine to the event table.
The requirement is , I need to display the page number in the top of page.
ex header format is as below:
company name : abcd. date : xx.yy.zzzz.
page number: 1
in the next page that is when user scrolls down,
the output should be,
company name : abcd. date : xx.yy.zzzz.
page number: 2
in the top of page subroutine I am passing sy-pageno.
When I executed this, the page number is always showing '1' when I am usinng page down button.
But when take the printout, it is coming fine.
is it possibel to increment the page number, for every pagedown button hit?
Thanks & Regards,
BhaskarHai Gopal,
Thank you for the response.
The top-of-page is trigegring only once & it sill display page no 1 always, even after using sy-cpage.
any idea why is this happening?
Regards,
Bhaskar -
Dear friends,
I am displaying my reprot in ALV GRID display but as per new requirement my client want that it should be dealer wise means the dealer should come on top of page and its customer data below that heading after all customers the totle should come and when dealer change it should appear on the new page.
Can any body tell me hw to do this.
Thanking you all in advance,
NavinHI
navin this code might help u this code triggers a pge break at every new date
*& Report Y_TOP_PAGE *
REPORT y_top_page .
TABLES : mara.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
END OF it_mara.
*layout
DATA: wa_layout TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
I_INTERNAL_TABNAME = 'IT_MARA'
i_structure_name = 'IT_MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = w_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat_wrt_off[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat_wrt_off
TABLES
t_outtab = it_mara
EXCEPTIONS
program_error = 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.
Form TOP-OF-PAGE *
ALV Report Header *
FORM top-of-page.
*ALV Header declarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.
Title
wa_header-typ = 'H'.
wa_header-info = 'CHANDU REPORT'.
APPEND wa_header TO t_header.
CLEAR wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
APPEND wa_header TO t_header.
CLEAR: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
ENDFORM. "top-of-page
if it is helpfull plzz reward
dont forget to reward if ti is usefull
for any further quiries contact me on [email protected] -
How to Display Sub-Columns using ALV
Hi experts,
Could someone tell me how to display sub-columns under a parent column using ALV. Do we have any standard Program which has this scenario. points are guaranteed for the right answer.
Thanks in advance
Sreenivasyou can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
check below
BCALV_DND_01 Drag ALV Row to Tree Folder
BCALV_DND_02 Drag Icons from Tree to Rows of the Grid
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
Rewards if useful............
Minal
Maybe you are looking for
-
Problem with adobe CC 2014 unstable in print mode
I installed the "new and wonderful" Adobe Photoshop 2014.2 I am running win 7 on one computer and Win 8.1 on the other. BOTH computers shut down when I try to print almost any file I created with Adobe Photoshop CC and earlier. I have "re-set" the pr
-
Count total rows in vo.
Dear All, I have a af:showDetailItem in which i have a af:table. I want to show the total number of records in the header of af:showDetailItem. example: Employees (count=10) So any one have any idea of how to solve this problem.? Regards, Santosh. C
-
Oracle 11.1.0.6.0 db_block_size change
Hi Could you please help me in providing the steps for changing the db_block_size on an existing database Oracle 11.1.0.6.0 which is with data. Thanks,
-
Why app world does not prompt when exitting while installation is going on.
When I install any apps from apps world, why it does not promt when installing anything, This is bcz it stops the download . Its frustrating when you have to again download it .
-
Documents needed for Configuration of BCS
I want to configure a system for BCS. Pls let me knwo the documents for Configuration.