ALV how to display page no in every page - Page break

Hi All
I would like to know how can i write an ALV page no in each of the page.
Currently i manage to write the page no in the top , but only show "Page No : 1 "
but when i send to spool the All the page no will break into "Page No : 1 , Page No :2 and up to end page .
thank you

Hi Check this program.
A Simple ABAP ALV LIST VIEWER Example
This ALV program have all the basic report requirements such as page heading, page no, sub-total and a grand total.
This is a basic ALV with the followings:-
- Page Heading
- Page No
- Sub-Total
- Grand Total
REPORT ZALV.
TYPE-POOLS: SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT            TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS           TYPE SLIS_T_EVENT,
GT_SORT             TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT           TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT         TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: BEGIN OF ITAB,
  FIELD1(5) TYPE C,
  FIELD2(5) TYPE C,
  FIELD3(5) TYPE P DECIMALS 2,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0.
  INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
  INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB_FIELDCAT.
Print Parameters
PARAMETERS:
            P_PRINT  AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
            P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
            P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
            P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
            P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
            P_RESERV TYPE I.                  "NO OF FOOTER LINE
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD    USING GS_PRINT.      "Print PARAMETERS
START-OF-SELECTION.
TEST DATA
MOVE 'TEST1' TO ITAB1-FIELD1.
MOVE 'TEST1' TO ITAB1-FIELD2.
MOVE '10.00' TO ITAB1-FIELD3.
APPEND ITAB1.
MOVE 'TEST2' TO ITAB1-FIELD1.
MOVE 'TEST2' TO ITAB1-FIELD2.
MOVE '20.00' TO ITAB1-FIELD3.
APPEND ITAB1.
DO 50 TIMES.
  APPEND ITAB1.
ENDDO.
END-OF-SELECTION.
PERFORM BUILD.
PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
PERFORM COMMENT_BUILD  CHANGING GT_LIST_TOP_OF_PAGE.
PERFORM CALL_ALV.
FORM BUILD.
DATA FIELD CATALOG
Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD1'.
FIELDCAT_LN-TABNAME   = 'ITAB1'.
*FIELDCAT_LN-NO_OUT    = 'X'.  "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
FIELDCAT_LN-KEY       = ' '.   "SUBTOTAL KEY
FIELDCAT_LN-NO_OUT    = ' '.
FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD2'.
FIELDCAT_LN-TABNAME   = 'ITAB1'.
FIELDCAT_LN-NO_OUT    = 'X'.
FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME     = 'FIELD3'.
FIELDCAT_LN-TABNAME       = 'ITAB1'.
FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
FIELDCAT_LN-REF_TABNAME   = 'MSEG'.  "<- REF TABLE IN THE DICTIONNARY
FIELDCAT_LN-NO_OUT        = ' '.
FIELDCAT_LN-DO_SUM        = 'X'.   "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
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'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS      = 2.
GS_SORT-UP        = 'X'.
*GS_SORT-SUBTOT    = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM.
FORM CALL_ALV.
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.
ENDFORM.
HEADER FORM
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
  DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            I_LIST_TYPE = 0
       IMPORTING
            ET_EVENTS   = LT_EVENTS.
  READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                           INTO LS_EVENT.
  IF SY-SUBRC = 0.
    MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
    APPEND LS_EVENT TO LT_EVENTS.
  ENDIF.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME =  SLIS_EV_END_OF_PAGE
                         INTO LS_EVENT.
IF SY-SUBRC = 0.
  MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
  APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM.
FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
  DATA: GS_LINE TYPE SLIS_LISTHEADER.
  CLEAR GS_LINE.
  GS_LINE-TYP  = 'H'.
  GS_LINE-INFO = 'HEADER 1'.
  APPEND GS_LINE TO GT_TOP_OF_PAGE.
  CLEAR GS_LINE.
  GS_LINE-TYP  = 'S'.
  GS_LINE-KEY  = 'STATUS 1'.
  GS_LINE-INFO = 'INFO 1'.
  APPEND GS_LINE TO GT_TOP_OF_PAGE.
  GS_LINE-KEY  = 'STATUS 2'.
  GS_LINE-INFO = 'INFO 2'.
  APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP  = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO  GT_TOP_OF_PAGE.
ENDFORM.
FORM TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
  WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
