SAP RSPO_OUTPUT_DEVICEDATA Function Module for Spool Output Control of an Internal Table with Formatted Data
RSPO_OUTPUT_DEVICEDATA is a standard rspo output devicedata SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Spool Output Control of an Internal Table with Formatted Data processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for rspo output devicedata FM, simply by entering the name RSPO_OUTPUT_DEVICEDATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: SPOD
Program Name: SAPLSPOD
Main Program: SAPLSPOD
Appliation area: S
Release date: 20-Oct-1995
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RSPO_OUTPUT_DEVICEDATA pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'RSPO_OUTPUT_DEVICEDATA'"Spool Output Control of an Internal Table with Formatted Data.
EXPORTING
* PAGES = 1 "Number of Output Pages (Information Only)
* RQTITLE = ' ' "Title of Spool Request
* DEVICE = ' ' "Output Device (' '=Query Interactively)
* SIZE = 0 "Size of Data [in Bytes]
* DATATYPE = 'RAW' "Type of Data ('RAW', 'HPGL2',...)
IMMEDIATELY = "
* LOCATION = 'db' "Storage Location ('db' Database, '&G' File System)
IMPORTING
RQID = "Spool Request Number Used
TABLES
DEVICE_DATA = "Outputted Device Data
EXCEPTIONS
DEVICE_UNKNOWN = 1 DEVICE_TYPE_UNKNOWN = 2 CANCELED_BY_USER = 3 INTERNAL_ERROR = 4 DEVICE_TYPE_BAD = 5 SIZE_MISMATCH = 6
IMPORTING Parameters details for RSPO_OUTPUT_DEVICEDATA
PAGES - Number of Output Pages (Information Only)
Data type: RSPOTYPE-PAGESDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
RQTITLE - Title of Spool Request
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
DEVICE - Output Device (' '=Query Interactively)
Data type: TSP03-PADESTDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SIZE - Size of Data [in Bytes]
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
DATATYPE - Type of Data ('RAW', 'HPGL2',...)
Data type:Default: 'RAW'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMMEDIATELY -
Data type: PRI_PARAMS-PRIMMOptional: No
Call by Reference: No ( called with pass by value option)
LOCATION - Storage Location ('db' Database, '&G' File System)
Data type:Default: 'db'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RSPO_OUTPUT_DEVICEDATA
RQID - Spool Request Number Used
Data type: TSP01-RQIDENTOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RSPO_OUTPUT_DEVICEDATA
DEVICE_DATA - Outputted Device Data
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
DEVICE_UNKNOWN - Unknown Output Device
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DEVICE_TYPE_UNKNOWN - Unknown Device Type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CANCELED_BY_USER - Canceled by User
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal Error in Function Module
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DEVICE_TYPE_BAD - Unsuitable Output Device Type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SIZE_MISMATCH - Number of Bytes Does Not Match Table Size
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RSPO_OUTPUT_DEVICEDATA Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_rqid | TYPE TSP01-RQIDENT, " | |||
| lv_pages | TYPE RSPOTYPE-PAGES, " 1 | |||
| lt_device_data | TYPE STANDARD TABLE OF RSPOTYPE, " | |||
| lv_device_unknown | TYPE RSPOTYPE, " | |||
| lv_rqtitle | TYPE RSPOTYPE, " ' ' | |||
| lv_device_type_unknown | TYPE RSPOTYPE, " | |||
| lv_device | TYPE TSP03-PADEST, " ' ' | |||
| lv_canceled_by_user | TYPE TSP03, " | |||
| lv_size | TYPE TSP03, " 0 | |||
| lv_internal_error | TYPE TSP03, " | |||
| lv_datatype | TYPE TSP03, " 'RAW' | |||
| lv_device_type_bad | TYPE TSP03, " | |||
| lv_immediately | TYPE PRI_PARAMS-PRIMM, " | |||
| lv_size_mismatch | TYPE PRI_PARAMS, " | |||
| lv_location | TYPE PRI_PARAMS. " 'db' |
|   CALL FUNCTION 'RSPO_OUTPUT_DEVICEDATA' "Spool Output Control of an Internal Table with Formatted Data |
| EXPORTING | ||
| PAGES | = lv_pages | |
| RQTITLE | = lv_rqtitle | |
| DEVICE | = lv_device | |
| SIZE | = lv_size | |
| DATATYPE | = lv_datatype | |
| IMMEDIATELY | = lv_immediately | |
| LOCATION | = lv_location | |
| IMPORTING | ||
| RQID | = lv_rqid | |
| TABLES | ||
| DEVICE_DATA | = lt_device_data | |
| EXCEPTIONS | ||
| DEVICE_UNKNOWN = 1 | ||
| DEVICE_TYPE_UNKNOWN = 2 | ||
| CANCELED_BY_USER = 3 | ||
| INTERNAL_ERROR = 4 | ||
| DEVICE_TYPE_BAD = 5 | ||
| SIZE_MISMATCH = 6 | ||
| . " RSPO_OUTPUT_DEVICEDATA | ||
ABAP code using 7.40 inline data declarations to call FM RSPO_OUTPUT_DEVICEDATA
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single RQIDENT FROM TSP01 INTO @DATA(ld_rqid). | ||||
| "SELECT single PAGES FROM RSPOTYPE INTO @DATA(ld_pages). | ||||
| DATA(ld_pages) | = 1. | |||
| DATA(ld_rqtitle) | = ' '. | |||
| "SELECT single PADEST FROM TSP03 INTO @DATA(ld_device). | ||||
| DATA(ld_device) | = ' '. | |||
| DATA(ld_datatype) | = 'RAW'. | |||
| "SELECT single PRIMM FROM PRI_PARAMS INTO @DATA(ld_immediately). | ||||
| DATA(ld_location) | = 'db'. | |||
Search for further information about these or an SAP related objects