Printing smartform to a perticular printer

Hi all.
I want to print the samrt form &  DONT WANT to get the POP UP which prompts us to enter output device.
Below is the smart form FM. & Parameters .  Even though I am passing the output device in the FM , it is not considering this output device which we are passing. It is taking the default printer  which has been assingned in user profile ( Tx code SU3).
Let me know how to avoid this. I should get the print in the output device which I am passing( I am passing LOCL in program) . It should not consider the
default printer assinged in Uesr profile (SU3)
Below is th code
gwa_cparam-no_dialog = 'X'.
gwa_outoptions-tddest = 'LOCL'.
gwa_outoptions-tdimmed = 'X'.
*ENDIF.
Printer name to be used is provided in the export parameter
OUTPUT_OPTIONS
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    input        = gwa_equi-matnr
IMPORTING
   output        = gwa_equi-matnr.
CALL FUNCTION gv_fmname
  EXPORTING
  ARCHIVE_INDEX              =
  ARCHIVE_INDEX_TAB          =
  ARCHIVE_PARAMETERS         =
    control_parameters         = gwa_cparam
  MAIL_APPL_OBJ              =
  MAIL_RECIPIENT             =
  MAIL_SENDER                =
    output_options             = gwa_outoptions
   user_settings              = 'X'
    sernr                      = gv_serial
   ACTUALQTY                  = 1
    werks                      = p_plant
    brgew                      = gv_brgew
   groes                       = gv_groes
    maktx                      = gv_maktx
    mfg_date                   = gv_mfg
  NAME1                      =
  NAME2                      =
  STRAS                      =
  PFACH                      =
  PSTLZ                      =
  ORT01                      =
    matnr                      = gwa_equi-matnr
IMPORTING
  DOCUMENT_OUTPUT_INFO       =
  JOB_OUTPUT_INFO            =
  JOB_OUTPUT_OPTIONS         =
EXCEPTIONS
   formatting_error           = 1
   internal_error             = 2
   send_error                 = 3
   user_canceled              = 4
   OTHERS                     = 5.

Hi,
Try with this code.
data : gwa_outoptions TYPE  ssfctrlop.
gwa_outoptions-no_open   = 'X'.
gwa_outoptions-no_close  = 'X'.
gwa_outoptions-DEVICE = 'LCOL'.
Regards
Bikas

