05-10-2016 8:46 AM
Hello all,
I'm using a generic program that calls different types of printing programs per distributor,
the problem is that most of printouts are kinds of smartforms and layouts and only one of them
is Adobe PDF, so the printout of this PDF's output comes when ever he want during all other printouts.
We checked this issue and found that the reason is using of JOB process in PDF printouts, is there any
way that I can output an Adobe PDF without using this Job process ?
The code that I'm using is for PDF printout (without business data...)
TYPES: BEGIN OF ty_kunnr,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
END OF ty_kunnr.
DATA: ssf_name TYPE tdsfname,
func_mod_name TYPE rs38l_fnam,
ls_outputparams TYPE sfpoutputparams,
ls_docparams TYPE sfpdocparams,
ls_result TYPE fpformoutput. "#EC NEEDED
ssf_name = 'ZWM_PACK_MNG'.
CLEAR func_mod_name.
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = ssf_name
IMPORTING
e_funcname = func_mod_name.
CATCH cx_fp_api_repository cx_fp_api_usage cx_fp_api_internal.
sy-subrc = 1.
MESSAGE i117(zpp) WITH ssf_name.
ENDTRY.
ls_outputparams-getpdf = ''.
ls_outputparams-reqnew = 'X'.
ls_outputparams-reqimm = 'X'.
ls_outputparams-preview = ' '.
ls_outputparams-nodialog = 'X'.
ls_outputparams-dest = 'PLCL'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e118(zpp).
ENDIF.
ls_docparams-langu = sy-langu.
ls_docparams-country = 'IL'.
CONCATENATE sy-datum+6(2) sy-datum+4(2) sy-datum(4) INTO lv_crnt_date_str SEPARATED BY '/'.
CONCATENATE lv_lddat+6(2) lv_lddat+4(2) lv_lddat(4) INTO lv_load_date_str SEPARATED BY '/'.
* Now call the generated function module
CALL FUNCTION func_mod_name
EXPORTING
/1bcdwb/docparams = ls_docparams
dist_num = ls_kunnr-kunnr
dist_name = ls_kunnr-name1
rpt_date = lv_load_date_str
result_table = lt_printout
matnr_11 = lv_matnr_11
matnr_7 = lv_matnr_7
matnr_4 = lv_matnr_4
matnr_8 = lv_matnr_8
crnt_date = lv_crnt_date_str
IMPORTING
/1bcdwb/formoutput = ls_result
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e118(zpp).
ENDIF.
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e118(zpp).
ENDIF.
Regards,
Amit Berku
05-23-2016 12:22 PM
Hello all,
After no one answered to my question, the only solution that I've found is to turn the PDF output into smartforms and now all printouts comes out sync way.
Regards,
Amit Berku
05-23-2016 3:15 PM
Yup.... I do not think there is any other way to print Adobe forms without using a job.
-Chandra
05-23-2016 9:27 PM
Most likely you didn't get any replies because it's difficult to understand the question. It seems you might be confusing SAP Adobe Forms with PDF file format (these are two different things). Also the title does not really match the question. My first impression was this had something to do with a printout in a background job. But only after looking at the code it became clear that the question is about calling an Adobe form with FP_JOB_OPEN (SAP's poor naming choice for this FM did not help, unfortunately).
And the FM actually seems irrelevant because the actual challenge is putting Smartform and Adobe form into the same output (spool / PDF file). Similar question has already been asked on SCN, use Google with "Smartform and Adobe form in the same spool".
When posting questions on SCN, I'd suggest to use the standard terminology (translations can be found in STERM transaction) and ensure that the title describes the question correctly. Usually if there are no replies whatsoever for days it means something is wrong with how the question was asked.
Now if this has been resolved then kindly close the discussion (see this blog).
Thank you.