SAP OMS_QUERY_DEVICE Function Module for OMS Function for Querying Device Status and Queue via RFC (Prototype)
OMS_QUERY_DEVICE is a standard oms query device SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for OMS Function for Querying Device Status and Queue via RFC (Prototype) 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 oms query device FM, simply by entering the name OMS_QUERY_DEVICE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SEXT
Program Name: SAPLSEXT
Main Program: SAPLSEXT
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function OMS_QUERY_DEVICE 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 'OMS_QUERY_DEVICE'"OMS Function for Querying Device Status and Queue via RFC (Prototype).
EXPORTING
OSPRT = "
LOMS = "
IMPORTING
DEVSTATE = "
TABLES
QUEUE = "
EXCEPTIONS
NO_COMMAND = 1 COMMAND_EXECUTION_FAILED = 2 ILLEGAL_STRUCT_LENGTH = 3 ANSWER_FORMAT_ERROR = 4 NO_ANSWER = 5 LINE_COUNT_ERROR = 6 UNKNOWN_LOMS = 7 UNKNOWN_PRINTER = 8 NOT_SUPPORTED = 9
IMPORTING Parameters details for OMS_QUERY_DEVICE
OSPRT -
Data type: TSP03C-PAPROSNAMEOptional: No
Call by Reference: No ( called with pass by value option)
LOMS -
Data type: TSPLOMS-NAMEOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for OMS_QUERY_DEVICE
DEVSTATE -
Data type: SEXT_DSTATOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for OMS_QUERY_DEVICE
QUEUE -
Data type: SEXT_QUEUEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_COMMAND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
COMMAND_EXECUTION_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ILLEGAL_STRUCT_LENGTH -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ANSWER_FORMAT_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ANSWER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LINE_COUNT_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNKNOWN_LOMS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNKNOWN_PRINTER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_SUPPORTED - Operation Not Supported
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for OMS_QUERY_DEVICE 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_osprt | TYPE TSP03C-PAPROSNAME, " | |||
| lt_queue | TYPE STANDARD TABLE OF SEXT_QUEUE, " | |||
| lv_devstate | TYPE SEXT_DSTAT, " | |||
| lv_no_command | TYPE SEXT_DSTAT, " | |||
| lv_loms | TYPE TSPLOMS-NAME, " | |||
| lv_command_execution_failed | TYPE TSPLOMS, " | |||
| lv_illegal_struct_length | TYPE TSPLOMS, " | |||
| lv_answer_format_error | TYPE TSPLOMS, " | |||
| lv_no_answer | TYPE TSPLOMS, " | |||
| lv_line_count_error | TYPE TSPLOMS, " | |||
| lv_unknown_loms | TYPE TSPLOMS, " | |||
| lv_unknown_printer | TYPE TSPLOMS, " | |||
| lv_not_supported | TYPE TSPLOMS. " |
|   CALL FUNCTION 'OMS_QUERY_DEVICE' "OMS Function for Querying Device Status and Queue via RFC (Prototype) |
| EXPORTING | ||
| OSPRT | = lv_osprt | |
| LOMS | = lv_loms | |
| IMPORTING | ||
| DEVSTATE | = lv_devstate | |
| TABLES | ||
| QUEUE | = lt_queue | |
| EXCEPTIONS | ||
| NO_COMMAND = 1 | ||
| COMMAND_EXECUTION_FAILED = 2 | ||
| ILLEGAL_STRUCT_LENGTH = 3 | ||
| ANSWER_FORMAT_ERROR = 4 | ||
| NO_ANSWER = 5 | ||
| LINE_COUNT_ERROR = 6 | ||
| UNKNOWN_LOMS = 7 | ||
| UNKNOWN_PRINTER = 8 | ||
| NOT_SUPPORTED = 9 | ||
| . " OMS_QUERY_DEVICE | ||
ABAP code using 7.40 inline data declarations to call FM OMS_QUERY_DEVICE
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 PAPROSNAME FROM TSP03C INTO @DATA(ld_osprt). | ||||
| "SELECT single NAME FROM TSPLOMS INTO @DATA(ld_loms). | ||||
Search for further information about these or an SAP related objects