Skip to Content
-1

Sending SMS to mobile with English and Arabic from ABAP program

Nov 09, 2017 at 10:26 AM

109

avatar image

Hi All,

I am sending message to mobile from ABAP program.The english message is coming properly but arabic letters are in junk format like " E7H9*TWDH#J1".

My message format in string : اختبار Name 1234 09/11/2017

I am sending message in the above format.But after receiving the message it showing as " E7H9*TWDH#J1" Name 1234 09/11/2017

Helpful answer will be rewarded.

Regards,

Shabbir

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Roberto Vacca Nov 09, 2017 at 04:28 PM
0

Hi,

where are you receiving the message? How's the architecture? It's a codepage matter. You should transmit data in rawdata format and after that trying to convert it.

Hope to help

Show 8 Share
10 |10000 characters needed characters left characters exceeded

Hi Roberto,

Thanks for the reply.

I am receiving the message to mobile.The telecom service provider has given the URL with parameters.

Ex: "http://xxxxxxx.sendSMS?CustomerId=xxx&pwd=xxx&smstext=the message we are sending to mobile&date=xx/xx/xxxx".

There is no code page in the service provider URL.The english text is coming properly but arabic text is coming as

E7H9*TWDH#J1" Name 1234 09/11/2017.

0

Could you try manually the following URL to see whether you receive اختبار on your mobile :

http://xxxxxxx.sendSMS?CustomerId=xxx&pwd=xxx&smstext=%D8%A7%D8%AE%D8%AA%D8%A8%D8%A7%D8%B1&date=xx/xx/xxxx

(where the smstext is اختبار in Unicode characters encoded in UTF-8)

1

Hi Rossi,

Thanks for reply.

I have tried with your given inputs.It is working and message is coming in arabic format also.

May I know how to convert arabic text to %D8%A7%D8%AE%D8%AA%D8%A8%D8%A7%D8%B1.

Is there any function module to convert in unicode characters?

Kindly let me know.

Thanks,

Shabbir

0

SAP systems are usually Unicode (cf menu System->Status->flag "Unicode") i.e. character variables are stored in memory as Unicode characters. So, the question is what happened to your text between the original input and the sending by your program (how it was input, stored in database or any other medium, read from that medium, and sent).

0
oops, I forgot to provide the important answer :)

Use either:

DATA escaped TYPE string.
escaped = cl_http_utility=>escape_url( 'aé' ).
ASSERT escaped = 'a%c3%a9'.

Or:

DATA fields TYPE tihttpnvp.
DATA field TYPE ihttpnvp.
DATA querystring TYPE string.
field-name = 'pwd'.
field-value = 'xxx'.
APPEND field TO fields.
field-name = 'smstext'.
field-value = 'aé'.
APPEND field TO fields.
querystring = cl_http_utility=>fields_to_string( fields ).
ASSERT querystring = 'pwd=xxx&smstext=a%c3%a9'.
0
1

Thanks Sandra...It is working with your inputs.

Regards,

Shabbir

0

Thanks Sandra...It is working with your inputs.

Regards,

Shabbir

0