SAP QUEUE_PUT Function Module for Put data element into an open queue









QUEUE_PUT is a standard queue put SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Put data element into an open queue 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 queue put FM, simply by entering the name QUEUE_PUT into the relevant SAP transaction such as SE37 or SE38.

Function Group: SQUE
Program Name: SAPLSQUE
Main Program: SAPLSQUE
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function QUEUE_PUT 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 'QUEUE_PUT'"Put data element into an open queue
EXPORTING
* BUFFER = ' ' "Buffer with the data to be stored
LENGTH = "Length of data
NAME = "Queue Identifier
* STATE = 'S' "Begin/end indicator of a Unit

IMPORTING
POS = "Line item number in the Unit
SQLRC = "SQL Error Code
UNIT = "Unit number

EXCEPTIONS
BUFFER_ERROR = 1 INVALID_PARAMETER = 2 MEMORY_ERROR = 3 Q_ERROR = 4 SQL_ERROR = 5
.



IMPORTING Parameters details for QUEUE_PUT

BUFFER - Buffer with the data to be stored

Data type: APQD-VARDATA
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LENGTH - Length of data

Data type: APQD-TRANS
Optional: No
Call by Reference: No ( called with pass by value option)

NAME - Queue Identifier

Data type: APQD-QID
Optional: No
Call by Reference: No ( called with pass by value option)

STATE - Begin/end indicator of a Unit

Data type: APQI-QSTATE
Default: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for QUEUE_PUT

POS - Line item number in the Unit

Data type: APQD-BLOCK
Optional: No
Call by Reference: No ( called with pass by value option)

SQLRC - SQL Error Code

Data type: SY-SUBRC
Optional: No
Call by Reference: No ( called with pass by value option)

UNIT - Unit number

Data type: APQD-TRANS
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

BUFFER_ERROR - buffer area missing or too small

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_PARAMETER - invalid or missing parameter

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MEMORY_ERROR - internal error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Q_ERROR - internal error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SQL_ERROR - SQL error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for QUEUE_PUT 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_pos  TYPE APQD-BLOCK, "   
lv_buffer  TYPE APQD-VARDATA, "   SPACE
lv_buffer_error  TYPE APQD, "   
lv_sqlrc  TYPE SY-SUBRC, "   
lv_length  TYPE APQD-TRANS, "   
lv_invalid_parameter  TYPE APQD, "   
lv_name  TYPE APQD-QID, "   
lv_unit  TYPE APQD-TRANS, "   
lv_memory_error  TYPE APQD, "   
lv_state  TYPE APQI-QSTATE, "   'S'
lv_q_error  TYPE APQI, "   
lv_sql_error  TYPE APQI. "   

  CALL FUNCTION 'QUEUE_PUT'  "Put data element into an open queue
    EXPORTING
         BUFFER = lv_buffer
         LENGTH = lv_length
         NAME = lv_name
         STATE = lv_state
    IMPORTING
         POS = lv_pos
         SQLRC = lv_sqlrc
         UNIT = lv_unit
    EXCEPTIONS
        BUFFER_ERROR = 1
        INVALID_PARAMETER = 2
        MEMORY_ERROR = 3
        Q_ERROR = 4
        SQL_ERROR = 5
. " QUEUE_PUT




ABAP code using 7.40 inline data declarations to call FM QUEUE_PUT

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 BLOCK FROM APQD INTO @DATA(ld_pos).
 
"SELECT single VARDATA FROM APQD INTO @DATA(ld_buffer).
DATA(ld_buffer) = ' '.
 
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_sqlrc).
 
"SELECT single TRANS FROM APQD INTO @DATA(ld_length).
 
 
"SELECT single QID FROM APQD INTO @DATA(ld_name).
 
"SELECT single TRANS FROM APQD INTO @DATA(ld_unit).
 
 
"SELECT single QSTATE FROM APQI INTO @DATA(ld_state).
DATA(ld_state) = 'S'.
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!