Number pages in sapscript layout

Hi experts,
What type of variables normally used in sap script to output data? 
How do you number pages in sapscript layout outputs? 
Thanks and Regards,
Logu.

Hi,
·     &SAPSCRIPT-FORMPAGES&:
This field contains a number representing the total number of pages of the currently formatted form (any output between START_FORM and END_FORM). The page counter mode (START, INC, HOLD) of the individual pages is ignored. You can use this symbol to formulate information like
‘Page x of y’ for your output.
·&SAPSCRIPT-JOBPAGES&:
This field contains a number representing the total number of pages of all forms contained in the currently formatted print request, in other words, of all forms created using the OPEN_FORM, START_FORM.. ENDFORM, START_FORM.. END_FORM,..., CLOSE_FORM function modules.
&PAGES& current page.
Thanks,
Arunprasad.P
Reward if useful.

Similar Messages

  • 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.

  • SAPscript layout -Repeating Main window in same page

    Hi,
    I have a requirement in sapscript layout to duplicate content within a page in two sections, of which the content can span across multiple pages.
    Can anyone give an idea how this can be achieved.
    This particular layout has 3 sections:
    1st window (Top window): invoice Details (multiple items)
    2nd window (Middle window): Check Details single item
    3rd window (Bottom window): invoice Details (multiple items) {same content of the 1st window}
    The invoice details can span across multiple pages.
    Main window alone works perfect with the requirement.
    I have attempted with a copy of a Main window for the 3rd window, and as it's specified it can only continue from the 1st main Window and i couldn't find a way to control it's value passing from the calling program.
    I have also tried using a dynamic window for the 3rd window, but haven't worked  to get the desired values shown across multiple pages. When it cross to a new page it repeats its last value across all pages.
    Please help me with this. Thanks in Advance.
    Regards,
    Viraj.

    The Standard layout only prints the invoice details once.
    If your existing layout prints invoice repeated, which means that already a customization is in place which repeats the invoice breakdown.
    If the items are being repeated in the main window, it could be that the repetition customization is done on the calling program, then a solution could be to remove/comment that call  in the calling program by searching text element name.
    If the items are being repeated from a non-main window, then a solution could be to remove/comment the entire element in the non-main window.
    hope this helps
    Best Regards,
    Viraj.

  • How to print a empty page in a Layout

    Hi experts,
    i have a small requirement in forms. In my sapscript form i have 2 pages. its displaying properly the invoice layout.
    But the new requirement is the user want to print a empty page as 1st page and remaining as per now current setting.
    How to print a empty first page in a layout using sapscript?
    Anyone help this issue?
    Mohaha

    Hi Mohana,
                    Create one new page and one window of almost page size with no contents.  Move that window to this page.  Keep this page as first page and give earlier first page as next page to this newly created page.
                    Hope this should solve the problem.
    Regards
    Sravan

  • Multiple pages in SAPScript

    Hi Everyone!
    In my SapScript layout set I have:
    - two pages, FIRST and SECOND.
    - five windows, CUSTADDR(var), HEADER(var), MAIN(main), CUSTOM2(var), OUR_ADDR(var)
    - two paragraphs, DF and IT
    in page FIRST I have:
    -- CUSTADDR, HEADER, MAIN, OUR_ADDR
    in page SECOND I have:
    -- CUSTADDR, HEADER, CUSTOM2, OUR_ADDR
    CUSTOM2 and MAIN have the same size and the same position, but MAIN is in the FIRST and CUSTOM2 is in the SECOND page.
    In CUSTOM2 TEXT I wrote:
    * Display something
    * in this window
    However, when I call my driver program it displays me 2 PAGES: the first page is OK, the second page has only CUSTADDR, HEADER and OUR_ADDR it isnt displaying the TEXT of CUSTOM2, why?
    Thank you in advance,
    Regards,
    Denis M

    Hi,
    First go in se71-> settings-> form painter..-> uncheck the grpahical form painter.
    then come back to the screen of se71.
    In that press the PAGES button on the top and select the second page2.
    then press the PAGE WINDOWS button on the top and it will take u to the page2 windows screen in that just select the header window nd in STANDARD ATTRIBUTES
    WINDOW  ur header window name.
    WINDOW TYPE  change from VAR to CONST
    than it 'll wrk.
    Thanks,
    Arunprasad.P
    Reward if useful.

  • Sapscript - layout form

    Hi,
    Can you explain about the sapscript layout, with example?
    Thanks in advance.

    Hi,
    Create the SapScript Layout using Tcode:SE71,then create a page called 'PAGE1', create a Paragraph called 'AS' and use the below code in the Text Element of the Main Window. Then the values will be displayed in the SapScript when you try to execute its Print Program supplied in the other post.
    Example Code:
    /E   MAIN    
    AS   &NAME&  
    Apart from this, TNAPR is the table which contains the details of the print program and form.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • How to convert PO sapscript layout to pdf - need VERY URGENT Help

    Dear All,
    Requirement: PO sapscript layout after some modifications (say, ZMEDRUCK) has to be converted to pdf. Through me9f user will be able to give ranges of PO numbers and can view the print preview for the po. After that on clicking the print button we get the printout of the pos one after another based on the user input of PO numbers.
    Our requirement is that when the user will click on the "Print Preview" of po (rather than pressing the print button) it i.e. PO sapscript layout has to get converted to pdf.
    If you have already encountered this scenario, could you please send me the source code regarding this at the earliest. If you want to email it to my personal id, please let me know so that I can give it to you. Thank you.
    It will be very beneficial for mine if you can send me some source code in this regard. (FYI. We want only “Print output” of PO sapscript. So, Print Program /SMB40/FM06P [after copying it to our ZSMB40/FM06P program] need to be modified for downloading the PO into PDF where there is no FMs like OPEN_FORM, WRITE_FORM, CLOSE_FORM. So already available source code in SAP forums can not help me.)). Kindly help me at the earliest. It’s VERY URGENT…
    Thank you.
    Thanks & Regards
    Sudipta

    Hi Chaith,
    Could you please provide me the source code regarding this at the earliest.
    We want only “Print output” of PO sapscript. So we need to modify only the Print Program SAPFM06P after copying it to ZSAPFM06P for downloading of modified PO (ZMEDRUCK) sapscript layout into PDF.
    I am already having some source code from sdn portral. I am attaching it herewith. But it's not working as some constants and variable values need to be given. We want to take download of PO into PDF from ME9F transaction itself.
    Could you please provide necessary values in the missing constants and variables and kindly resend the corrected modified Source code to me so that I can run the same code to  download the modified PO ZMEDRUCK into PDF . Need YOUR URGENT HELP...
    DATA: l_druvo LIKE t166k-druvo,
            l_nast  LIKE nast,
            aux_nast LIKE nast,
            l_from_memory,
            l_doc   TYPE meein_purchase_doc_print,
            ent_screen TYPE c,
            ent_retco TYPE i,
            toa_dara TYPE toa_dara,
            arc_params LIKE arc_params,
            aux_form LIKE tnapr-fonam.
      DATA: otf LIKE itcoo OCCURS 0 WITH HEADER LINE,
            lt_docs      TYPE TABLE OF docs,
            pdf_bytecount TYPE i,
            nom_archivo TYPE string.
      aux_form = 'ZMEDRUCK'.
      l_from_memory = c_true.
      SELECT *
        FROM nast
        INTO aux_nast
        UP TO 1 ROWS
        WHERE kappl = c_po     " Purchase Order
        AND   objky = t_datos-ebeln
        AND   aktiv = space
        ORDER BY erdat DESCENDING eruhr DESCENDING.
      ENDSELECT.
      aux_nast-sort1 = c_swp.
      CLEAR ent_screen.
      CLEAR ent_retco.
      IF aux_nast-aende EQ space.
        l_druvo = c_1.
      ELSE.
        l_druvo = c_2.
      ENDIF.
    l_druvo = '2'.
      CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'
        EXPORTING
          ix_nast        = aux_nast
          ix_screen      = ent_screen
        IMPORTING
          ex_retco       = ent_retco
          ex_nast        = l_nast
          doc            = l_doc
        CHANGING
          cx_druvo       = l_druvo
          cx_from_memory = l_from_memory.
      CHECK ent_retco EQ 0.
      CALL FUNCTION 'ECP_PRINT_PO'
        EXPORTING
          ix_nast        = l_nast
          ix_druvo       = l_druvo
          doc            = l_doc
          ix_screen      = ent_screen
          ix_from_memory = l_from_memory
          ix_toa_dara    = toa_dara
          ix_arc_params  = arc_params
          ix_fonam       = aux_form                            
        IMPORTING
          ex_retco       = ent_retco.
      CLEAR otf.
      CALL FUNCTION 'READ_OTF_FROM_MEMORY'
        EXPORTING
          memory_key   = l_nast-objky  " PO Number
        TABLES
          otf          = otf
        EXCEPTIONS
          memory_empty = 1
          OTHERS       = 2.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize           = pdf_bytecount
        TABLES
          otf                    = otf
          doctab_archive         = lt_docs
          lines                  = pdfout
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
      CONCATENATE c_dest t_datos-ebeln c_ext INTO nom_archivo.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize = pdf_bytecount
          filename     = nom_archivo
          filetype     = c_bin
        IMPORTING
          filelength   = pdf_bytecount
        TABLES
          data_tab     = pdfout.

  • How to print the text in only last but one page in sapscripts

    hiiiiiiiiiii,
             explian how to print the text in only last but one page in sapscripts? wher to write the code? plz if possible explain in detail with an example?

    Hello,
    The total no pages is given by &SAPSCRIPT-FORMPAGES& command.
    So u can handle the situation in ur form like this
    /: if &PAGE&  = &SAPSCRIPT-FORMPAGES&
    p1 TEXT
    /: endif
    Try in this way it may help u.
    Regards

  • 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

  • System Extract - Incrementing a sequence number in detail record layout

    I have a system extract for a bank that requires a file header, batch header, detail, batch trailer and file trailer record. The detail record is at the run result level as I am looking to choose all records for a particular deduction (savings bonds) and I also have to put employee ssn and full name. This is working fine. I also have to put a sequence number, ie. detail record layout is record type, length 2, string, record sequence number, 5, ?????, employee SSN, length 9, field, employee full name, length 9, field. I need to increment the record sequence number by one for each detail record in the file. Ie. detail record 1 has record sequence number of 00001, detail record 2 has record sequence number of 00002.
    What type of data element would I set up? For this particular field, I don't need to go against a database field, I only need to keep track of the previous record's sequence number so that I can keep incrementing by 1 until all detail records have been written. The batch trailer has a record count of the number of detail lines and that works fine because I've set that up as a type 'total' with a 'count' of the detail records. I also have in the batch trailer a sum of the pay values from each of the detail records and that works fine as subtrailers allow total data elements where detail records do not.

    You can use any of the below mentioned 2 options in the ctl (Control) file:
    1. SEQUENCE(1,1)
    2. "xxcust_autoinv_seq.nextval"
    where xxcust_autoinv_seq is a database sequence.
    Thanks,
    Angelica.

  • Page Index in the first page of sapscript print out

    Hi
    Can anyone tell me how will I create an Index with section and page numbers in the first page of the sapscript about various sections that I will create dynamically in various page numbers during sapscript processing.
    Thanks and Regards
    Panda

    Hi,
    if you want something like this Page 1 of 10 use this.
    Page &page& of &sapscript-formpages&
    Regards
    Amit
    Reward all helpful replies.

  • Page Tool and Layout Adjustments - for iPad

    Is there a good way to resize a document in InDesign CS5? I work at a print publication that needs to re-adjust the page specs to a size that is compatible with the iPad. I tried using the 'Page Tool and Layout Adjustments' but I find them not very good! Or I might not be using them proplerly? Can anyone please even point me to any free tutorials online?
    Thanks
    daver

    The new "liquid layout" adjustments are not intuitive and you DO need to see them demonstrated. Here are a couple of videos made by Anne-Marie Concepcion for Lynda.com which are available thru Adobe TV:
    http://tv.adobe.com/watch/learn-indesign-cs6/understanding-liquid-layout-rules/
    http://tv.adobe.com/watch/learn-indesign-cs6/using-basic-liquid-layout-rules-scale-recente r-and-based-on-master/
    I hope they help!

  • HOW CAN I DIRECTLY WRITE ON NEXT PAGE OF SAPSCRIPT

    HI,
    HOW CAN I DIRECTLY WRITE ON NEXT PAGE OF SAPSCRIPT.
    I want to  call certain fields on next page only is it possible?
    How?
    Regards
    mave

    Hi
    You can use -
    IF &PAGE& = 2. ENDIF.
    But this will work only when you sapscript triggers two pages. Multiple pages can be triggered by main window if the window is filled up. Otherwise you can define two pages statically in your script .
    Cheers.

  • Attachment of Word/PDF to Sapscript layout

    Hello everyone,
    Need some help regarding attachment of document in script.
    I know that we can convert the ouput of a SAPscript form to a PDF in a mail attachment or a spool.
    But what we require is attaching a word/pdf document to an existing SAPscript so we can print it at the end of the existing SAPscript layout as terms & conditions.
    Has anyone does this before? I know how to upload word documents in ole and in document management, but am unsure if its possible to add it to a layout. We can add bmp/tiff files, but pdf files??
    Please advise! Thank you in advance.
    Regards,
    Ketaki

    Hi Rich
    Great to hear that someone has already solved the challenge we are facing now.
    We have to print some PDF’s which are stored in iXOS archiving system and linked with archive link to a SD invoice.
    Is it possible you describe a bit more detailed your solution and if possible you send a copy of the coding to me.
    Thanks in advance.
    Walter Wohlgemuth

  • How to design rows and columns in sapscript layout

    Hi friends,
    Please let me know how to design rows and columns in sapscript layout with example?
    Thanks,
    Yogesh

    Hi friends,
    Please let me know how to design rows and columns in sapscript layout with example?
    Thanks,
    Yogesh

