Reputation: 1
I have this particular error since the last Thursday and I could not find any solution, so I ask you guys if you know hot to fix it...
First:
I generate a CLASS (SE24) for download a pdf with a spool number. Before that CLASS I generate a method to convert OTF -> PDF,
The TABLE_BIN give me the 'Exception CX_SY_NO_HANDLER' and then explotes, but still read the SPOOL and give me information. I'm base in this code -> 'RSTXPDFT4'
I don't have a program to run the methods, I just use the same class.
THE CODE:
CONSTANTS c_pdfcnv_pdfdst_xstring(1) TYPE c VALUE 'X'.
DATA: numbytes TYPE i,
jobname TYPE tbtcjob-jobname,
jobcount TYPE tbtcjob-jobcount,
pdf_stream TYPE xstring,
pdf_stream_tab TYPE STANDARD TABLE OF rspolpbi,
pdfspoolid TYPE tsp01-rqident.
IF i_is_otf = 'X'.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spool_id " Duda
no_dialog = ' '
* DST_DEVICE =
pdf_destination = c_pdfcnv_pdfdst_xstring
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
* OTF_PAGECOUNT =
btc_jobname = jobname
btc_jobcount = jobcount
bin_file = pdf_stream
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
OTHERS = 12
.
IF sy-subrc NE 0.
ENDIF.
ELSE.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spool_id " eSTE
no_dialog = ' '
* DST_DEVICE =
pdf_destination = c_pdfcnv_pdfdst_xstring
get_size_from_format = 'N'
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
* LIST_PAGECOUNT =
btc_jobname = jobname
btc_jobcount = jobcount
bin_file = pdf_stream
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.
IF sy-subrc NE 0.
ENDIF.
ENDIF.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = pdf_stream
TABLES
binary_tab = pdf_stream_tab.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
table_bin = pdf_stream_tab.
size_pdf = numbytes.
I already debugging this a few times, I only find the SY_TABIX give me '2'.
I tried using a try & catch, but still with the same error. 'Exception CX_SY_NO_HANDLER'.
Upvotes: 0
Views: 2267
Reputation: 13656
In the information you have given, you have used:
SETST_TYPE_TABLE
for passing data to the parameter table_bin
, which is a table of lines of type 70 characters,pdf_stream_tab
which is a table of structured lines of type RSPOLPBI
which is a DDIC Structure with 1 component of type 128 bytes.As explained in the documentation below (I just indicate what is relevant to your case), this is not permitted, because the line types of the 2 tables are not convertible (the line types are respectively a field which is character-like and a structure which is not character-like).
Instead, as a PDF is made of bytes, not characters, you should always use variables "byte-like".
NB:
"Internal tables can be assigned to each other if their line types are compatible or convertible"
"If a structure is purely character-like, ..."
"If the structure is not completely character-like, the single field must have the type c and the structure must begin with a character-like fragment ..."
"No conversion rule is defined for any other cases, and assignments are not possible."
Upvotes: 2