Hello Experts,
I am trying to save a spool output into the server as PDF file. For that I am using the next code:
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gv_spoolid
use_cascading = 'X'
* no_dialog = 'X'
TABLES
pdf = gt_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
IF sy-subrc = 0.
CALL FUNCTION 'HR_JP_CONV_TAB_TO_CP_XSTR'
IMPORTING
ev_xstring_stream = gv_contentbin
TABLES
it_datatab = gt_pdf
EXCEPTIONS
OTHERS = 3.
ENDIF.
After that I save the content of GV_CONTENTBIN into the Server in BINARY MODE.
The problem is that the file is not being saved correctly (in the Spool is perfectly shown) when I see it in the OS or downloading using G3CY. The text and the layout is not being shown correctly when I open it with Adobe reader.
Another point is that I have copied this code from another system where works perfectly... I have noticed that in the system which works is is a Unicode system and the one which is not working is a Non-Unicode System (though maybe it has nothing to do with the problem).
I have tried different FMs but everything keeps going wrongly... could you please help me with this?
Thanks in advance,
Pablo del Pino