/AWS1/IF_PP2=>SENDTEXTMESSAGE()¶
About SendTextMessage¶
Creates a new text message and sends it to a recipient's phone number. SendTextMessage only sends an SMS message to one recipient each time it is invoked.
SMS throughput limits are measured in Message Parts per Second (MPS). Your MPS limit depends on the destination country of your messages, as well as the type of phone number (origination number) that you use to send the message. For more information about MPS, see Message Parts per Second (MPS) limits in the End User Messaging SMS User Guide.
Method Signature¶
METHODS /AWS1/IF_PP2~SENDTEXTMESSAGE
IMPORTING
!IV_DESTINATIONPHONENUMBER TYPE /AWS1/PP2PHONENUMBER OPTIONAL
!IV_ORIGINATIONIDENTITY TYPE /AWS1/PP2TEXTMSGORIGINATIONID OPTIONAL
!IV_MESSAGEBODY TYPE /AWS1/PP2TEXTMESSAGEBODY OPTIONAL
!IV_MESSAGETYPE TYPE /AWS1/PP2MESSAGETYPE OPTIONAL
!IV_KEYWORD TYPE /AWS1/PP2KEYWORD OPTIONAL
!IV_CONFIGURATIONSETNAME TYPE /AWS1/PP2CONFSETNAMEORARN OPTIONAL
!IV_MAXPRICE TYPE /AWS1/PP2MAXPRICE OPTIONAL
!IV_TIMETOLIVE TYPE /AWS1/PP2TIMETOLIVE OPTIONAL
!IT_CONTEXT TYPE /AWS1/CL_PP2CONTEXTMAP_W=>TT_CONTEXTMAP OPTIONAL
!IT_DSTCOUNTRYPARAMETERS TYPE /AWS1/CL_PP2DSTCOUNTRYPARAMS_W=>TT_DSTCOUNTRYPARAMETERS OPTIONAL
!IV_DRYRUN TYPE /AWS1/PP2PRIMITIVEBOOLEAN OPTIONAL
!IV_PROTECTCONFIGURATIONID TYPE /AWS1/PP2PROTECTCONFIDORARN OPTIONAL
!IV_MESSAGEFEEDBACKENABLED TYPE /AWS1/PP2BOOLEAN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_pp2sendtextmsgresult
RAISING
/AWS1/CX_PP2ACCESSDENIEDEX
/AWS1/CX_PP2CONFLICTEXCEPTION
/AWS1/CX_PP2INTERNALSERVEREX
/AWS1/CX_PP2RESOURCENOTFOUNDEX
/AWS1/CX_PP2SERVICEQUOTAEXCDEX
/AWS1/CX_PP2THROTTLINGEX
/AWS1/CX_PP2VALIDATIONEX
/AWS1/CX_PP2CLIENTEXC
/AWS1/CX_PP2SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_destinationphonenumber TYPE /AWS1/PP2PHONENUMBER /AWS1/PP2PHONENUMBER¶
The destination phone number in E.164 format.
Optional arguments:¶
iv_originationidentity TYPE /AWS1/PP2TEXTMSGORIGINATIONID /AWS1/PP2TEXTMSGORIGINATIONID¶
The origination identity of the message. This can be either the PhoneNumber, PhoneNumberId, PhoneNumberArn, SenderId, SenderIdArn, PoolId, or PoolArn.
If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).
iv_messagebody TYPE /AWS1/PP2TEXTMESSAGEBODY /AWS1/PP2TEXTMESSAGEBODY¶
The body of the text message.
iv_messagetype TYPE /AWS1/PP2MESSAGETYPE /AWS1/PP2MESSAGETYPE¶
The type of message. Valid values are for messages that are critical or time-sensitive and PROMOTIONAL for messages that aren't critical or time-sensitive.
iv_keyword TYPE /AWS1/PP2KEYWORD /AWS1/PP2KEYWORD¶
When you register a short code in the US, you must specify a program name. If you don’t have a US short code, omit this attribute.
iv_configurationsetname TYPE /AWS1/PP2CONFSETNAMEORARN /AWS1/PP2CONFSETNAMEORARN¶
The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
iv_maxprice TYPE /AWS1/PP2MAXPRICE /AWS1/PP2MAXPRICE¶
The maximum amount that you want to spend, in US dollars, per each text message. If the calculated amount to send the text message is greater than
MaxPrice, the message is not sent and an error is returned.
iv_timetolive TYPE /AWS1/PP2TIMETOLIVE /AWS1/PP2TIMETOLIVE¶
How long the text message is valid for, in seconds. By default this is 72 hours. If the messages isn't handed off before the TTL expires we stop attempting to hand off the message and return
TTL_EXPIREDevent.
it_context TYPE /AWS1/CL_PP2CONTEXTMAP_W=>TT_CONTEXTMAP TT_CONTEXTMAP¶
You can specify custom data in this field. If you do, that data is logged to the event destination.
it_dstcountryparameters TYPE /AWS1/CL_PP2DSTCOUNTRYPARAMS_W=>TT_DSTCOUNTRYPARAMETERS TT_DSTCOUNTRYPARAMETERS¶
This field is used for any country-specific registration requirements. Currently, this setting is only used when you send messages to recipients in India using a sender ID. For more information see Special requirements for sending SMS messages to recipients in India.
IN_ENTITY_IDThe entity ID or Principal Entity (PE) ID that you received after completing the sender ID registration process.
IN_TEMPLATE_IDThe template ID that you received after completing the sender ID registration process.Make sure that the Template ID that you specify matches your message template exactly. If your message doesn't match the template that you provided during the registration process, the mobile carriers might reject your message.
iv_dryrun TYPE /AWS1/PP2PRIMITIVEBOOLEAN /AWS1/PP2PRIMITIVEBOOLEAN¶
When set to true, the message is checked and validated, but isn't sent to the end recipient. You are not charged for using
DryRun.The Message Parts per Second (MPS) limit when using
DryRunis five. If your origination identity has a lower MPS limit then the lower MPS limit is used. For more information about MPS limits, see Message Parts per Second (MPS) limits in the End User Messaging SMS User Guide..
iv_protectconfigurationid TYPE /AWS1/PP2PROTECTCONFIDORARN /AWS1/PP2PROTECTCONFIDORARN¶
The unique identifier for the protect configuration.
iv_messagefeedbackenabled TYPE /AWS1/PP2BOOLEAN /AWS1/PP2BOOLEAN¶
Set to true to enable message feedback for the message. When a user receives the message you need to update the message status using PutMessageFeedback.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_pp2sendtextmsgresult /AWS1/CL_PP2SENDTEXTMSGRESULT¶
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->sendtextmessage(
it_context = VALUE /aws1/cl_pp2contextmap_w=>tt_contextmap(
(
VALUE /aws1/cl_pp2contextmap_w=>ts_contextmap_maprow(
value = new /aws1/cl_pp2contextmap_w( |string| )
key = |string|
)
)
)
it_dstcountryparameters = VALUE /aws1/cl_pp2dstcountryparams_w=>tt_dstcountryparameters(
(
VALUE /aws1/cl_pp2dstcountryparams_w=>ts_dstcountryparameters_maprow(
key = |string|
value = new /aws1/cl_pp2dstcountryparams_w( |string| )
)
)
)
iv_configurationsetname = |string|
iv_destinationphonenumber = |string|
iv_dryrun = ABAP_TRUE
iv_keyword = |string|
iv_maxprice = |string|
iv_messagebody = |string|
iv_messagefeedbackenabled = ABAP_TRUE
iv_messagetype = |string|
iv_originationidentity = |string|
iv_protectconfigurationid = |string|
iv_timetolive = 123
).
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_messageid( ).
ENDIF.