Maybe you are looking for

  • IPod recognised by windows, but not appearing in iTunes

    My sister recently bought an iPod nano so we have both been using the same computer, different user areas for our iTunes. However, there is some conflict between them somehow as now the iPod is not appearing in iTunes but is appearing as a hard drive

  • Pb PDF Filename : AcroPDF.dll + VB6

    We use the component AcroPDF.dll (Adobe Acrobat 7.0 Browser Control type library 1.0) in a VB6 program. We use the method LoadFile to display PDF file in form. This method works fine. The problem is after some LoadFile request, when we display the pr

  • Problem with asp:Button in PTWC 2.1 - onclick not rendering on second button

    I have a user control with two asp buttons in one TD tag (they both have ptrender=true on them). In the portal only the first button fires its event. The second button does not. I did a partial view source on the two buttons and I see this (button 1

  • What version of Java can be used in the scriptlet part of JSP 2.1?

    hi can anyone tell me What version of Java can be used in the scriptlet part of JSP 2.1? Does that depend on the app server we use? we are not sure whether we can use in Java 5 in JSP 2.0 itself?

  • Bug Bytes

    I've run into a problem. I just recently acquired a hand me down desk top. It's older but it works just fine and normally runs iTunes without an issue. Somehow this computer has contracted a virus that makes it so that no executable files can be run.