Display - Total number of pages in printing a report

Hi,
     I have to print the data of an internal table and in the header of the report i am displaying 'Pages.' : current page/ total no of pages. Can you tell me how to calcultae the total no of pages ? My report will run in background.
     I got this thing while searching but it is not working in background.
DATA L_PAGE_COUNT(5) TYPE C.
end-of-selection.
WRITE SY-PAGNO TO L_PAGE_COUNT LEFT-JUSTIFIED.
DO SY-PAGNO TIMES.
READ LINE 1 OF PAGE SY-INDEX.
REPLACE '-----' WITH L_PAGE_COUNT INTO SY-LISEL.
MODIFY CURRENT LINE.
ENDDO.
TOP-OF-PAGE.
WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.

report zgill_amit
line-size 80
line-count 65
no standard page heading.
data: imara type table of mara with header line.
selection-screen begin of block b1 with frame title text-001 .
parameters: p_check type c.
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform write_report.
top-of-page.
perform top_of_page.
FORM GET_DATA
form get_data.
select * into corresponding fields of table imara
from mara up to 300 rows.
endform.
FORM WRITE_REPORT
form write_report.
data: xpage(4) type c.
loop at imara.
write:/ imara-matnr.
endloop.
write sy-pagno to xpage left-justified.
do sy-pagno times.
read line 1 of page sy-index.
replace '****' with xpage into sy-lisel.
modify current line.
enddo.
endform.
Form top_of_page
form top_of_page.
write:/32 'Test Program',
at 62 'Page:', at 67 sy-pagno, 'of', '****'.
endform.
try this code
amit

