SAP Reports / Programs

RSPO1041 SAP ABAP Report - Delete Old Spool Requests







RSPO1041 is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for You should schedule this report to run periodically in order to delete old spool requests...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter RSPO1041 into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT RSPO1041. "Basic submit
SUBMIT RSPO1041 AND RETURN. "Return to original report after report execution complete
SUBMIT RSPO1041 VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: AGE1 = Without Output Request
Selection Text: AGE2 = In Processing
Selection Text: AGE3 = Completed
Selection Text: AGE4 = Incorrect
Selection Text: AND1 = and
Selection Text: AND2 = and
Selection Text: AND3 = and
Selection Text: AND4 = and
Selection Text: CLIENT = Client
Selection Text: COMMIT_A = COMMIT all ... Spool requests
Selection Text: DAYS = Include all days
Selection Text: LISTONLY = Only log without deleting?
Selection Text: MIN_ALT1 = older than ... days
Selection Text: MIN_ALT2 = older than ... days
Selection Text: MIN_ALT3 = older than ... days
Selection Text: MIN_ALT4 = older than ... days
Selection Text: NONEX = Requests without Output Device
Selection Text: WORKING = Only include work days
Selection Text: UNAME = Creator
Selection Text: TITLE = Title
Selection Text: SYSTEM = System name
Selection Text: SUFFIX2 = Spool request (suffix 2)
Selection Text: SUFFIX1 = Spool request (suffix 1)
Selection Text: SUFFIX0 = Spool request name
Selection Text: PRINTER = Output Device
Selection Text: PCALID = Factory calendar ID
Selection Text: OR4 = Or
Selection Text: OR3 = Or
Selection Text: OR2 = Or
Selection Text: OR1 = Or
Selection Text: OLD4 = Obsolete
Selection Text: OLD3 = Obsolete
Selection Text: OLD2 = Obsolete
Selection Text: OLD1 = Obsolete
Title: Delete Old Spool Requests
Text Symbol: 133 = Use all days for further calculation.
Text Symbol: 132 = Calendar
Text Symbol: 131 = Del. Time





Text Symbol: 130 = Created At
Text Symbol: 129 = Owner
Text Symbol: 128 = Spool ID
Text Symbol: 127 = System
Text Symbol: 126 = Requests with output device that no longer exists
Text Symbol: 125 = /
Text Symbol: 124 = "And" is only allowed when both the other checkboxes are selected
Text Symbol: 123 = and / or
Text Symbol: 024 = Commit all &1 spool requests
Text Symbol: 023 = Log and delete
Text Symbol: 022 = Only log, do not delete
Text Symbol: 021 = Spool request name (suffix2):
Text Symbol: 020 = Spool request name (suffix1):
Text Symbol: 019 = Spool request name:
Text Symbol: 018 = Title:
Text Symbol: 017 = Client:
Text Symbol: 016 = Sys. names:
Text Symbol: 014 = CreatedBy
Text Symbol: 013 = Following additional conditions selected:
Text Symbol: 012 = Delete the following spool requests:
Text Symbol: 011 = Sys. Time:
Text Symbol: 010 = No matching spool request found
Text Symbol: 009 = Old, incorrect spool requests:
Text Symbol: 008 = Incorrect spool requests older than &1 days:
Text Symbol: 007 = Old completed spool requests:
Text Symbol: 006 = Old spool requests being processed:
Text Symbol: 005 = Spool requests being processed older than &1 days
Text Symbol: 004 = Completed spool requests older than &1 days
Text Symbol: 003 = Cannot delete request &1 &2
Text Symbol: 002 = Spool requests without output request older than &1 days
Text Symbol: 001 = Old spool requests without output request:
Text Symbol: 122 = Obsolete
Text Symbol: 121 = older than ... days
Text Symbol: 120 = Spool requests
Text Symbol: 119 = Every day
Text Symbol: 118 = Only work days
Text Symbol: 117 = Factory calendar ID
Text Symbol: 116 = In processing
Text Symbol: 115 = Incorrect





