Call to Web Sevice in external system from SAP CRM

Hi,
I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
Can you please tell me:
1. What settings/object needs to be maintained in SAP in order to make this call.
2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
Please explain in detail
Thanks,
Mike

Mike,
You should honestly search the SDN site for consuming web services with ABAP.  There are some good examples.
However the general procedure is easy:
1.  Generate an ABAP proxy using the WSDL provided to you by the external program
2.  Configure an HTTP destination for the server of the web services (needed for HTTPS calls)
3.  Configure the logical port for the web service using lpconfig
4.  Write the abap code to call the webservice via the proxy.  Works very similar to FM call in my opinion.
To expose a webservice(bapi being called from outside) you need to do a little more work
1.  Create a web services for the RFC enabled function module via SE80
2.  Use wsadmin and wsconfig to make the service available
3.  Publish the service out to the UDDI as needed.
Once again this code is pretty well documented in the standard help and SDN.  Do a simple search on ABAP proxies and you will find what you need.
Take care,
Stephen

Similar Messages

  • Calling a web service in external system from SRM

    Hi folks,
    A web service is created in the external system and I need to access this web service from a BADI. Can you tell me how can I call this web service (the external system is giving me a URL) and how I'll get a return. Please let me know in detail.
    Thanks,
    Prem

    Prem,
    Hi. You can call the service via HTTP protocol. Pass them values (SET_DATA), and receive a response (GET_DATA), via xml/html.
    In your code you would need to create the xml data to pass them, and evaluate the returned xml.
    Process...
    Data setup
    1) Create the XML to send them
    Working with the external service
    2) Open the HTTP connection
    2a) cl_http_client=>create_by_url (IF_HTTP_CLIENT)
    2b) lr_client->authenticate
    3) Call the to send them the XML
    3a) lr_client->request->set_data
    3b) lr_client->send
    4) Call the lr_client->receive to return the response
    5) Close the connection lr_client->close
    Data evaluate
    6) Evaluation the returned XML and process.
    Hope this helps
    Cheers
    Rob
    Code example below.. (There are loads of SAP examples depending on which release you are on).
    Process the call to the HTTP client - logic copied from RSHTML01     *
    Open IF_HTTP_CLIENT
      call method cl_http_client=>create_by_url
        exporting
          url                = l_url
        importing
          client             = lr_client
        exceptions
          argument_not_found = 1
          plugin_not_active  = 2
          internal_error     = 3
          others             = 4.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                   with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          raising oops.
      endif.
    Authenticate the user
      if not g_int_type-usr is initial.
        move: g_int_type-usr      to l_user,
              g_int_type-password to l_password.
        call method lr_client->authenticate
          exporting
            username = l_user
            password = l_password.
      endif.
    Allow for Cookies
      lr_client->propertytype_accept_cookie = lr_client->co_enabled.
    Set the server protocol
      select single gsval into l_server_protocol
        from z77s0
          where grpid = c_grpid
          and   semid = c_server_protocol.
      if sy-subrc eq 0
      and not l_server_protocol is initial.
        move l_server_protocol to l_st_server_protocol.
        call method lr_client->request->set_header_field
          exporting
            name  = '~server_protocol'
            value = l_st_server_protocol.
      endif.
      Send out the XML
      Set body to XML data
        lr_client->request->set_data( g_xxml ).
        save_xml( i_role = cl_xml_document=>c_role_oreq ).
        l_request_length = xstrlen( g_xxml ).
      If Data is sent through then we need certain flags set
        lr_client->request->set_header_field(
                                   name = 'Content-Type'
                                   value = zcl_tem_bsp=>c_xml_content ).
        call method lr_client->request->set_header_field
          exporting
            name  = '~request_method'
            value = 'POST'.
      Set length of string to the header fields
        if not l_request_length is initial.
          move l_request_length to l_st_request_length.
          lr_client->request->set_header_field(
                                    name = 'content-length'
                                    value = l_st_request_length ).
        endif.
      Send the request
        call method lr_client->send
          exceptions
            http_communication_failure = 1
            http_invalid_state         = 2
            http_processing_failed     = 3
            http_invalid_timeout       = 4
            others                     = 5.
        check_for_error 'Send'.
      Receive the response
        call method lr_client->receive
          exceptions
            http_communication_failure = 1
            http_invalid_state         = 2
            http_processing_failed     = 3
            others                     = 4.
        check_for_error 'Receive'.
      Determined returned XML or HTML
        g_xxml = lr_client->response->get_data(  ).
      Determine the header fields for failure validation
        if lr_client->response->get_header_field( '~status_code' )
              between 200 and 299.
          save_xml( i_role = cl_xml_document=>c_role_ires ).
        else.
          l_status_code =
            lr_client->response->get_header_field( '~status_code' ).
          l_descript_1 =
            lr_client->response->get_header_field( 'error' ).
          l_descript_2 =
            lr_client->response->get_header_field( 'errortext' ).

  • Call to Web Sevice in External (non SAP) system from SAP CRM

    Hi,
    I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
    Can you please tell me:
    1. What settings/object needs to be maintained in SAP in order to make this call.
    2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
    Please explain in detail
    Thanks,
    Mike

    Hi Oliver,
    I have gone through the documentation and had been able to create a proxy object, uploaded the WSDL file (from local directory) and created logical port,
    However, when testing the service, I didn't received a sucess message but
    <CX_AI_SYSTEM_FAULT>
      <CODECONTEXT>Local</CODECONTEXT>
      <CODE>ERROR_WEBSERVICE_RUNTIME_INIT</CODE>
      <ERRORTEXT>Error when instantiating the Web service runtime (Error when initializing SOAP client application: ' error_text' )</ERRORTEXT>
      <LANGUAGE />
      </CX_AI_SYSTEM_FAULT>
      </cls:CX_AI_SYSTEM_FAULT>
    What might be the Problem ?

  • Call to webservice External (non sap) system from SAP CRM

    Hi,
    I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
    Can you please tell me:
    1. What settings/object needs to be maintained in SAP in order to make this call.
    2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
    Please explain in detail
    Thanks,
    Mike

    Hi,
    Check this
    Calling web service from ABAP - version 4.6C

  • Need to call up a webservice created in external system from SAP

    Hi folks,
    A web service is created in the external system and I need to access this web service from a BADI. Can you tell me how can I call this web service (the external system is giving me a URL) and how to capture the return value from the web service. Please let me know in detail.
    Thanks,
    Prem

    Hi,
    I have the same requirement and have created a new Proxy-Object, uploaded the WSDL file (locally) and Created a Logical port.
    In the Logical Port under the tab Call Parameter I've defined the URL of the web-service.
    Since I was not able to upload the WSDL by selecting the option URL/HTTP Destination due to error message "HTTP error (return code 400, message "ICM_HTTP_CONNECTION_FAILED")
    Message no. SPRX090" so uploaded the file locally.
    However, when testing the service, I didn't received a sucess message but:
    <CX_AI_SYSTEM_FAULT>
    <CODECONTEXT>Local</CODECONTEXT>
    <CODE> ERROR_WEBSERVICE_RUNTIME_INIT </CODE>
    <ERRORTEXT> Error when instantiating the Web service runtime (Error when initializing SOAP client application: ' error_text' ) </ERRORTEXT>
    <LANGUAGE />
    </CX_AI_SYSTEM_FAULT>
    </cls:CX_AI_SYSTEM_FAULT>
    What might be the Problem ?
    /Manik

  • Upload/Read Documents from SAP-CRM to/from SharePoint

    Hello ,
    We have a requirement to upload documents from SAP CRM to share point(select the document from the desktop and pass the data to sharepoint server) , the user should also be able to view the documents located in Sharepoint.
    There are web methods in SharePoint already developed which will allow the uploading of the documents and passing the location of the stored documents as URL back to CRM.
    Could any one please help me in the follwoing
    1. Configurations to do on SAP side for Calling the methods developed in Sharepoint.
    2. Configuration to pass the document from SAP CRM(Uploaded from desktop) to sharepoint.
    Thanks in advance

    Hi Ravi,
    We also have a similar requirement in which we need to read the document stored in an external server from SAP CRM. Can you please let me know know how you achieved this. I will know the exact path (URL) of the document. Using this is it possible to retrieve the content of the document.
    Regards,
    Sudha.

  • How to consume a webservice from sap crm

    Hi All,
    How to consume and access an external webservice from sap crm?
    Suggest me.
    Regards,
    Sanjani
    Edited by: Sanjani on Dec 6, 2010 3:09 PM
    Edited by: Sanjani on Dec 10, 2010 1:08 PM

    Please check the wiki link mentioned below. It will help you to an extent.
    http://wiki.sdn.sap.com/wiki/display/CRM/CreatingWebServiceinSAP+CRM
    Rg,
    Harshit

  • Calling FM in external system from XSLT

    Hi,
    I know that in XSLT interpreter provided by SAP supports calling function modules.
    I need to call FM in external system from XSLT in message mapping and its result insert into one of element result XML message.
    Do you think it is possible ?
    If so is available any documentation for that.
    Any help is appreciated.
    Thank you.
    Marian Morzol

    Hi Vijaya,
    this is very helpfull document for me. However I need some other explanation.
    Does it meen that I need to write "Helper java class" ( e.g. in text editor - Notepad) and deploy the source to to Entegration Engine directory or an Adapter Directory ( maybe using Visual Administrator).
    It is not clear for me.
    I have XI 3.0 running on Windows 2003 Professional so to copy some files to some folders should not be a problem but I need an exact guide what I have to do.
    Thank you.
    Marian

  • HTTP connection from OSB web service to external system via a Proxy Server

    Dear experts,
    May I know has anyone tried to use HTTP protocol to send a request from OSB web service to external system via a proxy server? Heard that we need to establish some sort of tunnel (socket) to talk to Proxy Server. Can you please any have sample code or configuration steps to share?
    Thank you very much!!

    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/global_resources.html#wp1137294
    Adding Proxy Servers
    Use the Summary of Proxy Servers page to add and configure Proxy Server resources and make them available in Oracle Service Bus as a system resource. You must be in an active session to configure or reconfigure Proxy Server resources.
    1. If you have not already done so, click Create to create a new session or click Edit to enter an existing session. See Using the Change Center.
    2. Select System Administration > Proxy Servers.
    3. Click Add.
    4. In the Name field, enter a name for the Proxy Server resource. This is a required field.
    5. In the Description field, enter a short description for the Proxy Server resource.
    6. In the Host-Port Parameters section, enter the following information:
    1. In the Server Host field, enter the host name or IP address of the Proxy Server. This is a required field.
    The Server Host name for the Oracle Service Bus proxy server must be identical to the server host name of the actual proxy server.
    2. In the Clear Text Port field, enter the Proxy Server clear-text port number.
    3. In the SSL Port field, enter the Proxy Server SSL port number. You must enter either a clear text or SSL port number.
    4. Click Add.
    You can configure multiple Proxy Servers for each Proxy Server resource. This enables Oracle Service Bus to perform load balancing and offer fault tolerance features for the Proxy Server resource.
    7. If the Proxy Server performs proxy authentication, enter a user name in the User Name field, and the associated password in the Password and Confirm Password fields.
    These fields are optional, and required only if the Proxy Server is secured.
    8. Click Save to create and save the Proxy Server resource in the current session.
    9. To end the session and deploy the configuration to the run time, click Activate under Change Center.

  • Fm for calling save dialouge box to save file in a system from sap

    fm for calling save dialouge box to save file in a system from sap
    Step by step of its usage pls,
    thank you,
    Regards,
    Jagrut BharatKumar Shukla

    hi
    FM is
    <b>POPUP_TO_DECIDE_LIST</b>
    USAGE:
    CASE r_ucomm.
    WHEN 'SAVE'.
    DATA: l_answer." no need to specify type
    DATA: t_spopli LIKE spopli OCCURS 0 WITH HEADER LINE.
    t_spopli-varoption = 'PDF'.
    APPEND t_spopli.
    t_spopli-varoption = 'EXCEL'.
    APPEND t_spopli .
    CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
             EXPORTING
    *          CURSORLINE               = 1
    *          MARK_FLAG                = ' '
    *          MARK_MAX                 = 1
    *          START_COL                = 0
    *          START_ROW                = 0
               textline1                = 'SELECT THE FORMAT OF THE OUTPUT'
    *          TEXTLINE2                = ' '
    *          TEXTLINE3                = ' '
               titel                    = 'SAVE AS'
    *          DISPLAY_ONLY             = ' '
            IMPORTING
              ANSWER                   =  l_answer
             tables
               t_spopli                 = t_spopli
            EXCEPTIONS
              NOT_ENOUGH_ANSWERS       = 1
              TOO_MUCH_ANSWERS         = 2
              TOO_MUCH_MARKS           = 3
              OTHERS                   = 4  .
           IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
           ENDIF.
    IF l_answer = '2'.
    CALL FUNCTION 'GUI_DOWNLOAD'
    endif.
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • How to call an EXE file on a remote system from SAP system?

    Hi Friends,
    I want to execute an EXE file existing on the remote system from SAP system. Could some one give me an idea of how to execute that?
    Thanx in advance,
    Ram

    Hi Ram,
    Try this
    SXPG_COMMAND_EXECUTE
    Reward if this helps,
    Satish

  • Calling an application written in C/C++ from SAP

    Hi
    I have a need to call an application written in C/C++ language in external system from RFC.Can anyone guide me how to do it.

    Try something like this:
    CALL FUNCTION 'WS_EXECUTE'
       EXPORTING
        DOCUMENT                 = ' '
         cd                       = 'c:\temp '
        COMMANDLINE              = ' '
        INFORM                   = ' '
         program                  = 'c:\temp\YourProgHere.exe'
        STAT                     = ' '
        WINID                    = ' '
        OSMAC_SCRIPT             = ' '
        OSMAC_CREATOR            = ' '
        WIN16_EXT                = ' '
        EXEC_RC                  = ' '
      IMPORTING
        RBUFF                    =
       EXCEPTIONS
         frontend_error           = 1
         no_batch                 = 2
         prog_not_found           = 3
         illegal_option           = 4
         gui_refuse_execute       = 5
         OTHERS                   = 6

  • Sending external email from SAP with following requirements...

    Hi All,
           I need to send external emails from SAP by meeting following requirements.
    1) With subject line more than 100 characters.
    2) No attachments, only body which has specific format (blueprint/layout) and would be amended often, hence code shouldn't be touched during amendments.
    3) Should be able to know the success/failure of mail sending at program level.

    Hi,
    The code below demonstrates how to send an email to an external email address
    *& Report  ZSENDEMAIL                                                  *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  zsendemail                    .
    PARAMETERS: psubject(40) type c default  'Hello',
                p_email(40)   type c default '[email protected]' .
    data:   it_packing_list like sopcklsti1 occurs 0 with header line,
            it_contents like solisti1 occurs 0 with header line,
            it_receivers like somlreci1 occurs 0 with header line,
            it_attachment like solisti1 occurs 0 with header line,
            gd_cnt type i,
            gd_sent_all(1) type c,
            gd_doc_data like sodocchgi1,
            gd_error type sy-subrc.
    data:   it_message type standard table of SOLISTI1 initial size 0
                    with header line.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Perform populate_message_table.
    *Send email message, although is not sent from SAP until mail send
    *program has been executed(rsconn01)
    PERFORM send_email_message.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
    perform initiate_mail_execute_program.
    *&      Form  POPULATE_MESSAGE_TABLE
          Adds text to email text table
    form populate_message_table.
      Append 'Email line 1' to it_message.
      Append 'Email line 2' to it_message.
      Append 'Email line 3' to it_message.
      Append 'Email line 4' to it_message.
    endform.                    " POPULATE_MESSAGE_TABLE
    *&      Form  SEND_EMAIL_MESSAGE
          Send email message
    form send_email_message.
    Fill the document data.
      gd_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      gd_doc_data-obj_langu = sy-langu.
      gd_doc_data-obj_name  = 'SAPRPT'.
      gd_doc_data-obj_descr = psubject.
      gd_doc_data-sensitivty = 'F'.
    Describe the body of the message
      clear it_packing_list.
      refresh it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      describe table it_message lines it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      append it_packing_list.
    Add the recipients email address
      clear it_receivers.
      refresh it_receivers.
      it_receivers-receiver = p_email.
      it_receivers-rec_type = 'U'.
      it_receivers-com_type = 'INT'.
      it_receivers-notif_del = 'X'.
      it_receivers-notif_ndel = 'X'.
      append it_receivers.
    Call the FM to post the message to SAPMAIL
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.
    endform.                    " SEND_EMAIL_MESSAGE
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
      wait up to 2 seconds.
      if gd_error eq 0.
          submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
      endif.
    endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Production Order and external system non-SAP

    Dear Friends,
    I need to send a Production Order to a external system no SAP, and upload the information back to SAP,
    SAP does something standard to accomplish this task?
    To send Production Order, I created an IDOC with report RCCLORD, this IDOC contains all information of a production order (AUFNR, WERKS,..) and all operations and materials. But I don't know how to process the information returned.
    Also I have read some information about the interface PP-PDC, but I don't know how to use it.
    Please, Can anyone tell me the best way to accomplish this task?
    this is the scenario:
    SAP R/3 -
    > Production Order -
    > External System
    External System -
    > Return information about Production Order -
    > SAP R/3
    Thanks!

    Hi,
    PP-PDC is for confirmations only, see further details
    http://help.sap.com/erp2005_ehp_05/helpdata/en/31/fcbd3411d411d3b6b60000e8359890/frameset.htm
    maybe usage of POI is an option for you. See details here
    http://help.sap.com/erp2005_ehp_05/helpdata/EN/1a/0e347b539911d1898b0000e8322d00/frameset.htm
    BR Sabine

  • Can I access Webi queries and Xcelsius dashboards from SAP portal?

    Hello,
    Can I access Webi queries and Xcelsius dashboards from SAP portal?  And how?
    Thanks

    Portal Part 1
    /people/ingo.hilgefort/blog/2010/03/29/sap-businessobjects-enterprise-sap-enterprise-portal--part-1-of-4
    Portal Part 2
    /people/ingo.hilgefort/blog/2010/03/30/sap-businessobjects-enterprise-sap-enterprise-portal-part-2-of-4
    Portal Part 3
    /people/ingo.hilgefort/blog/2010/04/08/sap-businessobjects-enterprise-sap-enterprise-portal--part-3-of-4
    Portal Part 4
    /people/ingo.hilgefort/blog/2010/04/21/sap-businessobjects-enterprise-and-sap-enterprise-portal--part-4-of-4
    Ingo

