Pringting a form as print page

Hi guys,
I am facing a problem and I am searching for it for long time, but no luck.
I am creating a simple iView with Input and output form, i have added a print button to print the OUTPUT form. But when i print the output form, it is printed with a grayscal  background.
How to print it with the regular white color which is the form background in the screen?

Hi,
i want to see the your screenshot of the Result.
And what SP you are working becuase it is equal to or lower than SP14 the print action not that much good in its functionality.
if you need to change the back ground use your own theme and try .
Regards,
Govindu

Similar Messages

  • In smart form while printing page no.

    in smartform iam printing the page no
    current page / no. of pages : sfsy-page / sfsy-formpages
    if the no. of pages are more than 9 it is printing as star ( * )
    if the total pages are  12
    ex : 1/ *    , 2 /* up to 9/* than 10 /12 ,  11/12 , 12/12

    Refer this link
    Re: Smart form to be printed 4 times
    You can also print out the page number as "x of y":
    &PAGE& / &SAPSCRIPT-FORMPAGES&
    Message was edited by:
            Judith Jessie Selvi

  • 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 do I get all pages of a multi-page PDF form to print in old versions of Reader?  Reader 11 prints all; Reader 10 skips first page

    I'm new to forms creation, so please excuse my ignorance. I've created a 9 page form in InDesign CS6 on Mac OS 10.6.8 and exported it as an interactive PDF. With Acrobat 10.1.10 I've checked that there is no security -- everything is allowed. None of the form fields is required.  I originally had some required fields but made them not required to see if my printing problem would go away.  I enabled the extension that allows versions of Reader before 11 to save data in the form. Page 1 has combo fields, radio buttons, a submit button, and text fields.  The rest of the form has radio buttons and text fields. Some of the people who've tried my form say they can print pages 2 through 9 but not page 1. One of them is known to be using Reader 10. I've tried printing my form with Reader 11 on Max OX 10.6.8 and Reader 11 on Windows 8.1 and seen no printing problems. What have I done wrong?  Is there something about the submit button on page 1 that makes older versions of Reader not willing to print that page?  There's nothing propriety or sensitive on the form so I'll leave it for a while in Dropbox in case someone is willing to inspect it.  It's at
    https://dl.dropboxusercontent.com/u/87784382/Savable_Local_Show_Report_2.pdf

    I've been able to find someone willing to do some testing that I can't do without installing old versions of Reader on my computer.  The surprising (to me) result is that the Submit button causes the problem.  By simply removing the Submit button, Reader 10 is now able to print page 1.  The Submit button was set up to do a "mailto".  I don't know whether other destinations also cause the problem of the page not printing with old versions of Reader.

  • Adobe Form - Print page at the end for every record of a Z table with Text

    Hello friends, I am facing a challenging here and I need to develop the following below. Mind you, I don't have much exposure/experience with Adobe Forms
    Scenario: Standard REAL ESTATE Contract Form
    I have a Z table containing RENTAL OBJECTS, in my case 3 records and I want, at the end of the form print one page like below to each record that i have in my Z table.
    "Dear Z-field1 one, regarding your contract for Z-field2, Address Z-field3, blah blah blah"
    In essence, print a page for each one of them at the end, with the text above using the fields from the z table.
    I searched the forum and couldn't find any thing like it.
    If someone can help it would be much appreciated.
    Thanks, Marco

    Hi Marco,
    You must be having the ztable fields in the context or in the data heirarchy of the adobe form.
    Assume that your main form is on the page1.
    Create a table bound to ztable with 3 rows in it and make it invisible on the form.
    Below the form create 3 pages page2, page3 and page4.
    Create a ISR text display and on the initialise event write the code such as:
    this.rawValue = data.page1.Table2.Row1.Cell1.rawValue;
    Create as many ISR texts as you want and initialize it using the above method.
    Page1
    form
    Page2
    Row1 values
    Page3
    Row2 Values
    Page4
    Row3 Values
    Hope this helps.

  • ESS Portal Trip/Expense form only prints the first page

    Good morning;
        Our users reported that when they display a trip/expense via Portal and then right mouse click in order to print the trip, only the first page prints out.  If they go to the SAP Gui and run the TRIP transaction and display the trip in Print Preview form and print it, they get all the pages of the trip/expense printed.
    Has anyone ever run into this strange issue before?
    Thanks.
    Scott.

    Thanks for the quick response.
    I'm assuming that you are refering to the IMG Path:
    Cross-Application Components->Homepage Framework->Resources
    ->Define Resources
    Select activity Define Resources (Change Entries)
    When I check this in the IMG, we do not have a resource called  EMPLOYEE_TRAVEL_TRIPFORM_SRV05.
    Currently we are on ECC 5.0 and note 525862 references Rel 4.6c so I know that those corrections are part of our system.  The 812903 note refers to ECC 6.0 only so this note I believe would not help us.
    Should I add the resource EMPLOYEE_TRAVEL_TRIPFORM_SRV05 to the Configuration?
    I see that note 1140369 references something about the EMPLOYEE_TRAVEL_TRIPFORM_SRV05 resource and has something to do with hight of the Trip form.
    Scott.

  • How to control the print pages in se71 form or smartforms

    Dear All:
             I have a issue for control the print pages in se71 form or smartforms.
    For example:my report used form or smartforms to print.it have 12  total pages.but user want to print the .3rd  page.3rd  page is customized.
             How can I do it?
    Thanks
    Sun

    Hi,
    By using command node, with some command we can handle this.

  • Get number of pages of adobe form before printing

    Dear Experts,
    I want to get number of pages adobe form will print before printing the form.
    Please suggest.

    Hello Sagar,
         Without executing the generated Function Module, it is not possible to get the page count of a form in driver program because the generated FM itself is responsible to execute the whole layout and determine the number of pages in the PDF output. The below screenshot shows the number of pages in the structure /1BCDWB/FORMOUTPUT of generated FM after the generated FM is executed successfully.
    I really don't know why you need the number of pages before calling the generated FM. But if you still need it, then you might need to call the whole FM cycle twice( FP_JOB_OPEN , Generated FM, and FP_JOB_CLOSE ).
    1) First time while calling the FM FP_JOB_OPEN, you need to modify the contents of SFPOUTPUTPARAMS structure. Send the blank values in fields GETPDF, REQNEW and REQIMM, and send the "X" in fields NOPREVIEW, NOPRINT and NOARCHIVE and 000 in field COPIES.
    The reason for doing this is, we do not want actual PDF output. We only want to determine the number of pages.
    2) Now execute the generated FM . You will get the number of pages in the structure /1BCDWB/FORMOUTPUT-PAGES as shown in screenshot above.
    3) Now call the FM FP_JOB_CLOSE as usual.
    4) Again call the FM FP_JOB_OPEN. This time you again need to modify the contents of SFPOUTPUTPARAMS structure reversely. Send the "X" in fields GETPDF, REQNEW and REQIMM, and send the blank values in fields NOPREVIEW, NOPRINT and NOARCHIVE and 001 in field COPIES.
    This time we need the actual PDF output.
    5) Now do the required processing with previously fetched number of pages before calling the generated FM.
    6) Now call the FM FP_JOB_CLOSE as usual.

  • Need to print form in DINA4 page format, but in form it is specified ANY

    Hi all.
    There a form which has ANY page format in its basic settings.
    But I need to print this form in DINA4 page format manually.
    When print the form I am getting a spool. Let me know whether I can change thus to DINA4 format and print the same in DINA4 format on printer?
    Please provide inputs.
    Thanks a lot.
    Bala

    Hi,
    You can change it but you have to check the windows whiche are defined in that page can fit in the Diana4 if it does not fit you have to adjust the windows size to fit into your required page format.
    Thanks,
    NN.

  • How to print Column Labels on each print page of an ALV report

    Hi,
    I have an ALV report which is of 10 print pages.
    I need to print Column Labels on each print page.
    How it is possible.
    Plz write the solution
    Narendra

    Hi Narendra
    try this code.
    reward pts if help.
    Deepanker.
    *& Report  ZDEMO_ALVGRID_EDIT                                          *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic ALV grid, Enhanced to display specific fields as          *
    *& editable depending on field value                                   *
    REPORT  ZDEMO_ALVGRID_EDIT                 .
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      field_style  TYPE lvc_t_styl, "FOR DISABLE
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER LINE,
          wa_fieldcat TYPE lvc_s_fcat,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
          gd_repid     LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM set_specific_field_attributes.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'EBELN'.
      wa_fieldcat-scrtext_m   = 'Purchase Order'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      wa_fieldcat-emphasize   = 'X'.
      wa_fieldcat-key         = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'EBELP'.
      wa_fieldcat-scrtext_m   = 'PO Item'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'STATU'.
      wa_fieldcat-scrtext_m   = 'Status'.
      wa_fieldcat-col_pos     = 2.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'AEDAT'.
      wa_fieldcat-scrtext_m   = 'Item change date'.
      wa_fieldcat-col_pos     = 3.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MATNR'.
      wa_fieldcat-scrtext_m   = 'Material Number'.
      wa_fieldcat-col_pos     = 4.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MENGE'.
      wa_fieldcat-scrtext_m   = 'PO quantity'.
      wa_fieldcat-col_pos     = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MEINS'.
      wa_fieldcat-scrtext_m   = 'Order Unit'.
      wa_fieldcat-col_pos     = 6.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'NETPR'.
      wa_fieldcat-scrtext_m   = 'Net Price'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'PEINH'.
      wa_fieldcat-scrtext_m   = 'Price Unit'.
      wa_fieldcat-col_pos     = 8.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
           EXPORTING
                i_callback_program      = gd_repid
               i_callback_user_command = 'USER_COMMAND'
                is_layout_lvc               = gd_layout
                it_fieldcat_lvc             = it_fieldcat
                i_save                  = 'X'
           TABLES
                t_outtab                = it_ekko
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO  CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  set_specific_field_attributes
          populate FIELD_STYLE table with specific field attributes
    form set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    Populate style variable (FIELD_STYLE) with style properties
    The NETPR field/column has been set to editable in the fieldcatalog...
    The following code sets it to be disabled(display only) if 'NETPR'
    is gt than 10.
      LOOP AT it_ekko INTO wa_ekko.
        IF wa_ekko-netpr GT 10.
          ls_stylerow-fieldname = 'NETPR' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                                 "set field to disabled
          APPEND ls_stylerow  TO wa_ekko-field_style.
          MODIFY it_ekko FROM wa_ekko.
        ENDIF.
      ENDLOOP.
    endform.                    " set_specific_field_attributes
    pls reward pts is help,

  • Can the footer repeat on every printed page?

    I need the footer (part of the master page) to repeat on every printed page of a topic.
    Our client prints topics for use in the field and the footer contains time/date code (that I found on the internet). This date/time info needs to be printed on all pages of each topic. Most of the topics are 2-3 pages in length when printed from the browser. Is it possible to program the footer to repeat? or add HTML code to the topics to do this?
    I'm using RH 9, generating the WebHelp Pro layout for my output. Using IE9 and FireFox9 browsers. I've added a toolbar print button that uses the toolbarscripts01.js script to print the topics. (The script works great and is a HUGE life saver, by the way!! Thanks Peter Grainge!)
    Thanks,
    Shelley

    Hi Shelley
    We've already established in a separate thread that WebHelp Pro is not what you should be creating as you aren't using RoboHelp Server. But that really hasn't got anything to do with the footers.
    What you likely need to do is to supply a PDF that will be used to print. When RoboHelp creates Printed Documentation it first creates a Word document. And if you have elected to create a PDF, the PDF is created from the Word document. So what you can do is to forego the PDF from RoboHelp and manually tweak the Word document to add the desired footers. Then you could create a PDF from that to supply to the user.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Develop a form and print program using VBAP, VBAK, MRKT.

    I have 2 tables VBAK [fields: VBELN, ERDAT, ERNAM, AUDAT, VBTYP, VKORG] and VBAP [Fields: POSNR, MATNR, CHARG, WAERK] and In output(form) i need the following fields,
    Output table:
    -VBELN
    -ERDAT
    -VKORG
    -POSNR
    -MATNR
    -MAKTX <- this field is from table MAKT. (I need the Material descriptions too for all the materials.)
    Form Layout should have Header, Logo (SAP ENJOY), Main, Footer.
    Problem is that i need footer only after the End of Complete data in Main Window, thats is footer should be placed only in last window. How should i do that ?
    Logic which i thot to make the print program is : First declare an internal table itab1 with VBAP, VBAP using the above fields from two tables and fetch the product based on matnr.
    declare one internal table itab2 and select the records from the table makt by checking the condition itab1 is not initial.
    sample code.
    IF ITAB1 IS NOT INITIAL.
    SELECT FIELD LIST FROM MAKT INTO TABLE ITAB2 WHERE MATNR EQ ITAB1-MATNR.
    ENDIF.
    hope this shuld work. ?????

    Hi
    see the sample script program and do accordingly
    *& Report  ZTEST12121
    *& SAPScripts Example 1
    REPORT  ztest12121.
    *DATABASE TABLES
    TABLES: ekko,ekpo,lfa1.
    *INTERNAL TABLES AND STRUCTURES
    DATA i_ekko LIKE ekko.
    DATA i_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
    DATA i_lfa1 LIKE lfa1.
    *PARAMETERS
    PARAMETERS: p_ebeln LIKE ekko-ebeln.
    *VARIABLES
    DATA MAT TYPE STRING VALUE 'MAT NO'.
    DATA iTe TYPE STRING VALUE 'ITEM NO'.
    DATA QTY TYPE STRING VALUE 'QTY'.
    DATA UOM TYPE STRING VALUE 'UOM'.
    DATA NET TYPE STRING VALUE 'NET PRICE'.
    Data var type integer value 0.
    *DATABASE SELECTS
    *Header data
    SELECT SINGLE * FROM ekko INTO i_ekko WHERE ekko~ebeln = p_ebeln.
    IF sy-subrc = 0.
    *Item Data
      SELECT * FROM ekpo INTO  TABLE i_ekpo WHERE ekpo~ebeln = p_ebeln.
      IF sy-subrc NE 0.
        WRITE 'PURCHASE DOCUMENT ITEM DATA ERROR'.
      ELSE.
    *Vendor Details
        SELECT SINGLE * FROM lfa1 INTO i_lfa1 WHERE lfa1~lifnr = i_ekko-lifnr.
        IF sy-subrc NE 0.
          WRITE 'VENDOR DOCUMENT ITEM DATA ERROR'.
        ENDIF.
      ENDIF.
    ELSE.
      WRITE 'THIS PURCHASE DOCUMENT NUMBER DOESNOT EXISTS'.
    ENDIF.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      DIALOG                            = 'X'
        form                              = 'ZSCRIPT_1'
        language                          = sy-langu
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
      SPONUMIV                          =
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
      CANCELED                          = 1
      DEVICE                            = 2
      FORM                              = 3
      OPTIONS                           = 4
      UNCLOSED                          = 5
      MAIL_OPTIONS                      = 6
      ARCHIVE_ERROR                     = 7
      INVALID_FAX_NUMBER                = 8
      MORE_PARAMS_NEEDED_IN_BATCH       = 9
      SPOOL_ERROR                       = 10
      CODEPAGE                          = 11
      OTHERS                            = 12
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'OFFICEAD'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'OFFICEAD'
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'PODET'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'PODET'
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'TOP'
       FUNCTION                       = 'SET'
       TYPE                           = 'TOP'
       WINDOW                         = 'MAIN'
    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 I_EKPO.
    var = i_ekpo-netpr * i_ekpo-menge.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'BODY'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'MAIN'
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
      UNOPENED                       = 1
      BAD_PAGEFORMAT_FOR_PRINT       = 2
      SEND_ERROR                     = 3
      SPOOL_ERROR                    = 4
      CODEPAGE                       = 5
      OTHERS                         = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Structure of a print program
    OPEN_FORM function
    CLOSE_FORM function
    WRITE_FORM
    START_FORM function
    END_FORM function
    CONTROL_FORM function
    The print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options.
    Function modules in a printprogram:
    • When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine forms into a single spool request use START_FORM and END_FORM.
    • To print textelements in a form use WRITE_FORM. The order in which the textelements are printed, is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you can also use the WRITE_FORM_LINES function module.
    • To transfer control command to a form use CONTROL_FORM.
    Structure of a print program
    Read data
    Tables: xxx.
    SELECT *
    FROM xxx.
    Open form printing - Must be called before working with any of the other form function modules.
    Must be ended with function module CLOSE FORM
    call function 'OPEN_FORM'.....
    To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM
    call funtion 'START_FORM'.....
    Write text elements to a window of the form
    call function 'WRITE_FORM'.....
    Ends spool request started with START_FORM
    call funtion 'END_FORM'.....
    Closes form printing
    call function 'CLOSE_FORM'...
    OPEN_FORM function
    Syntax:
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    APPLICATION = 'TX'
    ARCHIVE_INDEX =
    ARCHIVE_PARAMS =
    DEVICE = 'PRINTER'
    DIALOG = 'X'
    FORM = ' '
    LANGUAGE = SY-LANGU
    OPTIONS =
    MAIL_SENDER =
    MAIL_RECIPIENT =
    MAIL_APPL_OBJECT =
    RAW_DATA_INTERFACE = '*'
    IMPORTING
    LANGUAGE =
    NEW_ARCHIVE_PARAMS =
    RESULT =
    EXCEPTIONS
    CANCELED = 1
    DEVICE = 2
    FORM = 3
    OPTIONS = 4
    UNCLOSED = 5
    MAIL_OPTIONS = 6
    ARCHIVE_ERROR = 7
    INVALID_FAX_NUMBER = 8
    MORE_PARAMS_NEEDED_IN_BATCH = 9
    SPOOL_ERROR = 10
    OTHERS = 11
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Some important parameters:
    FORM Name of the form
    DEVICE • PRINTER : Print output using spool
    • TELEFAX: Fax output
    • SCREEN: Output to screen
    OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....
    The input for the parameter is structure ITCPO.
    CLOSE_FORM function
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
    RESULT =
    RDI_RESULT =
    TABLES
    OTFDATA =
    EXCEPTIONS
    UNOPENED = 1
    BAD_PAGEFORMAT_FOR_PRINT = 2
    SEND_ERROR = 3
    SPOOL_ERROR = 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.
    Paramerters:
    RESULT Returns status information and print/fax parameters after the form has been printed. RESULT is of structure ITCPP.
    WRITE_FORM function
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = ' '
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    IMPORTING
    PENDING_LINES =
    EXCEPTIONS
    ELEMENT = 1
    FUNCTION = 2
    TYPE = 3
    UNOPENED = 4
    UNSTARTED = 5
    WINDOW = 6
    BAD_PAGEFORMAT_FOR_PRINT = 7
    SPOOL_ERROR = 8
    OTHERS = 9
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Some important parameters:
    ELEMENT Specifies which textelement is printed
    WINDOW Specifies which window is printed
    TYPE Specifies the output area of the main window. This can be:
    • TOP - Used for headers
    • BODY
    • BOTTOM - Used for footers
    FUNCTION Specifies whether text is to be appended, replaced or added
    Example of how to use the WRITE_FORM function module together with a script.
    Form layout of the MAIN window
    /E INTRODUCTION
    Dear Customer
    /E ITEM_HEADER
    IH Carrier, Departure
    /E ITEM_LINE
    IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
    /E CLOSING_REMARK
    The print program
    Writing INTRODUCTION
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'INTRODUCTION'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8
    Writing ITEM_HEADER
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ITEM_HEADER'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8
    Set ITEM_HEADER into TOP area of main window for subsequent pages
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ITEM_HEADER'
    FUNCTION = 'SET'
    TYPE = 'TOP'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8
    Write ITEM_LINE
    LOOP AT .....
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ITEM_LINE'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8.
    ENDLOOP.
    Delete ITEM_HEADER from TOP area of main window
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ITEM_HEADER'
    FUNCTION = 'DELETE'
    TYPE = 'TOP'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8
    Print CLOSING_REMARK
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'CLOSING_REMARK'
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    OTHERS = 8
    START_FORM function
    CALL FUNCTION 'START_FORM'
    EXPORTING
    ARCHIVE_INDEX =
    FORM = ' '
    LANGUAGE = ' '
    STARTPAGE = ' '
    PROGRAM = ' '
    MAIL_APPL_OBJECT =
    IMPORTING
    LANGUAGE =
    EXCEPTIONS
    FORM = 1
    FORMAT = 2
    UNENDED = 3
    UNOPENED = 4
    UNUSED = 5
    SPOOL_ERROR = 6
    OTHERS = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    END_FORM function
    CALL FUNCTION 'END_FORM'
    IMPORTING
    RESULT =
    EXCEPTIONS
    UNOPENED = 1
    BAD_PAGEFORMAT_FOR_PRINT = 2
    SPOOL_ERROR = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CONTROL_FORM function
    The CONTROL_FORM function module alows you to create SapScript control statements from within an APAB program.
    Syntax:
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    command =
    EXCEPTIONS
    UNOPENED = 1
    UNSTARTED = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example:
    Protecting the text element ITEM_LINE
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'PROTECT'.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    TEXELEMENT = 'ITEM_LINE'.
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'ENDPROTECT'.
    Regards
    Anji

  • Problem when printing booklets prints pages 1,2 and 11 as if I wants to print all

    I am using XP and 2000 MS word
    I am having a problem when printing booklets from time to time. I get it ready to print in booklet form with 12 pages and my printer gives me the options. “Print all”  “current page”  “selection” or “pages”  Because it is booklet I want to print the first 4 pages to be folded and glued as a small book. When I inter 1-4 as the example shows some times it prints OK but about a week later it prints pages 1,2 and 11 as if it wants to print all. I thought it was the printer but think it could be in some setting of the word program or my computer it self.

    Also does this (i.e. prints web pages over several pages despite changing settings) on my laptop at work with an HP printer. This started when I upgraded to Firefox 9.0.1.

  • In Sapscript, print page 1 on printer 1 and page on printer 2 -(tray setup)

    Hello Experts,
    We have a requirement in our cheque printing program wherein we need to print on different printers.
    I think this has something to do with trays in sapscript. Because for page 1, we need to print
    on a pre-printed form and for page 2 onwards we just need to print it on an ordinary papaer.
    Can you please tell me how I can achieve this and how do we customize it in sapscript?
    Hope you can help me guys. Thank you and take care!

    The resource names are already set by SAP. TRY01, TRY02, TRY03 which correspond to the same trays in the Printer setup (txn: SPAD, Tray Info window). I suspect there are more possible values (some printers have more than 3 trays) but I've never seen them documented.
    Note, your basis team needs to make sure the tray settings are in SPAD and the print drivers are set correctly.

  • SAPScript Form - Check Print

    Hi. I am trying to create SAPScript Form to print checks and need your help.
    I am very new to the SAPscript, so I have one general question and one specific question.
    1. Is there a really good tutorial for creating a check form?
    2. Currently, AP in our company uses two checks per legal paper.
       Do you know how/what format I need to set up page format to print two checks at a time in one paper?
    Thank you in advance.
    John

    Thank you, but I am little confused.
    Let me try to explain little more detail of my need.
    We have legal size paper containing two blank checks and space to write invoice items below each check.
    If open item has one check to write, just print one check.
    If invoice items goes over length of space allowed, void next check and continue with invoice items.
    If it needs to print two or more checks,
    print first check, print invoice items, print second check (on same legal paper) and invoice items.
    Go to next legal size paper and print third check, etc...
    How do I set up to print second check on same paper below contining to next paper?
    What page format do I need to use?
    I hope this clarifies my need.
    Thanks.
    John

Maybe you are looking for