Text Symbol: 114 = Without output request
Text Symbol: 113 = Completed
Text Symbol: 110 = Further conditions
Text Symbol: 100 = Criteria for selecting spool requests for deletion
Text Symbol: 035 = Old spool request with errors older than &1 days:
Text Symbol: 034 = Old spool requests in processing older than &1 days:
Text Symbol: 033 = Old completed spool requests older than &1 days:
Text Symbol: 032 = Old spool requests without output request older than &1 days:
Text Symbol: 031 = Delete orphaned logs:
Text Symbol: 030 = OutputDevice:
Text Symbol: 029 = Cannot read company calendar (code =
Text Symbol: 028 = Cannot convert date (code =
Text Symbol: 027 = How to interpret day numbers: only include work days (calendar &1)
Text Symbol: 026 = How to interpret day numbers: include all days
Text Symbol: 025 = No selection authorization for &1 spool requests


INCLUDES used within this REPORT RSPO1041

INCLUDE: RSPOTIME, RSPOERROR, , RSPOOPT.
INCLUDE: RSPOTIME, RSPOERROR, , RSPOOPT.


TABLES used within REPORT and the associated SELECT statement:

No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

RSPO_RESOLVE_SYSTEM_NAMES CALL FUNCTION 'RSPO_RESOLVE_SYSTEM_NAMES' TABLES syssel = system syslist = syslist.

DATE_CONVERT_TO_FACTORYDATE CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE' EXPORTING * CORRECT_OPTION = '+' date = ldate "local date factory_calendar_id = pcalid IMPORTING * DATE = factorydate = facdate * WORKINGDAY_INDICATOR = EXCEPTIONS calendar_buffer_not_loadable = 1 correct_option_invalid = 2 date_after_range = 3 date_before_range = 4 date_invalid = 5 factory_calendar_not_found = 6 OTHERS = 7.

RSPO_ISELECT_SPOOLREQS CALL FUNCTION 'RSPO_ISELECT_SPOOLREQS' EXPORTING rfcsystem = syslist-sysid access = 'DELE' nonex_dev = nonex IMPORTING rq_no_access = tno * RQ_ACCESS = TABLES * S_RQIDEN = s_rqclie = client s_rq0nam = suffix0 s_rq1nam = suffix1 s_rq2nam = suffix2 s_rqowne = uname * S_RQ1DIS = * S_RQ2DIS = * S_RQFIN = * S_RQCOPI = * S_RQPRIO = * S_RQPAPE = * S_RQPJRE = s_rqtitl = title * S_RQRECE = * S_RQDIVI = * S_RQAUTH = * S_RQTLAN = * S_RQTNUM = * S_RQCRED = * S_RQDELD = s_rqdestl = printer * S_RQPAGE = * S_RQSAPT = * S_RQUNXT = * S_RQADES = * S_RQSYST = result_tsp01 = tsp01_list EXCEPTIONS OTHERS = 1.

RSPO_CLEAN_STATISTIC CALL FUNCTION 'RSPO_CLEAN_STATISTIC' * EXPORTING * GENERAL_AGE = 7 * PROCESSED_AGE = 1 * IMPORTING * UNFINISHED_JOBS = * PROCESSED_JOBS = * OLD_QUERY = * PROCESSED_QUERY = .

RSPO_DELETE_LOMS_EVENTS CALL FUNCTION 'RSPO_DELETE_LOMS_EVENTS' EXPORTING loms = itsploms-name days = 7 EXCEPTIONS unknown_loms = 1 OTHERS = 2.

RSPO_RID_SPOOLREQ_LIST CALL FUNCTION 'RSPO_RID_SPOOLREQ_LIST' EXPORTING id_list = idlist[] * SUMMARY = ' ' EXCEPTIONS OTHERS = 1.

RSPO_ISELECT_SPOOLREQS CALL FUNCTION 'RSPO_ISELECT_SPOOLREQS' EXPORTING rfcsystem = syslist-sysid access = 'DELE' proto = 'X' * IMPORTING * RQ_NO_ACCESS = * RQ_ACCESS = TABLES result_tsp01 = tsp01_list EXCEPTIONS OTHERS = 1.

RSPO_ISELECT_TSP02_ID CALL FUNCTION 'RSPO_ISELECT_TSP02_ID' EXPORTING rfcsystem = tsp01_list-sys pjident = tsp01_list-rqident is_prot_no = 'X' TABLES tsp02_list = tsp02_list EXCEPTIONS OTHERS = 1.

RSPO_IDELETE_SPOOLREQ CALL FUNCTION 'RSPO_IDELETE_SPOOLREQ' EXPORTING spoolreq = tsp01_list * IMPORTING * RC = * STATUS = EXCEPTIONS OTHERS = 1.

RSPO_IDELETE_SPOOLREQ CALL FUNCTION 'RSPO_IDELETE_SPOOLREQ' EXPORTING spoolreq = tsp01_result * IMPORTING * RC = * STATUS = EXCEPTIONS OTHERS = 1.




FACTORYDATE_CONVERT_TO_DATE CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE' EXPORTING factorydate = lfacdate factory_calendar_id = pcalid IMPORTING date = ldate "local EXCEPTIONS calendar_buffer_not_loadable = 1 factorydate_after_range = 2 factorydate_before_range = 3 factorydate_invalid = 4 factory_calendar_id_missing = 5 factory_calendar_not_found = 6 OTHERS = 7.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name RSPO1041 or its description.