11-17-2017 1:26 PM
Hi Gurus,
I have a PDF in from a smartform using CONVERT_OTF and i can see pdf with GUI_DOWNLOAD. but i need to send it with base64 format, i used SCMS_BINARY_TO_XSTRING and convert base64 but it doesnt work.
Does anyone have any advice for me?
Regards,
11-17-2017 8:42 PM
So, you have a bug in your code, but how could we tell you what/where it is.
11-23-2017 6:35 AM
thank you for answer,
here is my code,
I submit a program in fm,
*** program codes
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
archive_index = archive_index
IMPORTING
bin_filesize = lv_bin_filesize
TABLES
otf = otf-otfdata
lines = it_lines
EXCEPTIONS
err_conv_not_possible = 1.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_bin_filesize
IMPORTING
buffer = lv_xstring
TABLES
binary_tab = it_lines
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc EQ 0.
gt_py-xspdf = lv_xstring.
APPEND gt_py.
ENDIF.
IF gt_py[] IS NOT INITIAL.
EXPORT gt_py TO SHARED BUFFER indx(st) ID 'ZTEMP'.
ENDIF.
*** function module codes
IMPORT gt_py FROM SHARED BUFFER indx(st) ID 'ZTEMP'.
IF sy-subrc EQ 0.
READ TABLE gt_py INDEX 1.
IF sy-subrc EQ 0.
lv_pdf = gt_py-xspdf.
ENDIF.
ENDIF.
CALL FUNCTION 'SSFC_BASE64_ENCODE'
EXPORTING
bindata = lv_pdf
binleng = lv_length
IMPORTING
b64data = lv_base64
EXCEPTIONS
ssf_krn_error = 1
ssf_krn_noop = 2
ssf_krn_nomemory = 3
ssf_krn_opinv = 4
ssf_krn_input_data_error = 5
ssf_krn_invalid_par = 6
ssf_krn_invalid_parlen = 7
OTHERS = 8.
i cant see lv_base64 like a pdf.
11-23-2017 7:14 AM
Based on the code you have posted, I can tell:
But I still don't understand why you say "it doesn't work", and "cant see base 64 like a pdf". What do you mean exactly? What did you try? Please give concrete and clear examples, eventually screen shots, etc.
11-29-2017 9:45 AM
i try to send payslip pdf with web services using base64 format. payslip is calculated a program so i used submit in a function module.
lv_length is not calculated.
the company which use my web service said me 'we decode your webservice value, but it doesnt work'.