sms setting in sap

14
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:

Upload: patilamitsap

Post on 11-Nov-2015

67 views

Category:

Documents


12 download

DESCRIPTION

SMS Setting in ABAP

TRANSCRIPT

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: HTTPDescription: 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: BALUse :SMS Service

Go to SPRO in your customizing client

SAP Web Application Server Basis Services Address Management Define pager services

Provide detail

Pager serv : SMSPager 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 TYPE REF TO cl_bcs. DATA: text TYPE bcsy_text. DATA: document TYPE REF TO cl_document_bcs. DATA: sender TYPE REF TO cl_cam_address_bcs. DATA: recipient TYPE REF TO if_recipient_bcs. DATA: bcs_exception TYPE REF TO cx_bcs. DATA: sent_to_all TYPE os_boolean. DATA: lp_sms_num TYPE ad_pagnmbr, lv_senderid 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. * TRY. sender = cl_cam_address_bcs=>create_internet_address( i_address_string = '[email protected]' 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 = sent_to_all ). IF sent_to_all = 'X'. 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.