REPORT ZEXAMPLE.

DATA: BEGIN OF OBJCONT OCCURS 0.

INCLUDE STRUCTURE SOLI.

DATA: END OF OBJCONT.

DATA: SPOOL_NUMBER LIKE RSPOTYPE-RQNUMBER,

OWNER LIKE SOUD-USRNAM,

CONT_SIZE LIKE RSTSTYPE-LINELENGTH.

OWNER = SY-UNAME.

CALL FUNCTION 'SO_WIND_SPOOL_LIST' "DISPLAY ALL SPOOL NUMBERS FOR OWNER

EXPORTING

OWNER = OWNER

IMPORTING

SPOOL_NUMBER = SPOOL_NUMBER.

CALL FUNCTION 'SO_SPOOL_READ' "GET SPOOL INFOMATION

EXPORTING

SPOOL_NUMBER = SPOOL_NUMBER

TABLES

OBJCONT = OBJCONT

EXCEPTIONS

CONVERT_ERROR = 1

OBJECT_NOT_EXIST = 2

OPERATION_NO_AUTHORIZATION = 3

SPOOL_CLOSE_ERROR = 4

SPOOL_OPEN_ERROR = 5

SPOOL_READ_ERROR = 6

OTHERS = 7.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'RSPO_SPOOLDATA_WRITE_INIT'.

LOOP AT OBJCONT.

CONT_SIZE = STRLEN( OBJCONT ).

CALL FUNCTION 'RSPO_SPOOLDATA_WRITE' "DISPLAY SPOOL

EXPORTING

SPOOL_DATA = OBJCONT

DATA_LENGTH = CONT_SIZE

START_POS = 1

EXCEPTIONS

OTHERS = 1.

ENDLOOP.

ELSE.

WRITE:/ 'COULD NOT DISPLAY SPOOL:', SPOOL_NUMBER.

ENDIF.