Skip to Content
0
Former Member
May 10, 2016 at 07:46 AM

Printing Adobe PDF without a Job

164 Views

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