/AWS1/IF_PP2=>CARRIERLOOKUP()¶
About CarrierLookup¶
Returns information about a destination phone number, including whether the number type and whether it is valid, the carrier, and more.
Method Signature¶
METHODS /AWS1/IF_PP2~CARRIERLOOKUP
IMPORTING
!IV_PHONENUMBER TYPE /AWS1/PP2CARRIERLKUPINPPHONE00 OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_pp2carrierlookuprslt
RAISING
/AWS1/CX_PP2ACCESSDENIEDEX
/AWS1/CX_PP2INTERNALSERVEREX
/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_phonenumber TYPE /AWS1/PP2CARRIERLKUPINPPHONE00 /AWS1/PP2CARRIERLKUPINPPHONE00¶
The phone number that you want to retrieve information about. You can provide the phone number in various formats including special characters such as parentheses, brackets, spaces, hyphens, periods, and commas. The service automatically converts the input to E164 format for processing.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_pp2carrierlookuprslt /AWS1/CL_PP2CARRIERLOOKUPRSLT¶
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->carrierlookup( |string| ).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_e164phonenumbertype = lo_result->get_e164phonenumber( ).
lv_dialingcountrycodetype = lo_result->get_dialingcountrycode( ).
lv_isocountrycode = lo_result->get_isocountrycode( ).
lv_string = lo_result->get_country( ).
lv_mcctype = lo_result->get_mcc( ).
lv_mnctype = lo_result->get_mnc( ).
lv_string = lo_result->get_carrier( ).
lv_phonenumbertype = lo_result->get_phonenumbertype( ).
ENDIF.
Use CarrierLookup¶
Call the CarrierLookup operation to get information about a customer provided phone number, including if the number is valid. The service accepts phone numbers with various formatting characters and returns the number in E164 format.
DATA(lo_result) = lo_client->carrierlookup( |+1 (555) 555-5333| ).