Consuming Web Service with WSDL file through BSP

...Previous

Step4:  Give the page name and description  

Step5:  Layout code:  

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:
content design="design2003" >
  <htmlb:page 
title="First page " >
    <htmlb:
form>

      <center>
      <htmlb:textView 
text   = "Mobile No"
                      design = 
"EMPHASIZED" />
      <htmlb:inputField 
id    = "mob"
                        
value = "<%= w_mobno %>"
                        
size  = "12" />
      <
br>
      <htmlb:textView 
text   = "Mail ID"
                      design = 
"EMPHASIZED" />
      <htmlb:inputField 
id    = "mail"
                        
value = "<%= w_mail %>" />
      <
br>
      <htmlb:textView 
text   = "Message"
                      design = 
"EMPHASIZED" />
      <htmlb:inputField 
id    = "msg"
                        
value = "<%= w_msg %>"
                        
size  = "12" />
      <
br>
             <
br>
      <htmlb:
button text    = "Send SMS"
                    
id      = "get"
                    
onClick = "OnInputProcessing" />
      
<%
  
if fl_flag eq 1.
      
%>
      
<%
  
if t_ou is not initial.
      
%>
         <
center>
      <
font face=verdana style="font-size:12px" color ="#228B22"<%= t_ou-SEND_SMSTO_INDIA_result-FROM_EMAIL_ADDRESS%>
      <
br><%= t_ou-SEND_SMSTO_INDIA_result-MOBILE_NUMBER%>
      <
br><%= t_ou-SEND_SMSTO_INDIA_result-PROVIDER%>
      <
br><%= t_ou-SEND_SMSTO_INDIA_result-STATE%>
      <
br><%= t_ou-SEND_SMSTO_INDIA_result-STATUS%> </b></h6></center>
      
<%
  
endif.
      
%>
      
<%
  
Endif.
      
%>

</center>
    </htmlb:
form>
  </htmlb:page>
</htmlb:
content>  

Step6:

OnInPutProcessing Code:  

* event handler for checking and processing user input and
* for defining navigation
data:
  w_event 
type ref to cl_htmlb_event,
  w_obj 
type ref to object,
  w_inputfield 
type ref to   cl_htmlb_inputfield.


call method cl_htmlb_manager=>get_event
  
exporting
    request = runtime->server->request
  receiving
    
event   = w_event.
case w_event->id.
when 'get'.
CALL METHOD cl_htmlb_manager=>get_data
      
EXPORTING
        request = runtime->server->request
        name    = 
'inputfield'
        
id      = 'mob'
      RECEIVING
        
data    = w_obj.
    w_inputfield ?= w_obj.
    w_mobno = w_inputfield->value.

    w_input = w_mobno.
    
clear w_obj.

CALL METHOD cl_htmlb_manager=>get_data
      
EXPORTING
        request = runtime->server->request
        name    = 
'inputfield'
        
id      = 'mail'
      RECEIVING
        
data    = w_obj.
    w_inputfield ?= w_obj.
    w_mail = w_inputfield->value.

    w_input = w_mail.
    
clear w_obj.

CALL METHOD cl_htmlb_manager=>get_data
      
EXPORTING
        request = runtime->server->request
        name    = 
'inputfield'
        
id      = 'msg'
      RECEIVING
        
data    = w_obj.
    w_inputfield ?= w_obj.
    w_msg = w_inputfield->value.

    w_input = w_msg.
       
clear w_obj.

data:
tv 
type REF TO ZTCO_SEND_SMSSOAP ,
t_in 
type  ZTSEND_SMSTO_INDIA_SOAP_IN,
t_in1 
type REF TO ZTSEND_SMSTO_INDIA_SOAP_IN,
t_inn 
like standard table of t_in.

                  
TRY.
                  
CREATE OBJECT tv
*                    EXPORTING
*                      logical_port_name  =
                      .
                  
CATCH cx_ai_system_fault .
                  
ENDTRY.

t_in-MOBILE_NUMBER = w_mobno.
t_in-FROM_EMAIL_ADDRESS = w_mail.
t_in-
MESSAGE = w_msg.*

APPEND t_in to t_inn.

TRY.
CALL METHOD tv->send_smsto_india
  
EXPORTING
    
input  = t_in
  
IMPORTING
    
output = t_ou
    .
 
CATCH cx_ai_system_fault .
 
CATCH cx_ai_application_fault .
ENDTRY.
if t_ou is not initial.
  fl_flag = 
1.
  
endif.

endcase.  

Page attributes:  

fl_flag       TYPE        I

t_ou         TYPE        ZTSEND_SMSTO_INDIA_SOAP_OUT

w_input   TYPE       STRING

w_mail      TYPE       ZTSEND_SMSTO_INDIA_SOAP_IN-FROM_EMAIL_ADDRESS

w_mobno TYPE      ZTSEND_SMSTO_INDIA_SOAP_IN-MOBILE_NUMBER

w_msg      TYPE      ZTSEND_SMSTO_INDIA_SOAP_IN-MESSAGE                   

OUPUT:

Give the mobile number, mailid and message and click on button.  

Output is as follows with the mobile-no, mailid, service provider, place and status of message (Message is delivered or not delivered)  

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image