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

SAPUI5 application calling RFC directly

Is there a way for an SAPUI5 application to consume an RFC directly? if not perhaps a SOAP web service?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Mar 05, 2013 at 04:54 PM

    Hi Kelly,

    I posted this today in order to explain the code Gavin is referring to:

    http://scn.sap.com/community/abap/connectivity/blog/2013/03/05/json-adapter-for-abap-function-modules

    That could be what you're looking for.

    Cheers,

    César.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2012 at 12:37 PM

    Hi,

    SAPUI5 is in its core a HTML5+ Javascript framework.

    So if you want to consume an RFC, you need to have a javascript framework which allows this.

    I do not believe such a framework exist.

    If your SAPUI5 application is running on a Java based web application server (such as SAP NW Java AS or sapnwncloud ), then it is possible to use the JCO java library to perform the connection on the server side. Then you could include the data through a JSP as @Abilash gamp suggest, or you could expose a REST API for sapui5 to easily consume (with JSONModel).

    It is possible to call webservices from Javascript but it is not a common practice.

    See this stackoverflow thread for more information http://stackoverflow.com/questions/124269/simplest-soap-example-using-javascript

    After executing the webservice from javascript, you should create a JSONModel or an XMLModel with the contents of the response.

    Regards

    Dagfinn

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 07, 2012 at 12:58 AM

    Hi Kelly,

    You can use JSP with SAPUI5 library to call a Web Service or RFC i.e., traditional way.

    Thanks

    Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      I am using the following code to call the jsp page:

      $.ajax({

      url : "test.jsp",

      data : "{'name':'abc','age':'20'}",

      contentType : "application/json",

      type : "POST",

      success : function(json) {

      alert("Hi, there is no problem!");

      },

      error : function(xhr, status) {

      alert("Sorry, there was a problem!");

      },

      complete : function(xhr,status) {

      alert("The request is complete!");

      }

      })

      I am getting the following error :

      500 (Unable to compile class for JSP Generated servlet error: org.apache.jasper.runtime.HttpJspBase cannot be resolved to a type Generated servlet error: org.apache.jasper.runtime.JspSourceDependent cannot be resolved to a type Generated servlet error: The method getPageContext(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) in the type JspFactory is not applicable for the arguments (test_jsp, HttpServletRequest, HttpServletResponse, null, boolean, int, boolean))

      Please help. I am using NWDS (NetWeaverDevelopmentStudio) and running on localhost.

      Thanks

      Preety

  • author's profile photo Former Member
    Former Member
    Posted on Mar 05, 2013 at 04:32 PM

    It's not quite as easy as you think, but it's possible.

    https://cw.sdn.sap.com/cw/groups/json-adapter-for-abap-function-modules

    You should convert your RFC to a REST-based web service. Then use AJAX to call it. You will need to consider security and SSO though.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 29, 2013 at 10:09 AM

    Much easier way is to use the standard SICF service /sap/bc/soap/rfc . It 'wraps' function modules, and converts the parameters to and from SOAP. Fairly easy to use jQuery to extract the results too.

    Not well documented!

    It's not perfect, but it's standard, needs no additional code, and works.

    Jon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2014 at 12:55 PM

    Hi Guys,

    I want to pass some parameters to WSDL service from SAPUI5 interface. Can somebody tell me how to do this. Thanks and best regards.

    Fahad

    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.