Maybe you are looking for

  • User ID and password Popup in Client proxy

    Hi Experts, I created a client proxy to consume a webservice.When i execute the proxy, it pops up for user id and password, i created one logiccal port also using tcode SOAMANAGER. during creation of the logical port, i entered teh user id adn passwo

  • How can I get the template( word rtf )  for PO – Printed Purchase Order ?

    I want to convert the "PO - Printed Purchase Order" report from Oracle rdf format to BI Publisher. I am looking for the template but could not find in UNIX. As per the Oracle blog, the template is available. Please see the URL : https://blogs.oracle.

  • ORADIM log error message

    newbie question, taking DBA course, but instructor can't help. fresh win2000 Pro install, default install of Oracle 8i Enterprise. the default DB installed was named MyOraDb. i am going thru the steps to create a new database named DB01. created the

  • Question  RAW support

    I just bought Canon S110 and I am not able to edit in RAW in my Elements 10.  What do I need to do to update so I can see my RAW photos?

  • SIM failures w/iOS7.0 & 7.02

    I have an iPhone 4s, upgraded to iOS7.0 then 7.02 and each time I got a SIM failure message and the phone would not connect to Verizon. Had to power down, remove the SIM card, wait 2 min then reinstall SIM. Only then did it connect to VZN.  Why is th