How to modify total pages in smartforms?

Hi All,
In smartform Im printing ' page of total pages' as &SFSY-PAGE& of &SFSY-FORMPAGES(3CZ)&. All are working fine. Now at last I have to print one extra page without page no. So, If the total o/p pages are 16 ( including last page) I have to show i.e
1 of 15, 2 of 15 .... 15 of 15 , and in the last pages nothing. For this Im moving SFSY-FORMPAGES to one variable and substracting one from it, but its not working, its showing as 1 of 0, 2 of 1 ... 15 of 14..
so how to decrease the total page number. I think it generates in runtime and in my smartform all windows are in one PAGE.
So how to do this ? any Idea?

Hi,
I think we can try this. Issue new page after all pages. If page less than or equal to total pages, display that, else issue new page.
/: IF &SFSY-PAGE& LE &SFSY-FORMPAGES(3CZ)& .
' page of total pages' as &SFSY-PAGE& of &SFSY-FORMPAGES(3CZ)&
/: ELSE.
/: NEW-PAGE.
/: ENDIF.

Similar Messages

  • How to get total pages from a Word Document?

    I want have created a program with ABAP, It'll print the cover page with form, the detail infomation is in a word document on a file server. I want to display the total pages in the cover page, how can I do? In another word, how to calculate the pages for a word document in sap ?

    I don't know how to use it. My test codes:
    REPORT print_via_ole_example .
    INCLUDE ole2incl .
    DATA: gs_word TYPE ole2_object ,
    gs_documents TYPE ole2_object ,
    gs_newdoc TYPE ole2_object ,
    gs_actdoc TYPE ole2_object ,
    gs_application type ole2_object,
    gs_document type ole2_object ,
    gs_docproperty type ole2_object,
    p_pages type p .
    START-OF-SELECTION .
    CREATE OBJECT gs_word 'WORD.APPLICATION'.
    SET PROPERTY OF gs_word 'Visible' = '0' .
    CALL METHOD OF gs_word 'Documents' = gs_documents.
    CALL METHOD OF gs_documents 'Open'
    EXPORTING #1 = 'd:\test.doc' .
    CALL METHOD OF gs_word 'ActiveDocument' = gs_actdoc .
    get property of gs_actdoc 'Application' = gs_application .
    get property of gs_actdoc 'BuiltinDocumentProperties' = gs_docproperty .
    get property of gs_docproperty 'wdPropertyPages' = p_pages.
    CALL METHOD OF gs_actdoc 'PrintOut' .
    CALL METHOD OF gs_documents  'CLOSE' .
    CALL METHOD OF gs_word 'Quit' .
    new-line.
    END-OF-SELECTION.
    FREE: gs_word, gs_actdoc, gs_documents, gs_newdoc .
    When run it, I can not get the total pages, and winword.exe hung up, can only be terminated in Task Manager.
    Could you help me to modify this test code?
    Thank you .

  • How to show total pages in a report

    Hi Experts,
    I have to show the pages in the formart current page/ Total pages. I am not able to claculate the total pages. Please help me and give the code.
    Thanks a lot.
    Krishan

    The code below shows how to display the total number of pages in a report like "Page 1 of 8."  However, it doesn't work if you execute the program as a background jobs.
    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 ', '-----'.
    Refer : http://www.sap-basis-abap.com/sapab007.htm

  • How to Print two pages in smartforms

    Hi All,
    How to create two different pages in smartforms.In my requirement the first page contains Table data in main window and in second page only the hard coded desription should be printed containg instructions,but the second page is mandatory after first
    page is completed,the first page may have n number of pages after printing those pages my second page should trigger.Help me if any one knows.
    Thanks in advance............
    Regards,
    Satya.

    hi ,
    once a main window size is declared , then that space will be placed in each page created.
    eg. if a table with header and footer is created, first of all the space for header and footer are allocated and body page is allocated.
    so we cannot dynamically change the size of the main window , even it is a copied main window.
    Otherwise another option is to continue the main window into the second page.
    for that first page main window -> create table -> add page break command to page 2 -> hard code description in template.
    page attribute for first page --> GOTO assign same page ( for continuing the same page)
    Page attribute for second page --> no need default is enough

  • How to call specific page of smartforms

    i have smartform in which 5 different pages are there
    i want to call PAGE1 when my sy-tcode eq tc1
    and PAGE2 when sy-tcode eq tc2 like wise...
    how to pass the page name in function module of smartforms???

    HI,
    try this...
    case sy-tcode.
    when ' '.
    Populate the TDPAGESLCT of structure SSFCOMPOP include SSFSPOUTOP of OUTPUT_OPTIONS in form interface of the smartform.
    endcase.
    call the smartform functionmodule
    regards
    padma

  • How to get total page count (in footer) for just a section?

    In Pages 08, I was able to put a total page count (for only a section) in the footer. However, when I tried doing the same thing in Pages 09, it keeps giving me a total page count for the entire document. I used the same settings for Pages 08 and 09, but 09 keeps giving me the total page count for the entire document. Does anyone know how I can make it work like it did in Pages 08? This is really annoying and preventing me from buying iWork 09 as I need this feature to work. Thanks in advance!

    As far as I know, the Pages '08 behavior was a bug.
    The Pages '09 Help states:
    Here are ways to work with information about a document:
    To add or change descriptive information about a document (author, title, comments, and keywords), click Inspector in the toolbar, click the Document button, and then click Info. Enter or change information in the fields in the pane.
    This information is searchable using Spotlight on computers with Mac OS X version 10.4 and later.
    _To display document statistics, such as number of words, pages, lines, paragraphs, sections, graphics, and characters in the document_, click Inspector in the toolbar, click the Document button, and then click Info.
    _A document’s word and page count_ are always visible at the bottom left of the window. To hide your document’s word count, choose Pages > Preferences, and then deselect “Show word count at window bottom.”
    If a range of text is selected, you can specify the extent of the displayed statistics by choosing Selection or Document from the Range pop-up menu in the Document inspector.
    This time it's clear that except if you select a chunk of text, word count and page count are global document 's properties.
    Yvan KOENIG (from FRANCE lundi 2 février 2009 11:48:56)

  • How to print specific page in smartform !

    Hello Friends,
                  I like to print specific page in smartform. for Ex. page 4. But when I give page no. 4, the print preview not showing the exact page.
    Thank you for your time.
    Senthil

    Hi Senthil,
    chk this link you get a brief idea abt Smartforms.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    Reward points if you find this helpful
    Regards,
    Harini

  • How to print total stock in smartform by material wise

    Dear Experts,
    I am trying to print total material stock which is issued and receipt during entered date in a smartform ,Here  I want to print totatl stock issued n receipt by material wise in seperate line .For that I fetch alldata and put into one internal table .In smartform I am using table for printing data.
    Edited by: BharatRathod on Mar 8, 2010 11:43 AM
    Edited by: BharatRathod on Mar 8, 2010 11:46 AM

    Hi,
    Try using the CALCULATIONS tab in the tables for printing the total stock in smartforms.
    Regards,
    Sharin.

  • How to Print next Page in smartform ?

    Hello ,
    I want to print next page in smartform.
    The situation is :-
    I am passing an internal table containing list of personal numbers.
    I have to print their details . Every candidate's detail should be printed on a new page .
    I have designed the whole form , but I am not print their details on a New Page.
    Please guide.
    Thanks in Advance.

    Hi, Nikita.
    Please Have a Look the following Link
    [MODERATOR MESSAGE: SapScript/Smartform questions go in FORM PRINTING forum|/thread/1360534 [original link is broken];
    So, Please Post Questions Regarding SapScript and Smartform in FORM PRINTING.
    1. First of all you need to set a Flag at the end of every Personal Number.
    2. Than Right Click on the object Like Main Window
    --> Create --> Flow Logic --> Command
    3. From First Tab of Command General Attributes Check the Check Box Go to New Page and Select Your Page
    4. In the Conditions Tab Give you Flag Condition.
    Hope will help you to solve out your problem,
    Please Reply if any Issue,
    Best Regards,
    Faisal

  • How to break a page in smartforms

    Hi all experts
    I want to break the page in smartforms i am using window in last cell of footer but it is giving me error message  "Page break is allowed  only in the main window"
    can any body tell me the solution ........
    thanx in advance

    hi!!!!
    The page to which you want to branch must exist. You can branch to a new page only as long as you are still displaying the contents of a main window.
    Choose Create -> Command in the context menu to create a command node in the main window of the page.
    On the General Attributes tab strips  Tick Go to new page.  Determine the new page using the list box next to the checkbox (it can be the same page if you want).
    The output of the main window will continues on the new page.
    reward if helful..

  • How to print last page in smartforms

    Hi,
    In my smartform i have 3 pages (FIRST, NEXT & LAST). FIRST contains some header detail and items. NEXT contains rest of items and this page would be repeatable if more item comes. now after NEXT i want to print LAST page. How to achieve this. PLease let me know. I looked into forum but haven't get exact answer so far.
    Rgds

    Hello,
    According to your scenario you are having 4 orders and each order has to print seperately with the last page .right?
    The best soln would be,
    1) create another internal table same as the one you have and delete adjacent duplicates using order, so you will have 2 internal table one with 4 orders (it-1)and other with all the items(it-2).
    2) In the driver program ,
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        control-no_open  = 'X'.
        control-no_close = 'X'.
        output-tdnewid  = 'X'.
       PERFORM ssf_open.
    CALL FUNCTION 'SSF_OPEN'
      EXPORTING
      ARCHIVE_PARAMETERS       =
      user_settings            = ' '
      MAIL_SENDER              =
      MAIL_RECIPIENT           =
      MAIL_APPL_OBJ            =
    output_options           = output
    control_parameters       = control
    IMPORTING
      JOB_OUTPUT_OPTIONS       =
    EXCEPTIONS
       formatting_error         = 1
       internal_error           = 2
       send_error               = 3
       user_canceled            = 4
       OTHERS                   = 5
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    LOOP AT it-1.
        CALL FUNCTION l_fm_name
    endloop.
    CALL FUNCTION 'SSF_CLOSE'.
    2) In the smartform 
         FIRST  ->   next page -> NEXT
                   Beneath the main window -> Table,  put Command - Goto new page  as LAST.
         NEXT  ->   next page -> NEXT
         LAST  ->   Next page -> Blank
    I hope this will work as I have done a similiar dev.
    Regards,
    Radhakrishnan

  • How to call second page in Smartform without calling first page

    Hi Gurus,
    I have two pages in one smartform. I am using this for PWB purpose. PLease tell me how I first or second page will be triggered depending on the conditional flag that has been defined in global variables.
    For first page it is working...but I don't know how to call the second page bypassing the first page on condition basis.
    Thanks in Advance
    Gautam

    Hi,
    The smartform will always start with the first page in the structure by default.  However when you call the smartform you can specify which page to start with in the structure CONTROL_PARAMETERS field STARTPAGE, this does mean you have to change you print program to include the logic, not the form.
    Regards,
    Nick

  • Leading zero's while printing total pages in Smartforms

    Hi All,
    I have a requirement where i need to print leading zero's when printing the total number of pages in a smartform.
    I have used  Page &sfsy-page& of &sfsy-formpages(Z3.0)&
    But for the above we get the output as Page 1 of 2, Page 2 of 2. and so on...
    But my requirement is it shoud come as Page 1 of 002, Page 2 of 002.
    The total number of pages will always be less than 999. and we need total of 3 numbers displayed.
    Ex: Page 1 of 002 or Page 1 of 010 or Page 1 of 100...
    Thanks,
    Hari Prasad.

    Hi Sudha,
    We have tried that too and we get the output as Page 1 of 001. Page 2 of 002.
    inside the node sfsy-formpages gives the current page number.
    Thanks,
    Hari Prasad.

  • How to modify login page

    Hello,
    I am using Oracle Applications 11.5.10 and I need to modify the login page by adding a custom message.
    How can I do that?
    I have also tried to personalize the FND_SSO_SARBANES OXLEYTEXT, but my message is too long and if I put it there the message don't wrap in multiple lines (is it possibile to wrap this message?).
    Thanks in advance.
    Bye
    Raffaella

    there is a profile option FND_SSO_LOGIN_MASK that u can use. U can set this value:
    Bitmap values for optional Login Page attributes
    To show these attributes, just add the numeric values of all desired
    attributes. So, for example to show PASSWORD_HINT and FORGOT_PASSWORD_URL
    set the profile option, FND_SSO_LOGIN_MASK to 18 (2 + 16)
    Converting decimal 512 to hexadecimal
    512 / 16 = 32, 0 (remainder in hex)
    32 / 16 = 2, 0
    2 / 16 = 0, 2
    So decimal 512 is 0X200 in hexadecimal
    128 = 0X80, 256 = 0X100
    final int USERNAME_HINT = 0x01; // 1
    final int PASSWORD_HINT = 0x02; // 2
    final int CANCEL_BUTTON = 0x04; // 4
    final int FORGOT_PASSWORD_URL = 0x08; // 08
    final int REGISTER_URL = 0x10; // 16
    final int LANGUAGE_IMAGES = 0x20; // 32
    final int SARBANES_OXLEY_TEXT = 0x40; // 64
    Also u can use the Framework to change some picture
    Mike

  • How to use new page in smartforms

    hello friends,
                       i am using a smartform in which i have created a new page(page 2) ,in my page1 i have made next page as page2 ,but in page2 i cant make next page as page2 bocz page2 does not have main window,so in page2 i have made next page as page1 only.
    im not gettin any errors,but only page1 is been displayed,no page2 is displayed,can any1 pls tell me how to use an additional page in a smartform

    hi Siddhesh,
    there is simple method to do so.
    1. Your first page say 'PAGE_1' 'with main window is ready. This page points  
        to say 'PAGE_2' as next page. till here its ok.
    2. Now on second page i.e 'PAGE_2'  do the following.
            a. Copy main windown from 'PAGE_1' ( select node 'PAGE_1 -> right click -
                 -->copy ')
            b. Paste the same main window in 'PAGE_2' ( select node 'PAGE_2' -> right
                click -> paste).
            c. Set next page for 'PAGE_2' as 'PAGE_2'. (SAP will allow this)..
    Thats it u r done.... save activate and test... now your main window on page 1 is filled .. it will display content on page 2 and then on page 3 which is of type page 2...because for page 2 we have set next page as page 2..
    Hope this helps you..
    Let us know if u have any problem...
    Enjoy SAP.
    Pankaj Singh.

Maybe you are looking for