REPORT zqrdg_dp.
DATA :
lv_fname TYPE rs38l_fnam ,
lv_formname TYPE tdsfname VALUE 'ZQRDG_F',
ls_fpformout TYPE fpformoutput,
lo_fp TYPE REF TO if_fp,
lo_pdfobj TYPE REF TO if_fp_pdf_object,
lv_len TYPE i,
lt_tab TYPE TABLE OF solix,
lv_file_name TYPE string,
lv_timestamps TYPE string,
lv_qrcode TYPE xstring,
iv_barcode_text TYPE string VALUE 'Test QR Data'.
cl_rstx_barcode_renderer=>qr_code(
EXPORTING
i_module_size = 20
i_mode = 'A'
i_error_correction = 'H'
i_barcode_text = iv_barcode_text
IMPORTING
e_bitmap = lv_qrcode
).
DATA(l_control) = VALUE ssfctrlop( no_dialog = 'X' preview = 'X' no_open = '' no_close = '' device = 'Z_ADS' ).
DATA(ls_outputparams) = VALUE sfpoutputparams( getpdf = 'X' dest = 'ZADS' ).
DATA(ls_docparams) = VALUE sfpdocparams( fillable = 'X' ).
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = lv_formname
IMPORTING
e_funcname = lv_fname.
CALL FUNCTION lv_fname
EXPORTING
/1bcdwb/docparams = ls_docparams
iv_qrcode = lv_qrcode
IMPORTING
/1bcdwb/formoutput = ls_fpformout
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
lo_fp = cl_fp=>get_reference( ).
lo_pdfobj = lo_fp->create_pdf_object( connection = CONV #('ADS') ).
CALL METHOD lo_pdfobj->set_document
EXPORTING
pdfdata = ls_fpformout-pdf.
CALL METHOD lo_pdfobj->set_template
EXPORTING
xftdata = ls_fpformout-pdf
fillable = 'X'.
CALL METHOD lo_pdfobj->set_signature
EXPORTING
keyname = 'STTGlobal' "'ReaderRights' "Signature name from solution manager
fieldname = 'SignatureField1'
reason = 'TEST'
location = 'Mumbai'
contactinfo = 'Rajesh'.
TRY.
CALL METHOD lo_pdfobj->execute( ).
CATCH cx_fp_runtime_internal INTO DATA(lc_interanl).
MESSAGE lc_interanl->get_longtext( ) TYPE 'I'.
CATCH cx_fp_runtime_system INTO DATA(lc_runtime).
MESSAGE lc_runtime->get_longtext( ) TYPE 'I'.
CATCH cx_fp_runtime_usage INTO DATA(lc_usage).
MESSAGE lc_usage->get_longtext( ) TYPE 'I'.
ENDTRY.
* get result -> l_out
CALL METHOD lo_pdfobj->get_document
IMPORTING
pdfdata = DATA(lv_out).
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_out
* buffer = l_pdf
IMPORTING
output_length = lv_len
TABLES
binary_tab = lt_tab.
GET TIME STAMP FIELD DATA(lv_timestamp).
lv_timestamps = lv_timestamp.
CONCATENATE 'C:\temp\' lv_timestamps '.pdf' INTO lv_file_name.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = lv_len "bitmap2_size "l_len
filename = lv_file_name
filetype = 'BIN'
CHANGING
data_tab = lt_tab
EXCEPTIONS
OTHERS = 1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
11 | |
9 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 |