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

Spool Read FM - Issue

Former Member
0 Likes
541

Hi,

The FM 'RSPO_RETURN_SPOOLJOB' is used in a program to read the spool.

However, the FM does not consistently return the spool information correctly.

I'm aware of issues where the spool line is truncated when it is in excess of 255 characters. However, in our scenario, the spool length is 220 characters and the FM truncates it a few times abruptly at 200 or 201 characters. Is there anything that can be done to make sure the spool is not truncated abruptly?

Please help with inputs.

Thanks in advance.

Hi,

The FM 'RSPO_RETURN_SPOOLJOB' is used in a program to read the spool.

However, the FM does not consistently return the spool information correctly.

I'm aware of issues where the spool line is truncated when it is in excess of 255 characters. However, in our scenario, the spool length is 220 characters and the FM truncates it a few times abruptly at 200 or 201 characters. Is there anything that can be done to make sure the spool is not truncated abruptly?

Please help with inputs.

Thanks in advance.

1 REPLY 1
Read only

pranay570708
Active Contributor
0 Likes
466

Hi, Try below code to read spool more than 255 characters:

  DATA:    pv_src_spoolid                 TYPE tsp01-rqident

           pt_pdf                         TYPE tlinetab.


  CHECK pv_src_spoolid IS NOT INITIAL.


  CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

    EXPORTING

      src_spoolid                         = pv_src_spoolid

      no_dialog                           = 'X'

    TABLES

      pdf                                 = pt_pdf

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

  ENDIF.

* Make each line 255 characters

  CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'

    TABLES

      content_in  = pt_pdf

      content_out = lt_contents_bin.