Skip to Content
author's profile photo Former Member
Former Member

Regarding SMS via ABAP

hi all,

Can anybody give me sample code to send SMS on Mobile...........

Regards,

Imran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 14, 2007 at 07:34 AM

    Hi,

    Please check this code, This code i have copied from SDN forum may this will be useful.

    If useful please award points

    REPORT  y_sms_to_india620.
    
    
    DATA: http_client TYPE REF TO if_http_client .
    
    DATA: wf_string TYPE string ,
          result TYPE string ,
          r_str TYPE string .
    
    DATA: result_tab TYPE TABLE OF string.
    
    SELECTION-SCREEN: BEGIN OF BLOCK a WITH FRAME .
    
    PARAMETERS: mail(100) LOWER CASE,
                m_no(20) LOWER CASE ,
                m_mss(120) LOWER CASE.
    
    SELECTION-SCREEN: END OF BLOCK a .
    
    
    START-OF-SELECTION .
    
      CLEAR wf_string .
      CONCATENATE
      'http://www.webservicex.net/SendSMS.asmx/SendSMSToIndia?MobileNumber='
      m_no
      '&FromEmailAddress='
      mail
      '&Message='
      m_mss
      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.
    
      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( ).
      REFRESH result_tab .
      SPLIT result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
      LOOP AT result_tab INTO r_str.
        WRITE:/ r_str .
      ENDLOOP .
    

    aRs

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.