Vous êtes sur la page 1sur 13

SMS Setting in SAP (SCOT Configuration for SMS)

HI All ,
Here i am sharing the procedure/configuration to send the message from SAP .
Go to T-code SCOT
You will see screen like this

Click on PAG and then create button on same screen

Provide detail as:


NODE: HTTP
Description: SMS Integration

Select HTTP Node

Provide URL provided by third party

Keep password this field blank as we have provided the same in URL itself

Provide maximum length of character allowed by service provider

Provide field address area as *

Provide the time in minutes or hours (depends )

Select Node is ready to Use

Now you can see HTTP service

HTTP Virtual host Configuration


Go to T-code SICF and select default host and then New Sub element

In Log-on tab provide user name and password for same client

Click on HANDLER List tab and provide the handler as shown below

Finally activate the service

HTTP Client proxy setting:


In same T-code SICF

In HTTP Log tab provide proxy detail

Maintain pager Service


Go to Client 000 and run t-code SA14
Provide detail as shown below
Pager Serv: BAL
Use :SMS Service

Go to SPRO in your customizing client


SAP Web Application Server Basis Services Address Management Define pager services

Provide detail
Pager serv : SMS
Pager service : SMS
Use : SMS Service

Composing a SMS
Go to T-code SBWP

Click on New Message

To monitor the process go to T-code SCOT here you can see 1 in waiting as we have given time
for 2 minutes it will send the message after 2 min only

Go to T-code SOST and here we can check the status of message

That's all now you can check you mobile phone for Message :)

Send SMS using OOPS CL_BCS


Pre-Requisties:
SMS service (Refer) .
1. Create a class

2. Create static public Method 'SEND_SMS' with below parameter.

METHOD send_sms.
DATA: send_request
DATA: text

TYPE REF TO cl_bcs.


TYPE bcsy_text.

DATA:
DATA:
DATA:
DATA:
DATA:
DATA:

document
sender
recipient
bcs_exception
sent_to_all
lp_sms_num
lv_senderid

TYPE REF TO cl_document_bcs.


TYPE REF TO cl_cam_address_bcs.
TYPE REF TO if_recipient_bcs.
TYPE REF TO cx_bcs.
TYPE os_boolean.
TYPE ad_pagnmbr,
TYPE adr6-smtp_addr.

DATA: o_user TYPE REF TO cl_sapuser_bcs.


*

TRY.
-------- create persistent send request -----------------------send_request = cl_bcs=>create_persistent( ).

*
*

-------- create and set document ------------------------------create document from internal table with text
APPEND i_sms_body TO text.
document = cl_document_bcs=>create_document(
i_type
= 'RAW'
i_text
= text
i_length = '12'
i_subject = '' ).

add document to send request


CALL METHOD send_request->set_document( document ).

--------- set sender ------------------------------------------lv_senderid = i_sender_id.

*
*
*

sender =

TRY.
cl_cam_address_bcs=>create_internet_address(
i_address_string = 'sap@chemnaol.com'
i_address_name
= lv_senderid
"'SAP-MM'
i_incl_sapuser
=
).
CATCH cx_address_bcs .
ENDTRY.

CALL METHOD send_request->set_sender


EXPORTING
i_sender = sender.
*

--------- add recipient (e-mail address) ----------------------lp_sms_num = i_sms_to.


recipient = cl_cam_address_bcs=>create_sms_address(
lp_sms_num ).

add recipient with its respective attributes to send request


CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express
= 'X'.

set immediate processing, instead of queues


send_request->set_send_immediately( 'X' ).

---------- send document --------------------------------------CALL METHOD send_request->send(


EXPORTING
i_with_error_screen = 'X'
RECEIVING

RESULT
IF sent_to_all = 'X'.

= sent_to_all ).

ENDIF.
COMMIT WORK.
CATCH cx_bcs INTO bcs_exception.
RAISE sms_sending_failed.
EXIT.
ENDTRY.
ENDMETHOD.
3.Then Call the method wherever you want.
zcl_send=>send_sms(
EXPORTING
*
i_sender_id
= 'CHEMANOL'
i_sms_body
=
i_sms_to
=
*
EXCEPTIONS
*
sms_sending_failed = 1
*
others
= 2
).
IF sy-subrc <> 0.
*
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Vous aimerez peut-être aussi