I have created a smartform tht prints a Payment Advice. Its input includes range of Document numbers.
I call the smartform function in loop for all those document numbers. Now my problem is tht everytime tht function is executed the print dialog opens up askin for Printer name and then on pressin 'print', one document is printed and so user has to press print tht many times. To avoid this i added code:
DATA: it_ssfcompop TYPE ssfcompop.
DATA : gst_control_parameters TYPE ssfctrlop.
DATA : gt_job_output_info TYPE ssfcrescl.
it_ssfcompop-tddest = 'LOCL'.
IT_SSFCOMPOP-TDNOPREV = 'X'.
it_ssfcompop-tdnewid = sy-prnew.
it_ssfcompop-tddelete = sy-prrel.
it_ssfcompop-tdimmed = 'X'.
it_ssfcompop-tdnoprint = 'X'.
gst_control_parameters-no_dialog = 'X'.
gst_control_parameters-preview = 'X'. "Deactivate preview!
gst_control_parameters-GETOTF = 'X'.
and called smartform function like this:
CALL FUNCTION FM_NAME
BUKRS = BUKRS-LOW
BELNR = BELNR
GJAHR = GJAHR-LOW
CONTROL_PARAMETERS = gst_control_parameters
OUTPUT_OPTIONS = it_ssfcompop
JOB_OUTPUT_INFO = gt_job_output_info.
this shows print preview but still does not print. What could be error. Please help.