Home > ABAP, Forms > Print smartform directly

Print smartform directly

September 17th, 2009 Leave a comment Go to comments

This is a brief post about how to print a smartform without print preview.

Step 1. use below code snip to set up data.

  DATA: gs_control    TYPE ssfctrlop,
        gs_options    TYPE ssfcompop.
 
* build the print parameter
  gs_control-device    = 'PRINTER'.
  gs_control-langu     = 'E'.
  gs_control-no_dialog = gc_charx.
 
  gs_options-tddest    = p_pdest.
  gs_options-tdnewid   = gc_charx.
  gs_options-tdimmed   = gc_charx.

Step 2. Call the smartform function module using above parameter.

*   Call smartform
  CALL FUNCTION lv_fm_name
    EXPORTING
      user_settings      = space
      control_parameters = gs_control
      output_options     = gs_options
      is_spras           = gv_spras
    EXCEPTIONS
      formatting_error   = 1
      internal_error     = 2
      send_error         = 3
      user_canceled      = 4
      OTHERS             = 5.
  1. No comments yet.
  1. No trackbacks yet.