Skip to content

/AWS1/CL_SQS=>GETQUEUEURL()

About GetQueueUrl

The GetQueueUrl API returns the URL of an existing Amazon SQS queue. This is useful when you know the queue's name but need to retrieve its URL for further operations.

To access a queue owned by another Amazon Web Services account, use the QueueOwnerAWSAccountId parameter to specify the account ID of the queue's owner. Note that the queue owner must grant you the necessary permissions to access the queue. For more information about accessing shared queues, see the AddPermission API or Allow developers to write messages to a shared queue in the Amazon SQS Developer Guide.

Method Signature

IMPORTING

Required arguments:

iv_queuename TYPE /AWS1/SQSSTRING /AWS1/SQSSTRING

(Required) The name of the queue for which you want to fetch the URL. The name can be up to 80 characters long and can include alphanumeric characters, hyphens (-), and underscores (_). Queue URLs and names are case-sensitive.

Optional arguments:

iv_queueownerawsaccountid TYPE /AWS1/SQSSTRING /AWS1/SQSSTRING

(Optional) The Amazon Web Services account ID of the account that created the queue. This is only required when you are attempting to access a queue owned by another Amazon Web Services account.

RETURNING

oo_output TYPE REF TO /aws1/cl_sqsgetqueueurlresult /AWS1/CL_SQSGETQUEUEURLRESULT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_sqs~getqueueurl(
  iv_queuename = |string|
  iv_queueownerawsaccountid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_string = lo_result->get_queueurl( ).
ENDIF.