Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

huangapple go评论77阅读模式
英文:

Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

问题

我从您提供的文本中提取到的代码部分如下:

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
        no_dialog                      = ' '
        pdf_destination                = c_pdfcnv_pdfdst_xstring
      IMPORTING
        pdf_bytecount                  = numbytes
        pdf_spoolid                    = pdfspoolid
        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
        no_dialog                      = ' '
        pdf_destination                = c_pdfcnv_pdfdst_xstring
        get_size_from_format           = 'N'
      IMPORTING
        pdf_bytecount                  = numbytes
        pdf_spoolid                    = pdfspoolid
        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 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,

  • In the parameters of the METHOD I declare 'I_IS_OTF' type C (IMPORTING) for check if OTF is 'X'
  • 'I_SPOOL_ID' type I (IMPORTING) for write the SPOOL ID to transform
  • And the problem comes here, I declare 'TABLE_BIN' type TABLE (EXPORTING) and 'SIZE_PDF' type I (EXPORTING).

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:

Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)


    CONSTANTS c_pdfcnv_pdfdst_xstring(1) TYPE c VALUE &#39;X&#39;.

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 = &#39;X&#39;.

  CALL FUNCTION &#39;CONVERT_OTFSPOOLJOB_2_PDF&#39;
      EXPORTING
        src_spoolid                    = i_spool_id &quot; Duda
        no_dialog                      = &#39; &#39;
*       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 &#39;CONVERT_ABAPSPOOLJOB_2_PDF&#39;
      EXPORTING
        src_spoolid                    = i_spool_id &quot; eSTE
        no_dialog                      = &#39; &#39;
*       DST_DEVICE                     =
        pdf_destination                = c_pdfcnv_pdfdst_xstring
        get_size_from_format           = &#39;N&#39;
      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 &#39;SCMS_XSTRING_TO_BINARY&#39;
  EXPORTING
    buffer        = pdf_stream
  TABLES
    binary_tab    = pdf_stream_tab.

 IF sy-subrc &lt;&gt; 0.
* Implement suitable error handling here
 ENDIF.


  table_bin  = pdf_stream_tab.
  size_pdf = numbytes.

Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

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 CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

答案1

得分: 2

在您提供的信息中,您使用了以下内容:

  1. 类型SETST_TYPE_TABLE 用于将数据传递给参数table_bin,该参数是一个包含70个字符类型行的表格,
  2. 并尝试使用变量pdf_stream_tab 进行初始化,该变量是一个包含类型为RSPOLPBI 的结构行的表格,而RSPOLPBI 是一个带有128字节类型组件的DDIC结构。

根据下面的文档解释(我只指出与您情况相关的部分),这是不允许的,因为这两个表格的行类型不可互相转换(行类型分别为类似字符的字段和不类似字符的结构)。

相反,由于PDF是由字节而不是字符组成的,您应该始终使用"字节类型"的变量。

注意:

  1. ABAP文档 - 赋值和转换规则
    • 内部表的转换规则
      > "内部表可以互相分配,如果它们的行类型是兼容或可转换的"
    • 结构的转换规则
      • 平面结构和单字段之间的转换
        > "如果一个结构完全类似字符,..."
        >
        > "如果结构不完全类似字符,单个字段必须具有类型c,并且结构必须以类似字符的片段开头..."
        >
        > "没有为其他情况定义转换规则,因此不可进行赋值。"
  2. 以下是上述类型的定义
    • SETST_TYPE_TABLE 在类型组SETST 中(例如,可以使用事务代码SE11查看):
      Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)
    • SE11中的结构RSPOLPBI
      Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)
英文:

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):
      Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)
    • Structure RSPOLPBI in SE11
      Exception CX_SY_NO_HANDLER (type CX_SY_DYN_CALL_ILLEGAL_TYPE)

huangapple
  • 本文由 发表于 2023年2月27日 01:23:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75573757.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定