Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

converting Spool list to HTM

Former Member
0 Likes
814

Hi,

Recently we have upgraded our system from 4.6B to 4.7.

we had a program which uses the FM ' SX_OBJECT_CONVERT_ALI_HTM' to convert the ABAP Spool List to HTM. But after the upgrade the parameters in FM have changed and we are forced to make modification in the program.

I get d dump while passing a parameter to CONTENT_BIN. It says type conflict when calling a FM. I have passed the same type of parameter. Kindly let me know where I'm going wrong and how to make this work.


REPORT zptest10 .

DATA: g_doc_type LIKE soodk-objtp VALUE 'ALI',
      tab_lines LIKE sy-tabix,
      doc_size(12) TYPE n,
      len_in(12),

      objbin TYPE soli_tab WITH HEADER LINE,
      objbin_new type solix_tab with header line,

      spool_number LIKE  tsp01-rqident,
      compressed_list LIKE solisti1 OCCURS 0 WITH HEADER LINE.


START-OF-SELECTION.

  spool_number = '2220'.

  CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
    EXPORTING
      rqident              = spool_number
    IMPORTING
      real_type            = g_doc_type
    TABLES
      buffer               = compressed_list
    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.
  IF sy-subrc = 0.
    BREAK-POINT.
    DESCRIBE TABLE compressed_list LINES tab_lines.
    IF tab_lines > 0.

      MOVE compressed_list[] TO objbin[].
      MOVE compressed_list[] TO objbin_new[].

*---convert list to HTM

      doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
      len_in = doc_size.
*
      CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_HTM'
        EXPORTING
          format_src      = 'ALI'
          format_dst      = 'HTM'
          devtype         = 'SMTP'
          funcpara        = ''
        CHANGING
          content_txt     = objbin
          <b>content_bin     = objbin_new</b>
          len             = len_in
        EXCEPTIONS
          err_conv_failed = 1
          OTHERS          = 2.
      IF sy-subrc = 0.
      ENDIF.

    ENDIF.

Any help is appreciated

Thanks,
Praveen

Hi,

Recently we have upgraded our system from 4.6B to 4.7.

we had a program which uses the FM ' SX_OBJECT_CONVERT_ALI_HTM' to convert the ABAP Spool List to HTM. But after the upgrade the parameters in FM have changed and we are forced to make modification in the program.

I get d dump while passing a parameter to CONTENT_BIN. It says type conflict when calling a FM. I have passed the same type of parameter. Kindly let me know where I'm going wrong and how to make this work.


REPORT zptest10 .

DATA: g_doc_type LIKE soodk-objtp VALUE 'ALI',
      tab_lines LIKE sy-tabix,
      doc_size(12) TYPE n,
      len_in(12),

      objbin TYPE soli_tab WITH HEADER LINE,
      objbin_new type solix_tab with header line,

      spool_number LIKE  tsp01-rqident,
      compressed_list LIKE solisti1 OCCURS 0 WITH HEADER LINE.


START-OF-SELECTION.

  spool_number = '2220'.

  CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
    EXPORTING
      rqident              = spool_number
    IMPORTING
      real_type            = g_doc_type
    TABLES
      buffer               = compressed_list
    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.
  IF sy-subrc = 0.
    BREAK-POINT.
    DESCRIBE TABLE compressed_list LINES tab_lines.
    IF tab_lines > 0.

      MOVE compressed_list[] TO objbin[].
      MOVE compressed_list[] TO objbin_new[].

*---convert list to HTM

      doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
      len_in = doc_size.
*
      CALL FUNCTION 'SX_OBJECT_CONVERT_ALI_HTM'
        EXPORTING
          format_src      = 'ALI'
          format_dst      = 'HTM'
          devtype         = 'SMTP'
          funcpara        = ''
        CHANGING
          content_txt     = objbin
          <b>content_bin     = objbin_new</b>
          len             = len_in
        EXCEPTIONS
          err_conv_failed = 1
          OTHERS          = 2.
      IF sy-subrc = 0.
      ENDIF.

    ENDIF.

Any help is appreciated

Thanks,
Praveen

4 REPLIES 4
Read only

Former Member
0 Likes
711

Hi Praveen,

I think the problem is in the way you defined your internal table. You defined it as follows

<b>objbin_new type solix_tab with header line</b>.

The function module is not expecting it with a header line. So take out the '<i>with header line</i>' part of it and you should be fine.

Srinivas

Read only

0 Likes
711

Hi Srinivas,

thanks for the nice suggestion, now i dont get any dumps.

Regards,

Praveen

Read only

0 Likes
711

Hi Praveen,

I am glad it worked. Please mark the question as being answered.

Srinivas

Read only

Former Member
0 Likes
711

Hi

I need to convert my spool request into a HTML File output format.

Could you please tell me how to correct this issue. I am getting the below mentioned error when i active my program.

----


The following error noticed : OBJBIN_NEW and COMPRESSED_LIST are not mutually convertible. In Unicode programs, OBJBIN_NEW must have the same strucutre layout as COMPRESSED_LIST, independent of length of a unicode character.

----


report zptest10 .

data: g_doc_type like soodk-objtp value 'ALI',

tab_lines like sy-tabix,

doc_size(12) type n,

len_in(12) type c,

objbin type soli_tab with header line,

objbin_new type solix_tab,

spool_number like tsp01-rqident,

compressed_list like solisti1 occurs 0 with header line.

start-of-selection.

break vrajaman.

spool_number = '31338'.

call function 'RSPO_RETURN_SPOOLJOB'

exporting

rqident = spool_number

importing

real_type = g_doc_type

tables

buffer = compressed_list

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.

if sy-subrc = 0.

describe table compressed_list lines tab_lines.

if tab_lines > 0.

move compressed_list[] to objbin[].

move compressed_list[] to objbin_new[].

doc_size = ( tab_lines - 1 ) * 255 + strlen( objbin ).

len_in = doc_size.

call function 'SX_OBJECT_CONVERT_ALI_HTM'

exporting

format_src = 'ALI'

format_dst = 'HTM'

devtype = 'SMTP'

funcpara = ''

changing

content_txt = objbin

content_bin = objbin_new

len = len_in

exceptions

err_conv_failed = 1

others = 2.

endif.

endif.