Similar Messages

  • Problem while printing smartform in dot matrix printer

    Hi Experts,
    When i am printing smartform using dot matrix printer only the last page prints but all the pages displays in print privew.
    For example suppose there are three pages to be print 1/3, 2/3 , 3/3 , i get all the three pages in print privew as well as when i take its printout in laser printer i get all three pages as print, but when i am using dot matrix printer i get only the last page ie 3/3 as print.
    Regards
    Varun Sharma

    Hai Varun,
    If things are coming properly then its no more ABAP issue.
    Need to check out with the BASIS team along with the IT / hardware department.
    Just try to take print out on a other dotmatrix printer, if its somewhere close to you as usually they are heavy and large in size can't be moved.
    Hope this helps,
    Cheers,
    Suvendu

  • Printing smartform in Dot matrix printer

    Hi ,
    i am giveing the printout of the smartform in the dot matrix printer. But in the print out the template is not getting printed and in the second table i am getting extra lines in the table. Please give me any suggestions and is there any settings to be changed in the printer.
    Warm Regards
    Phani.

    There may be some isssue with the loop used to printing the table ....
    There might be only 2 reasons either there is loop repeating or not data is not cleared  concentrate on this two issues only .
    try debugging the table jus before printing .if its is fine , then
    Sometimes even the problem with the print catridge could have resulted in this .
    Edited by: Martina Floriette on Jun 23, 2009 7:50 AM

  • Printing smartform/script in line printer

    hi experts,
           can any one suggest me how to configure my smartform to line printer,
    presently i have configured my smartform to dotmatrix printer FOR 24PIN EPSCP DEVICE TYPE in spad, can anyone suggest me please
    kishore

    hi
    CHeck with the Service Provider and Basis Consultant because Zebra Printers  need a specific memory device & drivers to print Bar codes . cross check with them ...
    surya

  • How to print smartform from a report

    Im displaying a report, which contains several documents, whereby which ewch document is connected to a smartform.
    The page displaying the report contains a button 'Print'
    When clicking on the Print button, all the documents in the report should be printed.
    But my program is creating a spool file of the report, which will be printed further - its not what I want
    I want the program to print the smartforms of each documents on the report directly.
    heres my code and I dont know what I should do to be able to print the smartforms directly
    Get the function module name of the smartform.
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname = '/EU000/FI_PRINT_DEBIT_NOTE'
          IMPORTING
            fm_name  = g_fm_name.
    gw_options-tdnoprev = ' '.
    gw_options-tddest = 'LOCL'.
    gw_options-tdprinter = 'LOCL'.
    gw_options-tdnewid = 'X'.
    gw_options-tdimmed = 'X'.
    gw_control-preview = ' '.
    gw_control-no_dialog = 'X'.
    write: text-006,' ', text-007, ' ', text-008.
    write:/.
    For all the documents
        LOOP AT gi_all_data INTO gw_all_data.
          write: gw_all_data-gjahr(4), ' ',gw_all_data-belnr,'     ', gw_all_data-belnr.
          write:/.
    CASE SY-UCOMM.
    WHEN 'PRINT'.
    Call the smarform
          CALL FUNCTION g_fm_name
            EXPORTING
              gw_all_data = gw_all_data
              user_settings = ' '
              output_options = gw_options
              control_parameters = gw_control.
    WHEN 'BACK'.
    LEAVE SCREEN.
    ENDCASE.

    DATA:   x_control_parameters TYPE ssfctrlop,
            x_output_options TYPE ssfcompop.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_prin LIKE usr01-spld.
    SELECTION-SCREEN BEGIN OF LINE.
    INITIALIZATION.
      SELECT  spld
              FROM usr01
              INTO p_prin UP TO 1 ROWS
              WHERE bname = sy-uname.
      ENDSELECT.
    START-OF-SELECTION.
      x_output_options-tdimmed = c_x.
      x_output_options-tddest = p_prin.
      x_output_options-tdnewid = c_x.
      x_output_options-tdreceiver = sy-uname.
      x_output_options-tdcopies = '001'.
      x_control_parameters-device = 'PRINTER'.
      x_control_parameters-no_dialog = c_x.
      x_control_parameters-langu = sy-langu.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
         formname                 = 'Z_SMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = f_name1
      EXCEPTIONS
        no_form                  = 1
        no_function_module       = 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.
    IF P_PRI = 'X'.
      CALL FUNCTION F_NAME1
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
          wa_header                  = wa_zmexh51
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          tab_item                   = TAB_ZMEXD51
          tab_item1                  = TAB_ZMEXS51
    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.
    ELSEIF P_PRE = 'X'.
      CALL FUNCTION F_NAME1
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
          wa_header                  = wa_zmexh51
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          tab_item                   = TAB_ZMEXD51
          tab_item1                  = TAB_ZMEXS51
    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.
    ENDIF.
    Check the above code its just similar requirement  it may helpful to you.
    Thanks,
    Phani.

  • Printing a smartform to a different printer than my default

    I have a function module that gets passes a delivery number and the short-name of a printer.  The function module is supposed to print a smartform (pick list) for that delivery to the specified printer.  The problem is that no matter what I put in for the printer, it prints to my default printer.  If I change it, it will go there.  I'm sure I'm just missing some kind of setting.  Here is what I got:
    printer is the shortname for the printer i want, type RSPOPTYPE
    *Print Smartfomr picklist for  delivery
      data: ls_ctrl_prnt type ssfctrlop,
            ls_outp_opts type ssfcompop.
      ls_ctrl_prnt-no_dialog = 'X'.        " Suppres dialog
      ls_ctrl_prnt-device    = 'PRINTER'.
      ls_outp_opts-tddest    = printer.
      ls_outp_opts-tdprinter = printer.    " Specify required printer
      call function gv_func
        exporting
          control_parameters = ls_ctrl_prnt
          output_options = ls_outp_opts
          pk_hdr               = sf_info
          pk_orders            = sf_odrs
          pk_items             = sf_item
          pk_pgbk              = sf_pgbk
        exceptions
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4.
    Am I missing something here?  Any help would be greatly appreciated.
    Thanks,
    Curtis

    I was able to solve my issue. The field TDIMMED (print immediate) in the parameter OUTPUT_OPTION need to be passed with the value 'X'.
    The code is pasted below.
    DATA: l_ssfctrlop TYPE ssfctrlop,
            l_ssfcompop TYPE ssfcompop,
            l_formname  TYPE tdsfname,
            l_fm_name   TYPE rs38l_fnam.
      CLEAR l_formname.
    Get the smartform name based on the output type
      SELECT SINGLE sform FROM tnapr INTO l_formname
        WHERE kschl = ysdt_dynlayout-auart
          AND nacha = '1'
          AND kappl = 'V2'.
      Get the smartform function module name
        CLEAR l_fm_name.
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname           = l_formname
          IMPORTING
            fm_name            = l_fm_name
          EXCEPTIONS
            no_form            = 1
            no_function_module = 2
            OTHERS             = 3.
        IF sy-subrc EQ 0.
          l_ssfctrlop-no_dialog = 'X'.                        " print popup dialog box is suppressed
          l_ssfcompop-tddest    = usr01-spld.         " the printer name is passed from screen to this field
          l_ssfcompop-tdimmed   = 'X'.                    " print immediate option is set
          l_ssfcompop-tdcopies  = copies_in.         " number of copies of output required
        Call the smartform
          CALL FUNCTION l_fm_name
            EXPORTING
              control_parameters = l_ssfctrlop
              output_options     = l_ssfcompop
              user_settings      = ' '                            "manual override of user settings            
              i_del_head         = likp
              i_dyn_layout       = ysdt_dynlayout
            TABLES
              t_del_item         = ig_lips
              t_home_address     = ig_home_address
              t_header_text1     = ig_header_text1
              t_footer_text1     = ig_footer_text1
              t_footer_text2     = ig_footer_text2
              t_footer_text3     = ig_footer_text3
              t_text4            = ig_text4
              t_text5            = ig_text5
            EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
        ENDIF.

  • Error while printing smartforms

    Hi Friends,
      I am getting error "<b>Invalid value for parameter ARCHDEST</b>" while printing smartforms. This is happening only in IDES server. In Development the same smartform is working normally. I have checked in transaction SU53, to see whether all the authorisations have been given for IDES server. There is no problem in authorisation also. So what might be the reason for this. Please give me the solution to solve this problem.
    Thanks & Regards,
    Ranjith

    Hi Beginner,
    In the layout you have taken window or layout taken the big width in that case only you will get this type error syntatically it shows correct when you exicute the smart from try to give the print or see the print preview you will get this error (suggestion is better to check the window sizes)
    Thanks
    Ashok

  • Font size incorrect when printing smartform

    Hi,
    I have a smartform containing many smaller windows with frames. One big window should show a word in grey and in big letters behind all the other windows.
    In my smartstyles, I have used the font family "HELVE", font style bold and the size 72. When I print to a sap printer device, the word is printed in very small letters and in black. When I´m printing about LOCL and then on the same printer, the fontsize is correct.
    What can I do to change that?
    The second problem is, that the letters are shown over the frames of the other windows, but it should be completely in the background. I put the window with the backgorund letters as the first window on the screen to get it behind all others, but it´s not working....
    Cheers Arne

    there  is   some  proble in printer  setting.....
    contect  the basis person....
    method   for  font  size....
    Define the paragraphs & character formats using SMARTSTYLES & use them in your smartform.
    You have to give the smartstyle name in the Form attributes-->Output options for the formats to be used in your smartform.
    frm ur pc only u can get this font file..
    go to control panel , in tat go to font and select your desired font file..
    now give the path of this font file in se73..
    after doing that this file will be uploaded into ur SAP server.
    Se73 - > True type font installation - > Font name - > specify the name of the font file - > execute

  • Issue in Printing Smartforms through Dotmatrix Printer

    Hi,
    I have a Smartform which has many tables. When I print it through a Laser printer it comes out fine. But when I direct it through the Epson 2090 a 24 pin head dotmatrix printer some lines in the tables are not getting printed.
    May be it's that there is no room for printing line. What will be the best solution for this?, What's the best Font & Unit of Measure I should use? Or Anyother solution?
    Thanks,
    Kishan

    Hi,
    I have a very similar problem to the original posting.  I have a SAPScript form that print fine on a HP Laser Jet printer.  But we cannot get it to print correctly on a Epson DOT Matrix.  We tried two different models and get the same bad results.  The print size is smaller on  the DOT matrix even though I am using the following printer initialization
    # set  to 10 CPI
    0x1B0x50
    # select LQ quality
    0x1B0x780x01
    # select non-proportional spacing
    0x1B0x700x00
    # set left margin to 0
    0x1B0x6C0x00
    # set right margin to 85
    0x1B0x510x85
    # cancel bottom margin
    0x1B0x4F
    It is also printing a hex value on the first line and has top, side, and botton margins of about 3/8 inch  So apparently, it is ignoring the printer initialization.  Note, I had also tried the same initializations using \e in place of the Epson Escape hex value \0x1B
    Message was edited by: Bob Ackerman

  • Font while printing Smartform

    Hi All,
    I have a requirement where i need to display Large Font size in Smartform. I am able to display the same for the PRINTER in print preview.
    But when i print the smartform, the font is printed in very small size.
    I think it is because the printer is not supporting the font.
    Please let me know the workaround for such problem.
    Thanks,
    Best regards,
    Prashant

    method for font size....
    Define the paragraphs & character formats using SMARTSTYLES & use them in your smartform.
    You have to give the smartstyle name in the Form attributes-->Output options for the formats to be used in your smartform.
    frm ur pc only u can get this font file..
    go to control panel , in tat go to font and select your desired font file..
    now give the path of this font file in se73..
    after doing that this file will be uploaded into ur SAP server.
    Se73 - > True type font installation - > Font name - > specify the name of the font file - > execute

  • Printing Smartform on Letterhead Duplex

    Hi,
    I have a 2 page smartform that I am printing onto a letterhead and the paper is loaded so that the letterhead is aligned. I have now created another 1 page smartform, but when I print it it appears on the reverse of the letterhead.
    The printer is set as duplex in SPAD and I have tried changing the print mode on each page, but I cant seem to reverse the 2 page smartform, or get the 1 page smartform on the opposite side.
    What is the best way to do this?
    Thanks,
    Sam

    Seems this was not an issue with the Smarform but the way the printer works as printing from Word had the same result. I inserted a blank second page to make it print on the correct side.

  • Smartform: Blank page gets Printed

    Hi All,
    in my smart form i have two pages, Second page contains main window.
    i have restricted my first page with some conditions , so that first page data will not be printed.
    if i execute the smartform first page is printed blank without any data.
    is there any option to avoid the blank page getting printed????
    Regards,
    Dinesh R

    Hi Dinesh,
    One reason for getting a blank page is if the windows are overlapped in the page layout. Please check and see if any window is overlapping.
    Else, check for "page break" . This is a check box . Once this is activated for a text or window or page, it directs you to a new page. Probably this might be the problem.
    Hope this helps.
    Thanks,
    Prisford Pereira.

  • Command to move content left/right in Smartform label for zebra printer

    Issue : Command to move print content left/right in Smartform label for zebra printer.
    Requirement : If you changed the printer setting top position and left position, Print should start from a specific (X,Y) position.
    I am facing an issue while printing a smartfroms in different zebra printer.  We had tried all
    S_LZPL_SETUP_X  (Where X is LH/SPD/MD/PM/FT )
    But these command are not working in smartforms.
    We had used ZPL II printer command like u2018LH X,Yu2019  and u2018FT,X,Yu2019  in main window as well as in subsequent windows. But that also not working.
    Please advice.
    dinesh.

    Hi,
    If you follow notes #750002 and #750772 and use a smartforms and device type LZEB2, then the you cn just adjust the position of the text in the smartform. e.g. Use tab-stops, spaces or adjust the position of the window. There is no need to use ZPL2 commands directly.
    Regards,
    Aidan

  • Inverting Smartform output on Zebra Printer

    Hi Gurus,
    I am printing a SmartForm on a Zebra LP 2844-Z Thermal Printer. The label is coming out fine. However, due to the nature of my thermal labels (there is a small insert that you peel off separately) I need to print the label upside down.
    I have included a COMMAND node in my SmartForm with 'S_LZPL_SETUP' in the Attribute Field and '^POI' (Page Orientation Inverse) as the Attribute Value. When I print out the SmartForm, the labels are still the wrong way around!
    I am using the ZLZEB2 (ISO 8859-1 (Latin) 203 dpi ZPL-II) driver.
    Any assistance or thoughts on this will be much appreciated.
    Thanks,
    Pat Yee.

    Hello,
    Please let me know, if you found any solution for you problem. I am using the same printer.
    The Tips and Tricks of Zebra
    (http://www.zebra.com/id/zebra/na/en/documentlibrary/misc/sap_smartforms_technical.File.tmp/13760L_SAP_Smart_Forms.pdf)
    on page 40 didn't work. I just want to print two texts  vertical. The rest of the lablel should be printed normal.
    Bye!
    Now I have a solution for the rotation problem. For rotation single fields of the lable you have to create new print controls of your Z* Printer driver device. In this new control you can add the ^FWR (for rotating °90) and ^FWN (for normal print) print control.
    I have tested it and it works.
    Thank you smartforms - no more BARONE
    Bye!
    Silvio Hey
    Message was edited by: Silvio Hey

  • Smartforms : How to include Printer commands in smartforms

    I want to include printer command <esc>&l1T at the end of the smartform so that the printer can staple the form after printing.
    Can any one please let me know how to include this in smart form ..?
    Is there any way ..?

    You should use the following way:
    - Copy the device type into the Customer name space.
    - Go via transaction SPAD - Device types into the device type and
    here to tab strip 'Print controls'. Here add a print control
    with the following contents: \e&l1T
    (without flag 'Hexadecimal'; the \e is the escape character)
    - Now go to your Smartform and add a command node (right-click
    on the tree, Create - Flow logic - Command) and enter the print
    control name into the field 'Include Printer Control'.
    This adds the print control at this point. You only have to
    select the right position of the command node in the tree
    (and therefore the point of time, when the sequence shall be sent).
    - If you want to check the print data, which the SAP sends to the
    printer (and therefore whether the escape sequence was included
    correctly), you can use note 5799, method 2.

Maybe you are looking for