2007 Jul 17 11:58 AM
Hi all,
I have used <b>CONVERT_ABAPSPOOLJOB_2_PDF</b> to generate a PDF from a spool ID. Now I need to use the internal table returned from this function module, table PDF (type TLINE), to upload (archive) the file to a specific <b>content server repository</b> and generate an <b>archive document ID</b>.
This needs to be done <b>without</b> using a physical PDF file/local storage on workstation.
All <b>helpful</b> answers will be rewarded!
- Mari Virik
Hi all,
I have used <b>CONVERT_ABAPSPOOLJOB_2_PDF</b> to generate a PDF from a spool ID. Now I need to use the internal table returned from this function module, table PDF (type TLINE), to upload (archive) the file to a specific <b>content server repository</b> and generate an <b>archive document ID</b>.
This needs to be done <b>without</b> using a physical PDF file/local storage on workstation.
All <b>helpful</b> answers will be rewarded!
- Mari Virik
2007 Jul 17 12:08 PM
Why don't to use a DATASET to download your PDF table? Just use a .pdf filename and it will work, I think...
2007 Jul 17 12:13 PM
parameters: pcfile LIKE rlgrap-filename LOWER CASE.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = w_bytecount " imported from the prev function
filename = pcfile
filetype = 'BIN'
TABLES
data_tab = itab_pdf
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE e398(00) WITH 'Cannot download to PC. Error =' sy-subrc.
ENDIF.
2007 Jul 17 12:20 PM
Hi again,
As explained in the initial post, <b>I cannot use local storage</b> (cannot use WS_DOWNLOAD), and I have to store the file in a <b>specific content server repository</b> and hence generate an <b>archive document ID</b> (so I guess cannot use DATASET either).
I need to upload the internal PDF table directly to the server... Any good ideas?
Regards,
Mari Virik
2007 Jul 17 12:35 PM
Hi mari,
i'm not quiet sure, if you want to upload or download.
In my example it's an download(transfer).
as i mentioned take your own directory an name.
Regards, Dieter
2007 Jul 17 12:16 PM
Hi mari,
try this:
DATA: P_SPOOL LIKE TSP01-RQIDENT.
DATA: FILESIZE TYPE I.
DATA: BEGIN OF PDF_OUTPUT OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF PDF_OUTPUT.
change as you need
DATA: DATEI_A(30) TYPE C VALUE '/tmp/test.pdf'.
*
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = P_SPOOL
IMPORTING
PDF_BYTECOUNT = FILESIZE
TABLES
PDF = PDF_OUTPUT.
OPEN DATASET DATEI_A FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC NE 0. MESSAGE E001. STOP. ENDIF.
*
LOOP AT PDF_OUTPUT.
*
TRANSFER PDF_OUTPUT TO DATEI_A.
*
ENDLOOP.
*
CLOSE DATASET DATEI_A.
IF SY-SUBRC NE 0. MESSAGE E001. STOP. ENDIF.
Regards, Dieter
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |