02-06-2012 3:36 PM
Hello
I am having trouble printing a Smartfrom in BACKGROUND. When I remove IN BACKGROUND TASK printing works fine. Below is my code.
CALL FUNCTION 'ZPP_PRINT_ZLINK_TAG'
IN BACKGROUND TASK
EXPORTING
p_matnr = gs_s0100-matnr
TABLES
pt_zlink = gt_zlink.
I checked the following trans but nothing related to my job : SP01, SP02, SM50 & SM37
Below are the parms which are used in FM 'ZPP_PRINT_ZLINK_TAG' in calling the smartform:
*Parameters for CALL FUNCTION fm_name
CLEAR gs_control_param.
gs_control_param-no_dialog = 'X'.
gs_control_param-device = 'PRINTER'.
gs_control_param-langu = 'E'.
CLEAR gs_output.
gs_output-tddest = 'CORU'.
gs_output-tdimmed = 'X'.
gs_output-tddelete = 'X'.
CALL FUNCTION fm_name
EXPORTING
control_parameters = gs_control_param
output_options = gs_output
user_settings = space
zstr_zlinktag = zstr_zlinktag
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Thanks
Gary
02-06-2012 8:06 PM
Hi ,
You have to do a commit work after the FM call. Other wise background task FM will not call.
CALL FUNCTION 'ZEMAILDET_SR_FUNC' IN BACKGROUND TASK
EXPORTING
guid = l_guid.
COMMIT WORK.
and rest of the coding is fine.
Thanks
Subhankar.
02-06-2012 5:52 PM
Hi Gary,
probably Your CORU printer uses frontend printing which is not supported in background.
Check SPAD transaction - I thing You have 'Host Spool Access Method' set to F or G.
Regards,
--
Przemysław
02-06-2012 6:16 PM
I checked trans SPAD and CORU is to the following:
C - Direct operating system call
Should I changed to some other access method?
Thanks for responding
02-06-2012 6:58 PM
02-06-2012 7:02 PM
Hi Przemyslaw
I will not change, will leave at "C". Prints in foregrand but not backgound wonder if it has something to do with printer settings?
Thanks
02-06-2012 8:06 PM
Hi ,
You have to do a commit work after the FM call. Other wise background task FM will not call.
CALL FUNCTION 'ZEMAILDET_SR_FUNC' IN BACKGROUND TASK
EXPORTING
guid = l_guid.
COMMIT WORK.
and rest of the coding is fine.
Thanks
Subhankar.