cancel
Showing results for 
Search instead for 
Did you mean: 

How to send SMS by using an action

Former Member
0 Kudos

Hello Sap CRM Gurus,

my requirement says that I have to send SMS by using an action, whenever a Status of an incident is achieved and a flag is marked.

What Kind of FM or Services can I use within this Scenario?

I know perfectly how to send e-mail. In fact in the past I have used successfully CRM_ERMS_MAIL_COMPOSE and CRM_ERMS_MAIL_SEND.

Do I have to use analogue FM or Services? Which ones are you suggesting?

Do I have to set up a Kind of formular? In this case should this Formular an E-Mail Formular or a Smart form be?

Thank you so much. I hope that someone of you have already implemented such kind of requirement.

Regards,

Andrea

Accepted Solutions (1)

Accepted Solutions (1)

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

Creating Action Profile (CRMC_ACTION_CONF)

In methods.

DATA: lcl_act_exe  type ref to cl_action_execute.

          lv_guid_ref          TYPE crmt_object_guid,

          lv_kind_ref          TYPE crmt_object_kind.

CALL METHOD lcl_action_execute->get_ref_object

     EXPORTING

       io_appl_object = io_appl_object

       ip_action      = ip_action

       ii_container   = ii_container

     IMPORTING

       ev_guid_ref    = lv_guid_ref 

       ev_kind_ref    = lv_kind_ref.

Hope it helpful,

Regards,

Venkat

Former Member
0 Kudos

Hi Venkat,

thank you for the answer, but I know this point, since I have already created an action.

I do not know how to assemble the SMS and then to send it.

Can you provide more useful pieces of advice?

Regards,

Andrea

Former Member
0 Kudos

Hi Andrea

Last time I checked there was no Native SMS Integration in SAP CRM, therefore you would need a 3rd party integrator to manage this.

Please correct me if I'm wrong on this.

With that in mind if you're running via an action then you're sending one message at a time, which is fine.

From prior experience we used some PI integration, we basically sent a 2 field string of information:

Mobile Number + Message:

Example: |+6412345678|Welcome to SAP CRM|

PI receives the message and passes to the 3rd Party integrator process.

There's other ways of doing this, but first you need to confirm how you're sending the SMS.

Regards

Arden

Former Member
0 Kudos

Hi Arden,

let me resuming your piece of advice:

third Party tool  for the Integration.

Indeed I need to send a message once shot, I would say, as the conditions of the action are checked and met.

Your Quote:"From prior experience we used some PI integration, we basically sent a 2 field string of information:

Mobile Number + Message:

Example: |+6412345678|Welcome to SAP CRM

It is ok, but I need to know whithin the action, how you are Assembling the message in order to send it.

When an E-Mail is sent, there is normally two parts: message assemble and message sending.

How does it work here, within an Action?

Then related to the theme SMS Integration, I was exepting from SAP something like a Standard WS to use/consume.

In any case your reply is positive, since I know something more now.

Best Regards,

Andrea


Former Member
0 Kudos

Hi Andrea

We used a custom RFC call to a Destination, the Destination being a Queue which the PI system is attached to.

So in your action you call this custom function module, passing the information which is needed to generate the required SMS, you can either send as 2 fields or 1 string of information, that's up to you.

The result is that an entry is then visible in Transaction SM58 which the PI system will pickup and push to the SMS Provider.

Hope this helps

Regards

Arden

Former Member
0 Kudos

Hi Arden,

many thanks for your answer. Now it starts becoming clear.

Just another question.

How did you define this custom RFC? Did you follow a standard one as model?

Thank you so much,

Regards,

Andrea

Former Member
0 Kudos

Hi Andrea

It was custom. code.

Here is a link which explains this process quite nicely

https://help.sap.com/saphelp_nwpi71/helpdata/en/22/042578488911d189490000e829fbbd/content.htm

Regards

Arden

Former Member
0 Kudos

Hi Arden,

many thanks for the anwer, but I know RFC fm.

I wanted just to understand the effort, to produce such a code.

Regards.

Andrea

Former Member
0 Kudos

Hi Andrea

If it takes you longer than 2 Hours you're doing it wrong

Regards

Arden

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Sample code.

DATA: http_client TYPE REF TO if_http_client .

  DATA: wf_string TYPE string ,

        result TYPE string.  

CONCATENATE

     'http://msg.com/GatewayAPI/rest?'

     'method=SendMessage&'

     'send_to='

     '0123456789'                  " Mobile no

     '&msg=Thank%20you%20for%20contacting%20Your%20call%20for%20Machine%20Model:%20'

     'Demo'                        " test

     ',%20Serial%20No.'

     '100'                         " serial no

     '%20has%20been%20registered%20and%20your%20Ticket%20No%20is%20'

     l_object_id

     '%20%20Dated:%20'

     l_posting_date_f

     '.%20Our%20Team%20Leader%20will%20shortly%20get%20in%20touch%20with%20you.%20For%20further%20enquires%20please%20contact%20our%20TOLL%20FREE%20NO%200&'

     'msg_type=TEXT&'

     'userid=20&'

     'auth_scheme=plain&'

     'password=xxx&'

     'v=1.1&'

     'format=text'

     INTO

     wf_string.

CALL METHOD cl_http_client=>create_by_url

      EXPORTING

        url                = wf_string

      IMPORTING

        client             = http_client

      EXCEPTIONS

        argument_not_found = 1

        plugin_not_active  = 2

        internal_error     = 3

        OTHERS             = 4.

Regards,

Venkat

CALL METHOD http_client->send

      EXCEPTIONS

        http_communication_failure = 1

        http_invalid_state         = 2.

CALL METHOD http_client->receive

      EXCEPTIONS

        http_communication_failure = 1

        http_invalid_state         = 2

        http_processing_failed     = 3.

    CLEAR result .

    result = http_client->response->get_cdata( ).

Message was edited by: VenkatRamesh V

Former Member
0 Kudos

Hi  VenkatRamesh,

many thanks for the sample code. Just a couple of question.

Is this the sample code of the RFM, that Arden was talking about?

With the following instruction that is not totally clear, I do believe that you are assembling the URL.

Can you just explain a little bit better, what kind of parameters are you passing?

CONCATENATE

     'http://msg.com/GatewayAPI/rest?'

     'method=SendMessage&'

     'send_to='

     '0123456789'                  " Mobile no

     '&msg=Thank%20you%20for%20contacting%20Your%20call%20for%20Machine%20Model:%20'

     'Demo'                        " test

     ',%20Serial%20No.'

     '100'                         " serial no

     '%20has%20been%20registered%20and%20your%20Ticket%20No%20is%20'

     l_object_id

     '%20%20Dated:%20'

     l_posting_date_f

     '.%20Our%20Team%20Leader%20will%20shortly%20get%20in%20touch%20with%20you.%20For%20further%20enquires%20please%20contact%20our%20TOLL%20FREE%20NO%200&'

     'msg_type=TEXT&'

     'userid=20&'

     'auth_scheme=plain&'

     'password=xxx&'

     'v=1.1&'

     'format=text'

     INTO

     wf_string.

I would like to use SCOT, but I think that your RFM call directly the service or URL.

Can you confirm?

Thank you so much,

Andrea


VenkatRamesh_V
Active Contributor
0 Kudos

Hi Andrea,

It will call directly  URL.

Eg:  http://enterprise.smsgupshup.com

Hope it helpful,

Regards,

Venkat

Answers (0)