How to print page no/total pges in report programing?

how to print page no/total pges in report programing?

Hi
This is an example:
In TOP-OF-PAGE you can write:
WRITE: SY-PAGNO, '/', '-----'.
When the program has finished to print all data, run a routine like this:
Declare a variable
DATA: L_PAGE_COUNT(5) TYPE C,
      V_LINE TYPE I. "The line where page number is written
* In my example I suppose the page number is always
* written in the first row of the page.
V_LINE = 1.
*  Copy this code to the end of program
*  Page count will be printed on each page here
  WRITE sy-pagno TO l_page_count LEFT-JUSTIFIED.
  DO sy-pagno TIMES.
    READ LINE V_LINE OF PAGE sy-index.
    REPLACE '-----' WITH l_page_count INTO sy-lisel.
    MODIFY CURRENT LINE.
    ADD 1 TO sy-index.
  ENDDO.
Max

Similar Messages

  • How to print page no in standard sap report..

    Hi All,
    I am taking print out of standard reports but page no. is not showing.
    How to set page no. ? Which transaction ?
    Through SPAD we can set page no. ?
    Yusuf

    Hi!
    It depends on the standard program. Maybe it can be set with one of its checkboxes on the selection screen.
    If it cannot be set, then the standard list does not provide the page numbers.
    Youhave to copy into a Z-program if it is really neccessary.
    Regards
    Tamá

  • How to print page numbers in adobe form

    Hi,
    Can anybody tell me how to print page numbers in adobe form.
    Thanks in advance
    Chaitanya

    Hi,
    Yes the field page n of m is used normally for printing page numbers. But it won't display the current page of total pages by itself. You have to set the run time property to n (current page ) and m (Total number of pages). Carefully select the # (current page ) and ## (Total number of pages). Hope this works for you.
    My requirement is to have the user control on current page. For Example:
    Example for a Invoice with 5 PO items (stands on 2 pages) :
    1st  page is the letter : no page number
    2nd page is the 1st page of the 1st copy of the invoice : we should read u201C1 / 2u201D
    3rd page is the 2nd page of the 1st copy of the invoice : we should read u201C2 / 2u201D
    4th page is the 1st page of the 2nd copy of the invoice : we should read u201C1 / 2u201D
    5th page is the 2nd page of the 2nd copy of the invoice : we should read u201C2 / 2u201D
    Presently i cam getting the current page number for page 4th as 3 / 2 and for 5th page 4 / 2. I could able to control the total number of pages from print program. But when i am printing the second copy (4th and 5th pages), I couldn't able to control the current page number. I need to initialize the Current page count (4th page ) as 1.
    I have used the follwing java scripting:
    this.rawValue = wv_pages - xfa.layout.page(this)
    where wv_pages is total no of pages calculated from print program.
    Please help me in this regard with some formcal or java scripting conditions.
    Thank You,
    Regards,
    Naresh.

  • How to print page dynamically in smartforms

    Hi All,
    Please help on below case...
    1. I have developed a smartform which has 5 pages in total . Through driver program passing 4 internal tables...
    first page - will print all times... - consuming first internal table data
    second page - need to print dynamic - consuming data from second int table
    third page     - need to print dynamic - consuming data from second int table
    fourth page - need to print dynamic - consuming data from thrid int table
    fifth page    -  need to print dynamic - consume data from fourth int table
    dynamic condition  is determined in driver program ... but how to implement dynamic determination in smartforms..
    sometimes ...based on data ...we need to print first page , and fifth page only ...
    as of now all 5 pages are printing ...
    Expect the advise from expertist...
    Thanks and Regard
    Ramasi
    Edited by: ramasi on Sep 1, 2011 11:29 AM

    Hello,
    Plz use this code, may be it will help you as given below:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    id                            = '0001'
    language                      = sy-langu
    name                          = v_name
    object                        = 'VBBP'
    TABLES
    lines                         = dt_lines
    EXCEPTIONS
    id                            = 1
    language                      = 2
    name                          = 3
    not_found                     = 4
    object                        = 5
    reference_check               = 6
    wrong_access_to_archive       = 7
    OTHERS                        = 8.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    But kindly note that plz don't use the exception (code) for the purpose, May be thi will hlp you for the purpose.
    Thanks & Regards,
    Akg

  • How to clear a buffer memory in a report program?

    Hi Gurus,
    How to clear a buffer memory in a report program?
    Regards,
    Amit Kumar Singh

    Yes i am using USER__COMMAND like this
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE sy-ucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
    data : l_memory_id(20) type c value 'BSVA_BUFFER'.
    free memory ID l_memory_id.
      CASE u_ucomm.
        WHEN gc_refresh.
          PERFORM clear_data.
         CONCATENATE '-' p_months INTO p_months.
          PERFORM populate_z01.    "List of Plants and Materials
          PERFORM populate_z02.    "List of Periods and dates
          PERFORM populate_z03.    "Report Contents
          PERFORM add_data.
          us_selfield-refresh    = c_x.
          us_selfield-col_stable = c_x.
          us_selfield-row_stable = c_x.
      ENDCASE.
    ENDFORM.                    "user_command
          FORM PF_STATUS_SET                                            *
    FORM pf_status_set USING ut_extab TYPE slis_t_extab.        "#EC CALLED
      DELETE ut_extab WHERE fcode = gc_refresh.
      SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
          EXCLUDING ut_extab.
    ENDFORM.                    "pf_status_set
    Where   gc_refresh is defined as
    constants : gc_refresh TYPE syucomm VALUE '&REFRESH'.

  • How to print page numbers like 'Page 2 of 10' on an ALV report

    Hi,
    I've seen a few threads regarding this, but haven't seen any code that actually works. 
    What I'd like to do is print page x of y (i.e. Page 2 of 10) on an ALV report once the report is printed.
    Is this actually possible?  If so, what are the steps and coding required? 
    I greatly appreciate your help experts!
    Mark

    Hi Mark,
    I think there is no better way than calculate it before doing the output. If you do not have extra-new-page, the total number of pages may be calculated as the number of lines displayed divided by lines on one page - this will depend on the lines used for top-of-page and end-of-page. Also filters and subtotals could not be used.
    An other approach could be to read the current page number in end-of-list event and then scan the whole list using READ LIST and MODIFY LIST in each page top accordingly.
    Because it is decades ago I printed a list last time I will never have the chance to try.
    Regards,
    Clemens

  • How to print page numbers on physical pages conditionally?

    Hi,
    my report has a single logical page comprising of 3 reapeating frames , each getting printed on 3 different physical pages. I need to print page number at the bottom of the page in the case of two repeating frames while on the side of the page in the third case. How do I do this?
    TIA
    Ranjit

    i think u only need to say page break before on ur third repeating frame and ur problem is solve.
    repeating frame 1 and 2 on the firstpage getting page 1 and repeating 3 on page 2.
    cheers.

  • How to print page in front and back in scripts

    hi,
    I want to know to know the how to print a page in front and back.

    HI Ragavendra
    set this
    <b>Print mode is D</b>
    With Print mode, you can specify single- or double-sided printing for a page. You can choose from the following values:
    <b>D </b>The page is printed on the first side of a sheet in duplex mode. If another mode was previously active, then the printer is switched to duplex mode with the start of the pageand continues in this mode.
    and other Print mode options are
    <b>Print mode</b>
    With Print mode, you can specify single- or double-sided printing for a page. You can choose from the following values:
    <b>' '</b> Currently active printing mode continues unchanged.
    <b>S </b>The page is printed in simplex mode. That is, the printer should print on only one side of the paper. If another mode was previously active, then the printer is switched to simplex mode with the start of the page.
    <b>D</b> The page is printed on the first side of a sheet in duplex mode. If another mode was previously active, then the printer is switched to duplex mode with the start of the pageand continues in this mode.
    <b>T </b>The page is printed on the first side of a sheet in tumble duplex mode. That is, the printer prints on both sides. The page on the second side is always inverted, so that the footer of the second page is printed opposite the header of the first page.
    If another mode was previously active, then the printer is switched to tumble duplex mode with the start of the page and continues printing in this mode.
    Print modes are currently supported for printers that use the PCL-5 language. These are printers that are defined with the following SAP device types: HPLJ_II, HPLJIIID, HPLJ4, LX4039, SNI20XX8.
    See the spool system (transaction SPAD) to check on how your printers are defined.
    The print controls for these functions are SPMSI (begin simplex printing); SPMDU (begin duplex printing); SPMTU (begin tumble duplex printing); SPMFS (print on first side of sheet in duplex or tumble duplex mode); and SPMBS (print on second side of sheet in duplex or tumble duplex mode).
    Regards Rk

  • Printing Page Numbers With A Sub Report

    Hi, I have a Crystal Report (XI) that includes a subreport which is identical to the main report because I am actually making the report print 2 copies of the same report with different critera in the detail section only. On the main report I have a Page Header section which I am using the special field "PAGE N of M", so on all pages of the report it is printing this page number. I  My issue is listed below:
    First page of report                    "Fred's Place"                 Page 1 of  2 (Correct)
    Second page of report              "Fred's Place"                 Page 2 of  2 (Correct)
    Third page of report                   "Fred's Place"                 Page 3 of  2 (Not Correct)
    Fourth  page of report                "Fred's Place"                 Page 4 of  2 (Not Correct)
    The first/second page are printing correctly with data being pulled from the main report, but the third/fourth pages are not printing correctly with data pulled from the sub report. My question is how to get the third/fourth pages to print as follows:
    Third page of report                   "Fred's Place"                 Page 1 of  2 (Correct)
    Fourth  page of report                "Fred's Place"                 Page 2 of  2 (Correct)
    Thanks for your help
    Jim Dyer

    Jim,
    Try passing the total page count from the main report to the subreport via a shared variable. Then set up a counter formula in the fake PH of the subreport and convert the counter and the shared variable so that it reads page 1(counter) of 2(shared variable)
    You should also be able to suppress the extra pagenofms in the main report when pagenumber > totalpagecount

  • How to print logo in printout using classical report.

    Hello Friends,
    By using below code i am displaying logo in output using Classical report.
    What my problem is it is not displaying in print out.
    Please help. or else tell me how to print logo in classical report as well as output print out.
    DATA: docking TYPE REF TO cl_gui_docking_container,
          picture_control_1 TYPE REF TO cl_gui_picture,
          url(256) TYPE c ,
          query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
          html_table LIKE w3html OCCURS 1,
          return_code LIKE w3param-ret_code,
          content_type LIKE w3param-cont_type,
          content_length LIKE w3param-cont_len,
          pic_data LIKE w3mime OCCURS 0,
          pic_size TYPE i,
          repid LIKE sy-repid.
    repid = sy-repid.
    START-OF-SELECTION.
      CREATE OBJECT picture_control_1
        EXPORTING
          parent = docking.
      CHECK sy-subrc = 0.
      CALL METHOD picture_control_1->set_3d_border
        EXPORTING
          border = 5.
      CALL METHOD picture_control_1->set_display_mode
        EXPORTING
          display_mode = cl_gui_picture=>display_mode_stretch.
      CALL METHOD picture_control_1->set_position
        EXPORTING
          height = 100
          left   = 700
          top    = 1
          width  = 200.
      "Position
      IF url IS INITIAL.
        REFRESH query_table.
        query_table-name = '_OBJECT_ID'.
        " Logo Name
        query_table-value = 'ENJOYSAP_LOGO'.
        APPEND query_table.
        CALL FUNCTION 'WWW_GET_MIME_OBJECT'
          TABLES
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          CHANGING
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          EXCEPTIONS
            object_not_found    = 1
            parameter_not_found = 2
            OTHERS              = 3.
        CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          TABLES
            data     = pic_data
          CHANGING
            url      = url
          EXCEPTIONS
            OTHERS   = 1.
      ENDIF.
      CALL METHOD picture_control_1->load_picture_from_url
        EXPORTING
          url = url.
      WRITE : /'Classical Report Logo'.
    Regards,
    Phaneendra
    Edited by: phaneendra punukollu on Dec 31, 2009 11:38 AM
    Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 4:52 PM

    Hello Nidhi,
    Thanks for your sugessition.
    Actual we have data from IDOCS and it is maintained in Ztables
    and need to dispaly in report ( Service centre - Warranty data ).
    The report is completed. So again going to Script means waste of time for us.
    So Plz help me  if possible in Classical report.
    Regards,
    Phaneendra

  • How to Print Selection-Screen along with ALV Report output

    Hi,
    I have a requirement wherein i need to also print the Selection Screen of a report when I print the ALV report output.
    Basically i need to print the ALV output along with selection screen.
    Could you plz suggest me the way.
    Regards,
    Nitin

    Hi,
    My selection Screen is a very big one. It contains around 30 select-options.
    So is their any standard method in which you can choose whether you want to take the output printout with or without Selection screen.
    Regards,
    Nitin

  • How to print a logo in existing / seeded report?

    Explain in details about the steps involved in printing a logo in existing / seeded report
    Thanks in advance
    Madhan

    It is either :
    1. Use bitmap reports (in earlier version of apps), set the output to postscript or pdf
    2. Use XML Publisher

  • How to Print GIF image in XML RTF Report

    Hi All,
    I have one requirement like to print the GIF image in Oracle Report.
    The report is an XML Report.
    The image file stored in database, the table is fnd_attached_docs_form_vl.
    select distinct file_name from fnd_attached_docs_form_vl
    Front end Navigation ----->
    view -----> Attachments
    Now i need to get the image from there and print it report.
    Can you pls help me.
    Regards
    Venu

    Hi,
    I didn't tried that scenario as my report is not a Non-XML Report.
    And my report is XML Report.
    Regards
    Venu

  • How to do Role and Authorization check in report program

    Hi Friends,
    Please provide me your guidance on how to add or give coding to check role authorisation of a particular field, input from selection screen.
    My requirement is,
    If the Fund center filed in my select option parameter has been filled, then I have to check the role authoriszation(which was created already) in the At selection-screen event to check and give access to the user to run the process further.
    Say my Fund center is "SH'
    and my Role authorisation to be settled to all users 'ZMM_BXI'.
    How to implement in report program, Please advise.
    Thanks & Regards
    Babu.

    Sorry SDN,
    Posted in a wrong Forum page.
    Please excuse.

  • How to create 2 transaction codes for same report program with diff title

    Hi All -
      I have created report program and create 2 transaction codes with different short description. I want to display the Tcodes decriptions instead of program attributes title.
    Can anyone pls tell me how to do this?
    Thanks,
    Kannan

    Hi Kannan,
    define 2 titlebars t1 and t2 for the report. In report initialization,
    IF sy-tcode = 't1'
      SET TITLE t1.
    ELSE.
      SET TITLE t2.
    ENDIF.
    Regards,
    Clemens

Maybe you are looking for