Luka Bonavita
Luka Bonavita

Reputation: 1

Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

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:

PARAMETERS DEFINITION


    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.

When the Gen.type change for SETST_TYPE_TABLE

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'.

Exception gone but still with DUMPS

Upvotes: 0

Views: 2267

Answers (1)

Sandra Rossi
Sandra Rossi

Reputation: 13656

In the information you have given, you have used:

  1. the type SETST_TYPE_TABLE for passing data to the parameter table_bin, which is a table of lines of type 70 characters,
  2. and you tried to initialize it with the variable 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:

  1. ABAP Documentation - Assignment and Conversion Rules
  2. Here are the definitions of the above types
    • SETST_TYPE_TABLE in the type group SETST (transaction code SE11 for instance): SETST_TYPE_TABLE in type group SETST in SE11
    • Structure RSPOLPBI in SE11 RSPOLPBI

Upvotes: 2

Related Questions