Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Send SMS

Former Member
0 Likes
374

Hi

How to send a text message to mobile through abap code

is there any sample program is there

Edited by: Surendra Polamreddy on Sep 12, 2008 2:26 PM

1 ACCEPTED SOLUTION
Read only

bpawanchand
Active Contributor
0 Likes
338

Hi

Check this blog

Regards

Pavan

2 REPLIES 2
Read only

bpawanchand
Active Contributor
0 Likes
339

Hi

Check this blog

Regards

Pavan

Read only

Former Member
0 Likes
338

Hi, you can use FM 'SO_NEW_DOCUMENT_SEND_API1' or better SO_NEW_DOCUMENT_ATT_SEND_API1.

It is easy to use. Look to documentation of that FMs. Here is sample code.

report yca_sms_send.

parameters: sms_num type text20 obligatory.

parameters: subject type SO_OBJ_DES default sy-sysid.

parameters: sms_txt type text50 obligatory.

data: receivers like somlreci1 occurs 0 with header line,

objhead like solisti1 occurs 0 with header line,

objtxt like solisti1 occurs 0 with header line,

p_rec like receivers-receiver,

p_type like receivers-rec_type,

users like ywf_ea_user_task occurs 0 with header line.

data: count type i,

p_email(50),

doc_chng like sodocchgi1,

objcont like solisti1 occurs 5 with header line,

p_count(5).

start-of-selection .

clear receivers.

refresh receivers.

receivers-receiver+9 = 'SMS'.

receivers-receiver+13 = sms_num.

move 'K' to receivers-rec_type.

append receivers.

clear doc_chng.

doc_chng-obj_descr = subject. "Subject zpravy

doc_chng-obj_name = 'SMS'.

doc_chng-doc_size = strlen( doc_chng-obj_descr ).

refresh objtxt.

objtxt = 'SMS message'. "message

append objtxt.

call function 'SO_NEW_DOCUMENT_SEND_API1'

exporting

document_type = 'RAW'

document_data = doc_chng

commit_work = 'X'

tables

object_header = objhead

object_content = objtxt

receivers = receivers

exceptions

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

others = 99.

if sy-subrc ne 0.

message e208(00) with 'Error'.

endif.