on 10-13-2010 3:46 PM
HI all,
i am trying to print out Inspection Results (OTFs generated by QGA3 Transaction) via the CONVERT_OTFSPOOLJOB_2_PDF funtion module.
But if the Inspection Results have more than 200 pages the FM only creates a PDF without content.
The PDF is there but it has 0 bytes.
This is how i fill the FM:
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spool
no_dialog = 'X'
IMPORTING
pdf_bytecount = wl_numbytes
pdf_spoolid = wl_pdfspoolid
btc_jobname = wl_jobname
btc_jobcount = wl_jobcount
TABLES
pdf = tl_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.
Does anyone have an idea ?
Thanks and Regards
Volker
That's because the function reverts to background processing when the page size is over 99 pages (see the code). I posted how to handle this a while back but basically you can either use RSPO_RETURN_SPOOLJOB directly or you can continue to use your current function but you have to poll for the completion of the job (BP_JOB_STATUS_GET) and then get the resulting spool in RAW format with RSPO_RETURN_SPOOLJOB then convert it:
FIELD-SYMBOLS: <fs_line> TYPE x.
DATA: gv_pdf TYPE xstring.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = p_spono
desired_type = 'RAW'
TABLES
buffer = gt_buffer
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
LOOP AT gt_buffer INTO gs_buffer.
ASSIGN gs_buffer TO <fs_line> CASTING TYPE x.
CONCATENATE gv_pdf <fs_line> INTO gv_pdf IN BYTE MODE.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.