I am trying to convert a spool dataset (otf) into pdf format and write it to the server disk.
There is a report, called RSTXPDFT4 which downloads the file to the workstation.
I have managed to do the pdf-conversion with calling:
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = i_sp01-rqident
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
OTF_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = PDF
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 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.
but I have no clue how to write the returned pdf data in the internal table PDF to the disk.
I have tried
OPEN DATASET name_x FOR OUTPUT IN BINARY MODE.
PDF_KOMPLETT = ''.
LOOP AT PDF.
TRANSFER PDF-tdformat TO name_x.
TRANSFER PDF-tdline TO name_x.
ENDLOOP.
CLOSE DATASET name_x.
but that adds bytes at the end because it always writes complete lines...
Anyone have this problem before?
I cannot remember if there is a function to write the contents of an internal table to the server harddisk.
Thanks
Alex