ENDFORM.
FORM END_OF_PAGE.
  WRITE at (sy-linsz) sy-pagno CENTERED.
ENDFORM.
PRINT SETTINGS
FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
  LS_PRINT-PRINT              = P_PRINT.  "PRINT IMMEDIATE
  LS_PRINT-NO_PRINT_SELINFOS  = P_NOSINF. "NO SELECTION INFO
  LS_PRINT-NO_COVERPAGE       = P_NOCOVE. "NO COVER PAGE
  LS_PRINT-NO_NEW_PAGE        = P_NONEWP.
  LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
  LS_PRINT-RESERVE_LINES      = P_RESERV.
ENDFORM.
*END OF ZALV PROGRAM
Reward if it helps you.

Similar Messages

  • How to display horizontal line in top-of-page by using object oriented ALV?

    How to display horizontal line in top-of-page by using object oriented ALV.
    I am created top-of-page in object oriented alv.
    But not be successes in showing horizontal line in it.
    Can any one pls give solution for this..
    Thanks and regards..

    Hi
    Try like this
    data: gt_list_top_of_page type slis_t_listheader. " Top of page text. 
    Initialization. 
    perform comment_build using gt_list_top_of_page[]. 
    form top_of_page. 
    * Note to self: the gif must be loaded into transaction OAOR with 
    * classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions. 
    * I Loaded NOVALOGO2 into system. 
    call function 'REUSE_ALV_COMMENTARY_WRITE' 
         exporting 
    * I_LOGO = 'NOVALOGO2' 
    * i_logo = 'ENJOYSAP_LOGO' 
             it_list_commentary = gt_list_top_of_page. 
    endform. " TOP_OF_PAGE 
    form comment_build using e04_lt_top_of_page type slis_t_listheader. 
    data: ls_line type slis_listheader. 
          clear ls_line. 
          ls_line-typ = 'A'. 
          ls_line-info = 'Special'(001). 
          fgrant = xgrant. 
          concatenate ls_line-info fgrant 
          'Stock Option Report to the board'(002) 
                 into ls_line-info separated by space. 
                        condense ls_line-info. 
          append ls_line to e04_lt_top_of_page. 
    endform. " COMMENT_BUILD
    Use following syntex for footer print in alv:
    * For 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.
    *  For End of Report
    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.
    check this link
    http://abapprogramming.blogspot.com/
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
    Changing width of a custom container dynamically
    Display Page numbers in ALV
    Insert picture in selection screen.
    Logo in OO ALV Grid
    Reward all helpfull answers
    Regards
    Pavan

  • HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS

    HI,
       HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?

    in ur script main window
    /: IF &TTXSY-PAGE& = 15.              
    ur text or standard text           
    /: ENDIF.                             
    use this.
    hope it helps if any issues revert back

  • How to display text on last but one page in SAPSCRIPTS

    how to display text on last but one page in SAPSCRIPTS

    u have create one Foooter window , this has to be called in  only One Page.So hardcode /assign this window to only one PAGE number.
    regards
    Prabhu

  • "Ghost" page numbers on every second page - how to remove?

    Hi,
    I'm setting a short book with Pages and after importing from Word, I'm seeing duplicate, partially hidden additional page numbers on every second page. I'd like to remove them entirely, keeping Pages' page numbering. Removing and inserting page numbers doesn't help and the second set of numbers can't be selected in any way (clicking, dragging don't work). One solution would be to re-import from word, deselecting page numbers beforehand, but I'd rather like avoid this step as I made many changes in Pages.
    Here's a screenshot showing the duplicate page numbers: http://dl.dropbox.com/u/3304376/pages_bug.png
    Does anybody have an idea how to remove them?

    Hello,
    Sometimes in the process of importing from Word, page numbers are improperly converted to Master Objects or Background Objects. Go to Format > Advanced > Make Master Objects Selectable. Then, with the cursor in the Margin of the document, press the Command Key (Cursor changes to an Arrow) and drag the cursor diagonally across the page number to select it. Then press the Delete key and the number should be gone. You need to check carefully to make sure that you have eliminated all the instances. There may be one per Section.
    Jerry

  • ALV: how to display only subtotals and total rows in the output

    ALV: how to display only subtotals and total rows in the output
    i am getting output
    i am getting subtotals for respective fields
    but i want to display only subtotals and totals rows in the output
    i have tried the
    totals_only   parameter in slis_layout_alv
    but it is not working.

    hi,
    For TOTAL
    For the amount field / quantity field in the field catalog give DO_SUM = 'X'    for WHOLE total
    For SUBTOTAL
    For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
    DATA: lt_sort type SLIS_T_SORTINFO_ALV,
    ls_sort type slis_sortinfo_alv.
    CLEAR ls_sort.
    ls_sort-spos = 1.
    ls_sort-fieldname = 'Give the field name that you do the sum'.
    ls_sort-up = 'X'.
    ls_sort-subtot = 'X'.
    APPEND ls_sort TO lt_sort.
    fieldcatalog-do_dum = 'X'.
    for subtotals
    WA_SORT-FIELDNAME = 'ERSDA'.
    WA_SORT-SPOS = '2'.
    WA_SORT-UP = 'X'.
    WA_SORT-SUBTOTAL = 'X'.
    APPEND WA_SORT TO IT_SORT.
    Refer
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
    regards,
    Prabhu
    reward if it is helpful

  • How to display date and time on jsf page

    Hi,
    how to display date and time on jsf page
    we are using 11.2.0.0 jdeveloper on windows.
    thanks
    Edited by: user12187801 on 26-Jul-2012 01:42

    Your question is certainly lacking some information.
    If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
    If you meant something else, then it's back to you to explain.

  • How to display a google map in OAF page?

    Hi All,
    I want to display a Google map in OAF page
    Please tell me whole procedure how i complete the required task
    Thanks

    these may help you.
    Google map integration to EBS

  • How to display current navigation on "Body only" page layout

    I create a new page and applied "Body only" page layout which is basically PageFromDocLayout.aspx
    But it doesn't show current navigation. How do I show current navigation on left side of the page? I have the code which will display current navigation but I don't know where to paste it inside page layout because there doesn't seem to be any space for that.
    Or is it something that I can enable disable from somewhere?

    There is no QuickLaunch snippet. There is one by the name of "Vertical Navigation" which I think is QuickLaunch snippet so I copied its code in PlaceHolderMain section inside page layout but getting error:
    ContentPlaceHolder can only be used in .master files.
    EDIT
    Ok I managed to do it by adding Vertical Navigation inside a separate <td> in my master page and then I only display it when page is not home page. So the is something like:
    HTML CODE IN MASTER PAGE
    <td id = "leftmenu" style="display:none">Vertical Navigation code here</td>
    <td>ContentPlaceHolderMain here</td>
    JAVASCRIPT CODE
    if(page is not home page then)
              document.getElementById("leftmenu").style.display = "block";

  • How to display each record on a new page on Smartforms layout

    Hi,
    I need to know how "each time a new record is displayed..it should be displayed on a new page in Smartforms". How much ever I try using the COMMAND inside the LOOP, it is always printing the records in the loop continiously in a single page with the remaining records moving to the next page only once the first page is full. But what i need is to print first record in the first page, second record in the second page...
    Please let me know the exact steps how to use the COMMAND or any other options to acheive this.
    Thanks!
    Edited by: sap123 on Nov 2, 2008 11:55 AM

    hi,
    create a command just before the main windows display and in its general attributes check the check box go to new page and in its conditions tab..set Falg = X.
    now inbetween the loop of ut table or templet, crete program lines and write the code as below.
    data : lv_lines type i.
    describe table i_vbak lines lv_lines.
    clear flag.
    if sy-tabix LT lv_lines.
    flag = 'X'.
    endif.
    remember that these program lines must be after command...
    Try this,

  • How to display images on a servlet generated page???

    Hi, I am developing an app in which I must display some messages, each message may have an image. The images are saved in the database. I do not want to save the image on the filesystem but instead of that I want to send the image as an attribute to the page but I dont know then how to display it. I have no idea about how to do that! Any help on this would be very appreciated!

    mmm yes I know that the img tag displays an image but I am asking how to display the image without saving the file into the server filesystem, I mean something like:
    1.- getting the bytes from the Database
    2.- getting an Image object
    3.- pasing it to the request as an attribute
    4.- getting that attribute from the request
    5.- displaying it on somehow directly from the image var or something.
    the src parameter of the img tag takes as a string the path of the image, but i dont want to save it.

  • How to Display the Report Based on The Page Number

    Hi All,
    I just have a requirement like this
    The User wants to see only the odd numbers of Report pages in the Total Report
    For Ex. If the Report consist of 10 Pages the user wanna see Pages 1,3,5,7,9...........
    is it attainable in WebI..............
    Please help on this
    Thanks in advance.............

    I wonder...how do you think user should navigate through document.... ? If I want to see only odd pages - I will either create separate report or I am ok with setting the correct number to actual displayed page.You may also consider using links - it depends how is report structure created...

  • How to display an image on the HTML page by using applet

    Dear friends,
    I am now writing an java applet, I want to display an image on the HTML page, and tried the following commands:
    {color:#ff00ff}{color:#000000}Image map; //put in the class definition
    map=getImage(getCodeBase(),"hhh.gif"); //put in the function of init()
    g.drawImage(map,0,300,this); //put in the function of paint(){color}
    {color}
    However, when I run it, the image wasn't displayed at all.
    I hope who guys ever come across this problem could help me to solve it. Thank you in advance!
    Hawaii

    Hi,
    I am no expert on Images
    but
    from personal exp.
    are you sure that map actually contains the image?
    try using
    ImageIcon ii = ImageIcon(String name);
    map = ii.getImage();I saw a tutorial on images i think on sun
    where they use ImageIcon to load the image

  • How to display the query results in several pages?.

    Hi,
    i want to display the query results in several pages. for example my query result found 50 matches, now i want to print 20 per pages next 20 will be in next pages. iam using only jsp & mysql.
    Regards
    Chinna

    Hi, what you are trying accomplish is known as pagination.
    You could use JSTL tags with Custom Tags to perform pagination in your JSP pages.
    evnafets showed me DisplayTags , you could use those as well http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
    Here is one article on paging:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0726-pagination.html

  • How to display Values(Numbers) over every individual Towers in 3D Graph?

    Hi!
    PFA below. Its regarding the screen shot of 3D Graph.
    As we can see in the picture that the values are not accurate to view. So its better to display values(numbers) on top of each tower in 3D Graph.
    How to display that? Kindly suggest me any solution.
    With Regards,
    Yarnagula Sudhir.
    Message was edited by: Yarnagula Sudhir
    Message was edited by: Yarnagula Sudhir

    You do realize that this forum is for Adobe InDesign?

  • How to display text on last but one page

    how to display text on last but one page

    Hi Preeti,
      If u r working on a smartform then click on th window go to the condition tab there
      at the end u will find events click on the the event on which u want to trigger the 
      print.
      If u r working on a script then create a text element and call this text elemtn at
    the end of processing of the main window, this will make sure that thetext element
    is triggered only at the end.
    I hope that helps u , if not pls let me know.
    Regards,
    Vaibhav B Gawali.

Maybe you are looking for

  • Need info on how to set GR-IV indicator

    Hi, We are on SRM 3.0, EBP 4.0 SP11. We have a condition for which we need to check the GR-IV indicator for all PO' line items going to R/3 from SRM. I tried using the BADI BBP_CREATE_PO_BACK, method FILL_PO_INTERFACE. In the interface, I am not able

  • How to use modem port on WRT54GS

    Hi,  I have a network like this: ADSL -> THOMSON wired modem -> LinkSys SR2016 wired switch -> LinkSys WRT54GS wired/wireless router My problem is with the connecction between the SR2016 -> WRT54GS.  As you probably will know the WRT54GS has 5 ports,

  • What are the master data tables for 'Plant'?

    Hi friends, What are the master data tables for 'Plant' that contain below data?: PLANT NAME1 NAME2 LANGUAGE HOUSE_NUM_STREET PO_BOX POSTAL_CODE CITY COUNTRY_KEY REGION COUNTRY_CODE CITY_CODE TIME_ZONE TAX_JURISDICTION FACTORY_CALENDAR Thanks a lot!

  • Java mapping and sxmb_moni

    HI all, I am using java mapping. Is there any way through which I can post debug messages on SXMB_MONI. For example I want to send messages like <b>ENTERING METHOD "Execute". performing Mapping. Leaving METHOD "Execute".</b> to SXMB_moni. Is there an

  • Workflow in MDM  with email notification

    Hi All,             I am using the workflow for the first time,and doing a scenario where workflow should be automatic and ,              1. as one user finishes the processing it should go to the next user automaticallyan an so on.               2.