Similar Messages

  • How can I get a report with total number of pages printed on my HP Officejet Pro 8610?

    Since knowing the number of pages I print is so critical to a choice of using the "HP Instant Ink Plan" or not, how can I find the total number of pages I have printed on my brand-new (installed 2 days ago) 8610?  And if I can, is it a "resettable" or rolling total?  Don't see anything in user guide and a search yields nothing usable on this blog.
    Printer is installed wirelessly on an older PC with Windows XP SP3.  I can also of course intstall it with network cable but so far it works OK on my home network without network cable.  If it matters which OS, I also have a Lenovo laptop running Vista on which I can install this printer. 
    Please do not respond that I can find the total by counting the number of pieces of paper I have.  Surely the internals of this fine machine must have the requested data so that HP can tell my usage if I select the monthly ink plan!
    This 8610 was a good buy (net $89.00 after trade-in of my six year old J36xx Deskjet) at Office Depot/Max which of course influenced my decision to buy it.  So far I am very happy with printing qualities and speed, have not tried the scanner yet and will probably never use the fax since I have no land line phone. 
    Thanks,
    Harry
    This question was solved.
    View Solution.

    Hi,
    Section #2 of the Printer Ststus report will tell you. Please try:
    Printer status report
    Use the printer status report to view current printer information and ink cartridge status. Also use the printer status report to help you troubleshoot problems with the printer.
    The printer status report also contains a log of recent events.
    If you need to call HP, it is often useful to print the printer status report before calling.
    To print the Printer Status Report
    1. From the printer control panel display, touch and slide your finger across the screen and then touch Setup.
    2. Touch Print Reports and then touch Printer Status Report.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to get the total number of pages printed in a report?

    Hi All,
    I have a requirement where I need to print a frame of fields only in the last page. Unfortunately I cannot use the 'Print Object On' property as it doesnt work in my case. So, I am planning to write a format trigger on the frame to return TRUE if the page is the last physical page. Now, I need to know how to get the total number of physical pages that will get printed in the report so that I can use this to manipulate the frame. I was planning to use the 'Total Physical Pages' built-in, but it seems like I can just use it to print in a field and I can't use this field's value anywhere in the plsql code (formula column function/format trigger) in the report. Is there anyway to get the total number of pages printed in the report which can be used in the report plsql code?
    Thanks,
    Srini.

    i found the solution, thanks

  • How do I print the total number of pages in report, like Page 1 of 5?

    Hi
    How do I print the total number of pages in report, like Page 1 of 5?
    thanks,
    kiran.M

    Hi,
    Check for the below code:
    *Declare a variable
    DATA L_PAGE_COUNT(5) TYPE C.
    *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 1 OF PAGE SY-INDEX.
    REPLACE '-----' WITH L_PAGE_COUNT INTO SY-LISEL.
    MODIFY CURRENT LINE.
    ENDDO.
    TOP-OF-PAGE.
    WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.
    You will find your solution in below thread with code:
    Total Pages in Basic List
    Rgds,
    Shakuntala

  • To find total number of pages in XML publisher

    1. Is there any method to find the total number of pages in BI or XML publisher.
    2. Is there any method to to repeat the column(Not rows) on every page.For eg you have table with two columns say "A" and "B" .I want to repeat this B in every page . And A should print only in first page.
    3. Is there any method to print a text say "ABC" only on first page footer based on condition.
    Thanks
    Wazid

    Exactly what my requirement is- In my template i have set header and footer page setup as "different first page'" and also printing the user text at the bottom of the last page using <?start@last-page-first:body?> <?end body?>.When i run the template, for multiple pages output user text is displaying at the bottom of the last page that is working fine but for single page output user text is not displaying at the bottom of the page because of the ""different first page'" header and footer.If you have any idea please suggest.

  • Total number of pages in Normal Report

    How to display the total number of pages in normal report.
    To display current page number I am using sy-pagno.
    Is there any system variable to display Total numbetr of pages in normal report.
    Thanks in advance.

    Hi,
    There is no system variable to find total no of pages but you can use the following to get that one.
    Declare a variable
    DATA L_PAGE_COUNT(5) TYPE C.
    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 1 OF PAGE SY-INDEX.
            REPLACE '-----' WITH L_PAGE_COUNT INTO SY-LISEL.
            MODIFY CURRENT LINE.
        ENDDO.
    TOP-OF-PAGE.
        WRITE: /(70) 'Heading' CENTERED, 70 SY-PAGNO,'of ', '-----'.
    *--- End of Program
    Thayalan

  • How to exclude last page from the total number of pages counter

    Hi,
    I am customizing the payables remittance RTF template, our requirement is to reset page number to 1 for each payment, i am able to achieve this using "@section"
    also we have a requirement to have a summary page at the end, i am able to get this using "start@last-page:body".
    issue is last page is also considered in the page counter of the last payment.
    i.e. suppose if i am generating remittance for 2 payments which are printing details in two pages and one page respectively, my output will have total 4 pages and it's showing
    Payment1 page-1 footer -> 1 of 2
    Payment1 page-2 footer -> 2 of 3
    Payment2 page-3 footer -> 1 of 2
    Summary page-4 footer -> 2 of 2
    but i wanted to see
    Payment1 page-1 footer -> 1 of 2
    Payment1 page-2 footer -> 2 of 3
    Payment2 page-3 footer -> 1 of 1
    Summary page-4 footer -> 1 of 1
    Any idea how to remove the summary page from the page counter.
    Rgds,
    -Kamal

    I'm not sure how it was in Acrobat 9, but in XI you add a Header/Footer and
    one of the options it "Page Number and Date Format", where you can select
    the format of the page number to add, some of them contain the total number
    of pages (such as "1 of n").

  • Problem in displaying total no of pages in Smartform

    Hello experts,
    I have a problem while displaying total no of pages in Smartform.
    When no of pages are more than 10 then in total no of pages , a * is shown till current page is 9, then after it is displaying correct no of pages.
    I am using &sfsy-formpages& to get total no of pages.
    Ex: Like if I have 12 pages to print then i am getting 1/, 2/, 3/* .......... 9/* then 10/12 , 11/12, 12/12.
    Do i have to write some code for that ?? Please give your inputs to get the total no of pages.
    Thanks !

    Hi,
    Try this.
    Page &SFSY-PAGE& of &SFSY-FORMPAGES(4ZC)&
    Thanks,
    Anitha A

  • System symbol for total number of pages in SAP Script

    Hello All,
    I need to display the total number of pages in a SAP Script. Say there are 4 pages and I want to display "Page 1 of 4" at the footer of first page.
    Is there any system symbol to get the total number of pages in SAP Script?
    Many thanks in advance for your help.
    Regards
    Indrajit Chakraborti

    Hi,
    In the Footer window, use this fields
    &Page& of &SAPSCRIPT-FORMPAGES&
    &PAGE& --> Current page No
    &SAPSCRIPT-FORMPAGES& --> Total No of pages Regards
    Regards
    Sudheer
    Message was edited by:
            Sudheer Junnuthula

  • Can I get total number of page in 'After Report' Trigger?

    Currently, I use the format trigger of a field in Margin. In the trigger, I use srw.get_page_num(page_num) to get the current page number and call a package procedure to update a record. For example, if the report has 10 pages, it will update 10 times. However, could anyone know can I use another method instead? (Get the total number of page in one, then no need to update it every page) Thank you.
    (using Report 2.5)

    Thanks. I know I can choose &TotalPhysicalPages in a field for displaying. But the problem is I need to update DB for that number. So I cannot refer that value of field to run a procedure in package for update the total page number in a record. Actually, this function is already done for years. (as I mentioned in my previous message) But I would like to know can I use another method to update it in one time instead. Thank you.

  • Total number of pages before generating the PDF - OMR

    Dear all,
    We are facing the following problem. We want to apply OMR (optical mark recognition) barcoding on a batch of invoices.
    Basically there are two steps in the proces:
    - Fetch the batch of invoices created during the day, let's say 1000 invoices.
    - Calculate for this batch of invoices the total number of pages per customer. 1 customer can have multiple invoices per day.
    - If the number of pages per customer > 12, remove the invoices from the total batch (1000 invoices become then 800 for example).
    - Apply OMR logic on the remaining 800.
    My question is regarding step 2. The calculation of the total number of pages per customer. Is it possible to get the total number of pages before generating the PDF? Or do we have to 'simulate' the PDF to get to this number?
    Another question I have, does anybody have experience implementing OMR using adobe forms? Any experience to share?
    Thanks for your feedback
    Simon

    Hi Philippe,
    we can only determine the page size when its already loaded with data and its published/sent by ADS.
    i.e., the no of pages increases based on the data you feed to the form which mean by the time the form/script determines the number of pages it has published dynamically data is already there. so your requirement cannot be solved in that approach.
    the next approach which I can think of is as follows.
    lets say you display the invoices data as a table in the form.
    so then lets specify the row height to .5" which mean in a form with content area size of 15" we can display 30 records.
    so in the interface or the source program count the number of records per customer if they are < (12pages X 30 records = 360) leave them as they are else remove them for the list and process the data for other customers.
    As per your other query of having OMR on the form I have no Idea, I never worked on that but if its just any other type of barcode that shouldn't have any problem.
    Hope this helps you,
    Cheers,
    Sai

  • Total Number of Pages with page exception

    Hi all,
    Currently a have a form that requires a page number to start on the second page. I've done this via DAL script
    #PCOUNT +=1;
    return(#PCOUNT);
    The problem now lies in the total number of pages. Is there a way for me to get the total number of pages on my form without taking the first page into consideration? Thanks!

    Haven't tried this but I think you could use the @ function to retrieve the Form Page Num Of field value.
    Copied this from the DAL help:
    You are here: Function Reference > Alphabetical Listing > Other > @
    Use this function to return the current value contained in a section field. The @ function is also called the get field function. The @ symbol is used because it is easy to recognize in script statements and it reduces the amount of typing required.
    You can use this function to get text values from the special page numbering fields, FORMSET PAGE NUM, FORMSET PAGE NUM OF, FORM PAGE NUM, and FORM PAGE NUM OF.
    Note
    Although you can also set these page numbering fields, these fields are maintained by the system and the value you set them to will be overwritten.
    You can also use this function to get page number field values within scripts that execute during the batch printing process. You can use this, for instance, during the Banner processing with the GenPrint program to check the page number fields on certain pages.
    Keep in mind that during GenData processing, page numbering is not usually done unless you are also doing single-step printing. Even then, page numbering does not occur until the print process begins.
    Syntax
    @(Field, Section, Form, Group)
    Parameter
    Description
    Field
    Enter the name of a section field. The default is the current field.
    Section
    Enter the name of a section that contains the field named. The default is the current section.
    Form
    Enter the name of a form that contains the section and/or field named. The default is the current form.
    Group
    Enter the name of the form group that contains the form, section, or field. The default is the current group.
    The system uses the parameters you provide to search for one field on a section and return that field’s data. If the field is defined as a numeric data type, the system returns a number. Otherwise, the result is a string of text.
    Note
    If you omit the Field parameter, make sure you include quotation marks, as shown in the second and third example below.
    Example
    For these examples, assume the current field value is 1234.23 and is named MyField. Also, assume that a second occurrence of MyField appears on the form, MyForm, and contains the value automobile.
    For the third example, assume the current form is the third page of the form set being processed. For the fourth example, assume the section Header3 is on the second page of the form ABC.
    Function
    Result
    Explanation
    Return(@( ))
    1234.23
    Returns the value in the current field.
    Return(@("MyField"))
    1234.23
    Returns the value in the named field, located on the current section.
    Return ( @("Formset Page Num") )
    3
    Returns the value in the field named "Formset Page Num" on the current section.
    Return ( @(Form Page Num"), "Header3","ABC") )
    2
    Returns the value in the field named "Form Page Num" in section, "Header3" on form "ABC".

  • How to count Total Number of Pages in SAPSCRIPT

    Hi,
    Iam unable to print total number of pages in the First Page of SAPSCRIPT.Iam writing the Logic in the Varibale window.
    Please kindly help me.
    In First Page , The preview is
    Page 1 of 1-
    In Second Page , Teh Preview is
    Page 2 of 2
    The Logic is ....
    1. Variable window of Script
    PERFORM CHECK_PAGE IN PROGRAM ZZZF_SAPSCRIPT_EXITS
    USING &SAPSCRIPT-FORMPAGES&
    CHANGING &WS_PAGE&
    ENDPERFORM
    Page &PAGE(C)& of &WS_PAGE&
    2. Program
    FORM check_page TABLES p_pagein STRUCTURE itcsy
                            p_pageout STRUCTURE itcsy.
      DATA : p_i TYPE sypagno.
       READ TABLE p_pagein INDEX 1.
       IF sy-subrc = 0 .
         p_i = p_pagein-value.
         p_i = p_i - 1 .
    READ TABLE p_pageout INDEX 1.
    CLEAR p_pageout-value.
    *p_pageout-value = p_i+0(3).
    WRITE P_I TO p_pageout-value.
    condense p_pageout-value no-gaps.
         MODIFY p_pageout INDEX sy-tabix.
       ENDIF.
    ENDFORM. "check_page
    Please help me ASAP.
    Regards,
    Deepthi.

    Try this
    'On The Form'
    IF &NEXTPAGE& EQ 0
    DEFINE &DECRE& := '2'
    PERFORM SET_TEXT_SYMBOL IN PROGRAM YSS20200
    USING &SAPSCRIPT-FORMPAGES&
    USING &DECRE&
    ENDPERFORM
    ENDIF
    'In The Program'
    DATA : BEGIN OF script_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA END OF script_table.
    Used to modify total pages so they print correctly
    FORM set_text_symbol TABLES input_table LIKE script_table[]
    output_table LIKE script_table[].
    DATA: pageno TYPE i,
    intCnt type i,
    chrPg(2) type c.
    READ TABLE input_table INDEX 1.
    MOVE input_table-VALUE TO pageno.
    READ TABLE input_table INDEX 2.
    MOVE input_table-VALUE TO intCnt.
    subtract intcnt from pageno.
    write pageno to chrpg.
    CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
    EXPORTING
    NAME = 'FORMPAGES'
    VALUE = chrpg
    VALUE_LENGTH = 0
    REPLACE_SYMBOLS = ' '
    ENDFORM.

  • Getting total number of pages

    Hello friends at www.oracle.com ,
    I need to know what's the Reports variable that gets the total number of pages, and how I can refer it in a PL/SQL block.
    I know there's an SRW function to get the actual page number (SRW.GET_PAGE_NUM), but I need to know if there's a function, or system variable, that gets the total number of pages that will be printed during Reports execution.
    Thanks,
    Franklin Gongalves Jr.
    [email protected]

    I am not sure of any variable to use in PL/SQL but instead u can use a field by urself
    like serial_number using summary column in ur report
    which u can check the value similar to total pages
    If u need help let me know
    Sri
    Hello friends at www.oracle.com ,
    I need to know what's the Reports variable that gets the total number of pages, and how I can refer it in a PL/SQL block.
    I know there's an SRW function to get the actual page number (SRW.GET_PAGE_NUM), but I need to know if there's a function, or system variable, that gets the total number of pages that will be printed during Reports execution.
    Thanks,
    Franklin Gongalves Jr.
    [email protected]

  • How to get total number of pages from .doc file without using Office interop?

    Hi,
    Kindly help me in getting the total number of pages from a .doc file not .docx file using C#. I know how to get by using Office interop but I do not want to use Office interop.
    So, without office automation in C# let me know how to get the total number of pages from a .doc file.
    Regards,
    Ashok

    Hi Ashok,
    >> I know how to get by using Office interop but I do not want to use Office interop
    Could you tell us why you don't want to use Office interop?
    As far as I know, this is the easiest way to achieve.Hmmm,this is my answer
    http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagenumbers.startingnumber(v=office.14).aspx
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • SSRS 2008 Matrix grouping help

    Hi. I have a requirement to create an SSRS report with a tablix or matrix which looks like the image below. My dataset will hold the following column values: Project name, overall rag, cost rag, scope rag, headline and commentary. The RAG values are

  • Redeployment/Server shutdown indicator?

    hi there, would like to ask if anyone know of any decent way that my MDB could tell whether an application re-deployment or server shutdown is going to take place? thanks. regards, gabchan

  • Deleting multiple test messages on ios 8

    I have run into a weird problem since I started using ios 8. I get a lot of text messages (mobile notifications from twitter feeds) and when I touch a message, I get the Copy/More option with the little trash can showing up in the bottom left corner.

  • Down payment document

    hi,    can u please tel me how to see the down payment document?

  • Get-logonstatistics reporting incorrect statistics

    interesting, i have confirmed a mailbox is on different database and server however when i run get-logonstatistics, it shows user is connected to different mailbox and server. any idea? SMF