on 12-15-2016 5:51 AM
Hi Expers,
I want to see adobe pdf preview in odata get stream mthod.capture.png.
DATA: lv_funcname TYPE funcname,
ls_outputparams TYPE sfpoutputparams,
ls_docparams TYPE sfpdocparams,
ls_formoutput TYPE fpformoutput.
DATA: ls_stream TYPE ty_s_media_resource.
* ” Getting the Function Module Name for the Adobe Form
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZIN_FI_PNOTE_FORM' " “Adobeform name
IMPORTING
e_funcname = lv_funcname.
* “Handle Exceptions with Try – catch
ENDTRY.
* ” Opening the Job
ls_outputparams-nodialog = abap_true.
* ls_outputparams-preview = abap_true.
ls_outputparams-getpdf = abap_true.
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.
* Implement suitable error handling here
ENDIF.
ls_docparams-langu = sy-langu.
ls_docparams-country = 'US'.
CALL FUNCTION lv_funcname
EXPORTING
/1bcdwb/docparams = ls_docparams
p_f_zplno = '10001'
IMPORTING
/1bcdwb/formoutput = ls_formoutput
* EXCEPTIONS
* USAGE_ERROR = 1
* SYSTEM_ERROR = 2
* INTERNAL_ERROR = 3
* OTHERS = 4
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
* ” Closing the Job
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0. " Subrc Check is not required, so we are not handling any exception here
ENDIF.
* ” Converting the PDF to XString
ls_stream-value = ls_formoutput-pdf.
ls_stream-mime_type = 'PDF'.
copy_data_to_ref( EXPORTING is_data = ls_stream CHANGING cr_data = er_stream ).
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.