Skip to Content
0
Former Member
Jan 30, 2007 at 02:10 PM

GET/SET_PRINT_PARAMETERS

554 Views

Hi all!

How can I pass variable with PRINTERNAME to function GET/SET_PRINT_PARAMETERS..

If I use this code it stil print with default printer?

FORM print.

  PERFORM read_fields.

  DATA: val,
      pripar LIKE pri_params,
      arcpar LIKE arc_params,
      h_plist LIKE pri_params-plist.

  DATA:l_params TYPE pri_params,
       l_valid TYPE c.

  DATA: pa_dest LIKE pri_params-pdest.

  pa_dest = '3070'.

  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING     
      no_dialog              = 'X'
      immediately            = 'X'
    IMPORTING
      out_parameters         = pripar      
      out_archive_parameters = arcpar
      valid                  = val
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.

  IF val <> space AND sy-subrc = 0.

    CALL FUNCTION 'SET_PRINT_PARAMETERS'
      EXPORTING
        destination = pa_dest.

    NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG.

    PERFORM print_selectie_per_klant_f.

    NEW-PAGE PRINT OFF.
  ELSE.

    PERFORM fout.

  ENDIF.

ENDFORM.  

Adibo..:)