cancel
Showing results for 
Search instead for 
Did you mean: 

SMARTFORM job_output_options

RichB
Participant
0 Kudos

I am trying to control the printer to which my output is directed using the job_output_options, but I find that one of the first things the generated function module does is clear those parameters. CLEAR JOB_OUTPUT_OPTIONS. This appears to be part of the standard build of the function module, so it looks like these parameters are useless. Anyone else had this problem? Does SAP plan on changing this? Since I have the dialog turned off, the program picks up my user default. I need to control this output based on the plant and workcenter.

Any help (other than using GET_PRINT_PARAMETERS because that isn't the answer) would be appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

RichB
Participant
0 Kudos

Thanks for the help. I see I was setting the parameters in the wrong place.

former_member181962
Active Contributor
0 Kudos

Write a select on CRHD table to get the Printer name in CRHD-PDEST.

Pass the CRHD-PDEST to output_options structure.

data: X_OUTPUT_OPTIONS TYPE SSFCOMPOP, "SAP Smart Forms: Smart

X_CONTROL_PARAMS TYPE SSFCTRLOP."Smart Forms: Control

X_OUTPUT_OPTIONS-TDIMMED = 'X'. " Print Immediately

X_OPTIONS-TDIMMED = 'X'. " Print Immediately

X_CONTROL_PARAMS-PREVIEW = ' '. "Do not show Preview

X_OUTPUT_OPTIONS-TDDEST = CRHD-PDEST.

  • call your Smartform FM this way

CALL FUNCTION V_FM_NAME

EXPORTING

ARCHIVE_PARAMETERS = X_ARC_PARAMS

CONTROL_PARAMETERS = X_CONTROL_PARAMS

OUTPUT_OPTIONS = X_OUTPUT_OPTIONS

USER_SETTINGS = ' '

TABLES

MATID_TAB = IT_TEMP

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

Regards,

Ravi

Former Member
0 Kudos

hi

i have used lile this

 st_output_options-tdtitle        = text-011.  "Free goods credit notes'
  st_output_options-tdnewid        = c_x.       "create new spool dataset
*  ST_OUTPUT_OPTIONS-TDCOPIES       = C_N_1.     "one copy Commented by SM0001
  st_output_options-tddest         = p_prntr.   "name of printer
  st_output_options-tdnoprev       = space.     "no preview
  st_output_options-tdcover        = space.     "no cover page
  st_output_options-tddataset      = p_prntr.   "dataset name
  st_output_options-tdsuffix2      = space.     "name of report variant
*  ST_OUTPUT_OPTIONS-TDIMMED        = C_Y.       "print immediately? Commented by SM0001
  st_output_options-tddelete       = space.     "do not delete after print

*****************Insert by SM0001 on 17/10/2006
  IF p_tmod = c_2.
    st_output_options-tdarmod        = c_3.
  ELSEIF p_tmod = c_1.
    st_output_options-tdcopies       = c_n_1.     "one copy
    st_output_options-tdimmed        = c_y.       "print immediately?
  ELSEIF p_tmod = c_3.
    st_output_options-tdarmod        = c_3.
    st_output_options-tdcopies       = c_n_1.     "one copy
    st_output_options-tdimmed        = c_y.       "print immediately?
  ENDIF.