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
1,295

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.

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.

3 REPLIES 3
Read only

Former Member
0 Likes
795

Hi,

I am not sure if you are following the rules of calling function modules. When you are calling a function module, you have to make sure that your table and variable definitions should match or be compatible with the export/import/table parameters of the function module you are calling. In your program, there are too many incompatibilities.

First the call to RSPO_RETURN_SPOOLJOB, you passed

'g_doc_type' to the IMPORTING parameter 'real_type', whereas you should have passed it to the EXPORTING parameter 'desired_type'. I am assuming you defined this variable with value 'ALI' because you wanted it in that format. Next for the TABLES parameter 'buffer' you passed 'compressed_list'. Though both are internally compatable, it is desired however to declare 'compressed_list' like the definition of the tables parameter 'buffer' which is referring to structure 'SOLI'.

The second call has even more errors. While there are no CHANGING parameters, you included two new changing parameters content_txt and content_bin and passed your tables 'objbin' and 'objbin_new' to them. There are table parameters to this function module that are CONTENT_IN and CONTENT_OUT. You will need to fill the content_in and it will give you back the content_out.

Here is the modified code. Let me know if you have any questions. This is based on 46C. If you are on a different release and your calls are valid in that release please excuse me.


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          LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      objbin_new      LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      spool_number    LIKE tsp01-rqident,
      compressed_list LIKE soli OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

  break vrajaman.

  spool_number = '31338'.

  CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
       EXPORTING
            rqident              = spool_number
            desired_type         = g_doc_type
*       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[].

      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        = ''
                len_in          = len_in
           TABLES
                content_in      = objbin
                content_out     = objbin_new
           EXCEPTIONS
                err_conv_failed = 1
                OTHERS          = 2.
    ENDIF.
  ENDIF.

Read only

0 Likes
795

I actually couldn't get that function module to work in my 6.40 box. I did however get the two function modules that are called inside of that function module to work directly.



data: g_doc_type like soodk-objtp value 'ALI',
tab_lines like sy-tabix,
doc_size(12) type n,
len_in(12) type c,
transbin type sx_boolean,
objhead type  soli_tab,
objbin type soli_tab,
wobjbin like line of objbin,
objbin_new type solix_tab,
wobjbin_new like line of objbin_new,
spool_number like tsp01-rqident,
compressed_list like solisti1 occurs 0 with header line.

data :        html type table of w3html with header line,
              listobject type table of  abaplist 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.

* Prepare list
      call function 'TABLE_DECOMPRESS'
        tables
          in                   = compressed_list
          out                  = listobject
        exceptions
          compress_error       = 1
          table_not_compressed = 2
          others               = 3.
      if sy-subrc <> 0.
      endif.

* Convert list to HTML
      call function 'WWW_HTML_FROM_LISTOBJECT'
        tables
          html       = html
          listobject = listobject
        exceptions
          others     = 1.

      check sy-subrc = 0.


    endif.
  endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
795

Hi

We are in 620. I would like explain my requirements. Please help me out.

Vendor Remittance Form output has to be sent as a HTML file attachment to the vendors.

Currently i am able to do it directing the Smartforms output to HTML data format. Then downloaded data is sent as html format to users. I am able to get the output as an attachment but the only issues the html output is not proper it is misaligned because the SF returns 1024 raw format but the mail can accept 255 text char. I would like to go for some other option.

Please tell me can i root the SF output to Spool and the spool can i download the contents in html data.

Please suggest me how to go about.

Giri