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

read wider spool

Former Member
0 Likes
2,177

I am using RSPO_RETURN_ABAP_SPOOLJOB function module for reading data of my spool.

It reads only upto around 18 columns. My spool is wider and having more columns.Please suggest how can I read my spool of more than 18 columns.

Thanks...

10 REPLIES 10
Read only

Former Member
0 Likes
1,753

Hi,

can you please show the code. How did you declare the tableparameter BUFFER?

Regards, Dieter

Read only

andreas_mann3
Active Contributor
0 Likes
1,753

how have you defined paramter for table buffer?

A.

Read only

Former Member
0 Likes
1,753

TYPES: BEGIN OF T_SPOOL,

  • INCLUDE STRUCTURE BAPIXMSPOW.

LINE(1024) TYPE c.

TYPES: END OF T_SPOOL.

DATA: IT_SPOOL_XLS TYPE T_SPOOL OCCURS 0.

I am passing IT_Spool_xls in the buffer.

I have tried increasing lenght of this.

Read only

0 Likes
1,753

Hi,

here a short code:


DATA: IT_BUFFER TYPE TABLE OF CHAR255 WITH HEADER LINE.
*
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
  EXPORTING
    RQIDENT              = 100000  " your SpooNo
  TABLES
    BUFFER               = IT_BUFFER
  EXCEPTIONS
    NO_SUCH_JOB          = 1
    NOT_ABAP_LIST        = 2
    JOB_CONTAINS_NO_DATA = 3
    SELECTION_EMPTY      = 4
    NO_PERMISSION        = 5
    CAN_NOT_ACCESS       = 6
    READ_ERROR           = 7
    OTHERS               = 8.
*
IF SY-SUBRC <> 0.
  WRITE: / SY-SUBRC.
ELSE.
  LOOP AT IT_BUFFER.
    WRITE: / IT_BUFFER.
  ENDLOOP.
ENDIF.

.

Regards, Dieter

Read only

Former Member
0 Likes
1,753

thanks..but this does not work.

Still I get the spool only till my 18th column...my spool has around 25 columns.

plese suggest something to read all 25 columns..

Read only

0 Likes
1,753

Hi,

did you try my code?

There some notes in OSS if the spool has a lot of lines. How may line dose your spool have?

Can you please show your whole code?

How did you check if you get 18 but the spool has 25 char per line?

Regards, Dieter

Read only

Former Member
0 Likes
1,753

Below is my code:

after executing this it_spool_xls does not contaiin the full spool. wheras in sp01 i can see the full spool.

Last columns are trauncated after it reads from the Function module.

Is there any other way to read the spool.

pls suggest.

SELECT * FROM TBTCO INTO CORRESPONDING FIELDS OF TABLE LT_TBTCO

WHERE JOBNAME = JOBNAME

AND JOBCOUNT = JOBCOUNT .

SELECT SPOOLID FROM TBTC_SPOOLID

INTO CORRESPONDING FIELDS OF TABLE LT_SPOOL

FOR ALL ENTRIES IN LT_TBTCO

WHERE JOBNAME = JOBNAME

AND JOBCOUNT = LT_TBTCO-JOBCOUNT.

LOOP AT LT_SPOOL.

SPOOL_ID = LT_SPOOL-SPOOLID.

CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'

EXPORTING

RQIDENT = SPOOL_ID "Spool Request Number

FIRST_LINE = 1

TABLES

BUFFER = IT_SPOOL_XLS "Internal table that will have the Spool Request No data

EXCEPTIONS

NO_SUCH_JOB = 1

NOT_ABAP_LIST = 2

JOB_CONTAINS_NO_DATA = 3

SELECTION_EMPTY = 4

NO_PERMISSION = 5

CAN_NOT_ACCESS = 6

READ_ERROR = 7

OTHERS = 8.

Read only

0 Likes
1,753

Hi,

no idea what happens?

the FM uses this FM too. Can you test this FM and tell if you only see 18 Char?

*


  CALL FUNCTION 'RSPO_DISPLAY_ABAP_SPOOLJOB'
    EXPORTING
      RQIDENT              = 100000
    EXCEPTIONS
      NO_SUCH_JOB          = 1
      NOT_ABAP_LIST        = 2
      JOB_CONTAINS_NO_DATA = 3
      SELECTION_EMPTY      = 4
      NO_PERMISSION        = 5
      CAN_NOT_ACCESS       = 6
      READ_ERROR           = 7
      OTHERS               = 8.
*
  IF SY-SUBRC <> 0.
    WRITE: / SY-SUBRC.
  ENDIF.

Regards, Dieter

Read only

Former Member
0 Likes
1,753

From this FM (RSPO_DISPLAY_ABAP_SPOOLJOB) , it goes to include LSPOXF08.

in this include there is a perform get_spool_line.

Inside this form there is a call

CALL 'C_RSTS_READ'

ID 'HANDLE' FIELD temse_handle

ID 'BUFF' FIELD data_set_line

ID 'BUFFLG' FIELD bufflg " note 1053675

ID 'ALLINE' FIELD 'X'

ID 'BINARY' FIELD ' '

ID 'SHOWLG' FIELD 'X'

ID 'LENGTH' FIELD length

ID 'RC' FIELD rc

ID 'ERRMSG' FIELD errmsg.

status = sy-subrc.

This returns the spool line by line.

Data_set_line contains the spool content.

after this my data_set_line contains only upto some characters in a row not the full data.

please suggest.

Read only

0 Likes
1,753

Hi Swetha,

check the spad default printer setting and try to assign the Printer with supports more than 256 columns.

else try this way ..



DATA : begin t_data occurs 0,
                text(4000),
            end of t_data.
data : w_char(3000),
          w_char1(3000).

* Fetching Spool data into internal table
  CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
    EXPORTING
      rqident              = p_spool  "Spool data
    TABLES
      buffer               = t_data.

*   formatting Internal table according to file fromat...
    LOOP AT t_data.
      IF t_data-text(1) EQ '|' OR t_data-text(1) EQ '-'.
        w_show = w_char.
        MOVE w_char TO t_finaldata-text.
         APPEND t_finaldata.
        CLEAR w_char.
        MOVE t_data-text TO w_char.
      ELSE.
        MOVE t_data-text TO w_char1.
        CONCATENATE w_char w_char1 INTO w_char.
      ENDIF.
    ENDLOOP.

Loop at t_finaldata.
 write :/ t_finaldata-text. 
endloop.

Prabhudas