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 through Program

Former Member
0 Likes
1,214

Hello Experts,

i need to send SMS through my ZProgram which is used to accept pyments and generate receipts. i am having a web service to send SMS. The SMS can send through this service by posting a URL.

i can post a URL through FM 'PRGN_URL_GENERATION' but it opens a new browser window.

Now, my problem is that i don`t want to open a new window or users to see it.

or if there are any other way to send SMS through URL POST method.

Please Help.

Thanks and regards

Krishan Kumar Birmiwala.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,048

Hi,

Kindly go through this link below:

/people/durairaj.athavanraja/blog/2005/07/12/send-sms-to-india-from-abap

Hope it helps

Regards

Mansi

8 REPLIES 8
Read only

Former Member
0 Likes
1,049

Hi,

Kindly go through this link below:

/people/durairaj.athavanraja/blog/2005/07/12/send-sms-to-india-from-abap

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
1,048

Hi...

First make WSDL file of that webservice

then make Client Proxy to use that service

then create one logical port which that Client Proxy will use.

then use following sample code to use that client proxy method..




DATA : RI_CLIENTPROXY TYPE REF TO ZBICO_SERVICE_SOAP,
       RI_PAYLOAD_PROTOCOL TYPE REF TO IF_WSPROTOCOL_PAYLOAD,
       RI_PAYLOAD TYPE REF TO IF_WS_PAYLOAD,
       RI_SYS_EXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.

CREATE OBJECT <proxy name>.

            RI_PAYLOAD_PROTOCOL ?= <proxy name>->GET_PROTOCOL( IF_WSPROTOCOL=>PAYLOAD ).
            RI_PAYLOAD_PROTOCOL->SET_EXTENDED_XML_HANDLING( 'X' ).

           
            CALL METHOD RI_CLIENTPROXY-><Method which you are calling from web serevice>
              EXPORTING
                INPUT  = <pass Parameters>.
             

  CATCH CX_AI_SYSTEM_FAULT INTO RI_SYS_EXCEPTION.

  ENDTRY.

Hope this will helpful to you.

Regards,

Chintan

Read only

0 Likes
1,048

Dear Chintan,

Thankx for ur response,

As im new to ABAP programming, i am unable to follow the steps suggested by you. Please suggest in detail how to perform the steps.

Thanx n regards.

Read only

Former Member
0 Likes
1,048

Check this link ...........it will be helpful fr you

/people/durairaj.athavanraja/blog/2005/07/12/send-sms-to-india-from-abap

Read only

Former Member
0 Likes
1,048

Hi....

First create WSDL file of your webservice.....( or you can also create client proxy for webservices )

then Go To SE80

then select Package name in which u are suppose to work

then Right click on Enterprise service

then right click on Client Proxies and then create

You have local WSDL file so select local file selection

then select file from local file with browse

then select package name and give prefix name

then save and activate it. ( note down abap name ).

now go in lpconfig transaction

then here give ur proxy class which you have created earlier ( noted abap name )

then select logical port which you have given name same as ( noted abap name )

now select as default port and then select message id and state management check box in application spec. settings.

then save and activate it.

now use following code to use in abap program..



DATA : RI_CLIENTPROXY TYPE REF TO <client proxy which you have created>,
          RI_PAYLOAD_PROTOCOL TYPE REF TO IF_WSPROTOCOL_PAYLOAD,
          RI_PAYLOAD TYPE REF TO IF_WS_PAYLOAD,
          RI_SYS_EXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.
 
CREATE OBJECT <desired proxy name>.
 
            RI_PAYLOAD_PROTOCOL ?= <desired proxy name>->GET_PROTOCOL( IF_WSPROTOCOL=>PAYLOAD ).
            RI_PAYLOAD_PROTOCOL->SET_EXTENDED_XML_HANDLING( 'X' ).
 
           
            CALL METHOD RI_CLIENTPROXY-><Method which you are calling from web serevice which will be used for send sms>
              EXPORTING
                INPUT  = <pass Parameters - its depend you on your method>.
             
 
  CATCH CX_AI_SYSTEM_FAULT INTO RI_SYS_EXCEPTION.
 
  ENDTRY.

Hope this will helpful to you....

Regards,

Chintan.

Read only

Former Member
0 Likes
1,048

Thanx guyz for your help and support.

Read only

Former Member
0 Likes
1,048

Hello,

REPORT y_send_sms.

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 .

Read only

0 Likes
1,048

I felt you referred the below thread..

if you repeat it again and again, There is only one thing we can do to stop you..So please Don't make us to proceed in different way..