Call rfc from Java Web application.

Hi:
I am new to SAP Java programming.
I am developing a java web application on SAP NW SP16.
I need to call a rfc and process the data to be displayed on a jsp page.
I have few questions...
1) Can I use the JCO destination created in thru wed dynpro content administrator, to connect to sap and execute the rfc/bapi?
2) How would I create and access the model (rfc)?
3) Are the required jar and dll(rfc32.dll ... ) files available on the server?
Any help would be greatly appreciated.
Thanks.

Hi,
   See the follwoing links which contains sample code to ceate JCO and execute BAPI.
http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
Kind Regards,
S.Saravanan.

Similar Messages

  • Sample Java code and detail to call RFC from Java clas developed in Eclipse

    Hi All,
    I am new to Java. I have downloaded Eclipse IDE  and planning to use for developing Java application to send data to SAP by calling RFC JCO Interface.
    I need a sample java code/tutorial step by step to create Java class for simple example to call RFC from Java.
    I have downloaded SAPJCO3 from service market place.
    Kindly help me to send steps involved to configure for JCO  with my Eclipse with JCO.
    Thanks in advance.
    Sharma

    Hi Sharma,
    Please have a look at [Example: Using Generated Proxies to Call Function Modules |http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm]
    JCo Exceptions : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/content.htm
    Hope it will helps
    Regards
    Arun

  • Call a method in VB dll from Java Web Application

    Hi,
    I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? And, if it is not possible with a tool, can you help me with an example of JNI using?
    Thank you
    Mary

    maria_eg wrote:
    I'm trying to call a method of a VB dll, from a web application developing with J2EE. Is it possible without JNI? Maybe using Runtime#exec() and rundll32.exe. Depends on the DLL which you want to call.
    And, if it is not possible with a tool, can you help me with an example of JNI using?JNI tutorial: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
    JNI forum: http://forum.java.sun.com/forum.jspa?forumID=52

  • How to call Xcelsius in Java Web application without OpenDoc

    Hi,
    We require to call Xcelsius Dashboard from a Java Web application. We cann't use OpenDoc function as result of some client preferences/restrictions
    Please let me know, what would be the other method to call the Xcelsius Dashboard from a Web application.
    Regards,
    Sachin

    Xcelsius docs are in swf format.  You could probably just host them without security and view with flash.

  • Can't connect to Oracle XE instance from Java web application

    I'm a long-time Java developer but can't figure this out.
    I've been pouring over the forum for over a week and can't
    find the solution that will let me connect.
    Hardware: Intel/Vista.
    DB: Oracle Express 10G.
    Application: Java web application (Jakarta Struts)
    Application Server: Tomcat 5.5
    I copied the latest JDBC driver from OTN into my app server's "/LIB" directory.
    I get no driver errors. ("ojdbc14.JAR)"
    I can connect locally from my TOAD client, using SYSTEM/PASSWORD/XE.
    My listeners seem to be OK.
    Depending on which connection string I use from my Java application,
    I get one of two messages.
    "ORA-01017: invalid username/password; logon denied"
    OR
    "Io exception: The Network Adapter could not establish the connection"
    ------------ lsnrctl status ---------------------------------------------------
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "XEXDB" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "XE_XPT" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    Service "xe" has 1 instance(s).
    Instance "xe", status READY, has 1 handler(s) for this service...
    The command completed successfully
    ------------ SOURCE CODE ------------------------------------------------------
    OracleDataSource ods = new OracleDataSource();
    ods.setURL(" jdbc:oracle:thin:@localhost");
    conn = ods.getConnection("system", "password");
    //ods.setURL("jdbc:oracle:thin:@rsosborn-PC:1521:XE");
    //conn = ods.getConnection("system", "password");
    String query = "select * from books;";
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery(query);

    Using the code you supplied I was able to reproduce your errors. I've adjusted it accordingly and can connect to one of my 10.2 test databases.
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    class Conn {
      public static void main (String args []) throws SQLException
        Connection conn = null;       
        OracleDataSource ods = new OracleDataSource();
        // ods.setURL(" jdbc:oracle:thin:@localhost:1521:TEST");
        // conn = ods.getConnection("scott", "tiger");
        ods.setURL("jdbc:oracle:thin:@localhost:1521:TEST");
        conn = ods.getConnection("scott", "tiger");
        Statement stmt = conn.createStatement();
        ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
        while (rset.next())
            System.out.println (rset.getString(1));   // Print col 1
        stmt.close();
    }There are several different ways to configure OracleDataSources:
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDBFDF
    So, hopefully it's just a mismatch config.

  • Call RFC from java (j2ee) /  call to j2ee from R/3

    hello
    i´ve browsed the forum for some time to find how to:
    1.) call ejb from r/3 system via rfc
    2.) call rfc enabled function modules on r/3 from within an j2ee enviroment
    but i didn´t quite get it, because i was a bit confused about all the mentionend techniques
    what i found out about
    1.) use ejb (session bean) and jndi; configure RFC-Engine Service (we use sap webas)
    2.) use jco / jca
        (or all rfc enables rfm´s are available as web service, but didn´t find anything about this)
    so my question:
    are these the preferred techniques to connect j2ee (webAS) <-> r/3; if not are there any others, maybe easier methods?
    and last but not least: are there any good online tutorials for this topic?
    thanks in advance
    franz

    Just as a short partial reply.
    The generic Java --> RFC method is JCO (it will work on older versions as well), you can think of it as a JDBC driver where R/3 is the database, it behaves very similar in many ways.
    EJB development on SAP WAS is really not any different from EJB development on any other J2EE server. The deploy tool is superb. very easy to use and the JNDI registry, etc. are standard stuff...
    ABAP to EJB calls, haven't looked at this in over a year now, but back then we did a Proof Of Concept based on information at http://help.sap.com and it did work indeed. The only thing was back then that you needed to do a few tweaks to get it to work properly.
    As mentioned above, look at the JCO examples and then you can ask more specific questions once you get stuck.
    Good Luck!
    Cheers,
    Kalle

  • Calling Reports from bc4j Web Application

    Hello:
    I want to call a report from my bc4j web application, basically I want the user to hit a button that
    will process a report, any examples of how this can be done or if it can be done.

    Hi Sheena,
    This really depends on what you want to do. Submitting a report to the Reports Server is simply running a url in some variant of the following format:
    http://<server>:<port>/reports/rwservlet?report=<reportName>&destype=cache&desformat=pdf
    (Take a look at the Reports documentation for all the options).
    The above will run the report and return the result to the browser in PDF format. If you just want to mail the output the URL would change to something like:
    http://<server>:<port>/reports/rwservlet?report=<reportName>&destype=mail&desformat=pdf&desname=<[email protected]>
    Robin.

  • Calling Tuxedo from java web service

    i am new to tuxedo,i have developed web service in javax-ws.now i want to call tuxedo server from my web service,please any one let me guide how to do such thing.
    if any one have any related information please share with me.its urgent.
    Thanking You

    Hi,
    Thanks for valuable information and quick response.
    I need more information on the same line. As all suggestion given by you required license assuming our component running in another JEE environment. Is there any option available which doesn't required any additional cost?
    If not can you provide estimate cost of license for below option.
    1. Jolt
    2. Salt
    3. JCA adapter of Tuxedo
    Awaiting for your reply. Thanks in advance.
    Regards,
    Kiran Sankpal
    Edited by: user12023492 on Feb 9, 2010 10:08 PM
    Edited by: user12023492 on Feb 9, 2010 10:08 PM

  • Unable to call HttpSevlet from java web server

    Hi , I have followed the tutorial given in jdeveloper,creating a Httpservlet. I followed the steps and tried calling the sevlet. I got 404 error. Can any one clarify how to view the web page outside Jdeveloper and how to configure JavaWebServer.

    U may require WindowsNT for this. Had similar problems with 98/95. Works well with NT.

  • Calling RFC from custom connector

    Hi,
    I am developing a custom connector for UWL to get tasks from 3rd party system.
    I need to call a RFC from backend SAP system to complete Input data for this 3rd party provider.
    I assume that I have to make an RFC call from getItems() method of connector.
    Any idea how to call a RFC from UWL custom connector code?
    Please help.
    Thanks & Regards,
    Amey

    Hello Karri,
    Yes, I am aware of two ways of calling RFCs from Java code.
    Normally, I use following approach to call RFCs from my other Portal Components (JSPDynpages): -
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile myProfile = myContext.getProfile();
    String sapSystem = myProfile.getProperty("SystemIdentifier");
    ISystemLandscapeWrapper landscapeWrapper = (ISystemLandscapeWrapper) UMFactory.getSystemLandscapeWrappers().get(0);
    ISystemLandscapeObject systemLandscapeObject = landscapeWrapper.getSystemByAlias(sapSystem);
    IJCOClientService clientService = (IJCOClientService) PortalRuntime.
    getRuntimeResources().getService(JCO_CLIENT);
    request.getNode().putValue(LOCALE_NODE_KEY,     Locale.ENGLISH);
    IJCOClientPoolEntry poolEntry = clientService.getJCOClientPoolEntry(sapSystem,request);
    JCO.Client client = poolEntry.getJCOClient();
    client.connect();
    IRepository repository = JCO.createRepository("repository", client);
    IFunctionTemplate functionTemplate = repository.getFunctionTemplate(Z_BAPI_EMP_GBU_GET);
    JCO.Function function = new JCO.Function(functionTemplate);
    JCO.ParameterList importList = function.getImportParameterList();
    importList.setValue("US", "OBJTYP");
    importList.setValue(request.getUser().getUniqueName(), "USRID");
    client.execute(function);
    JCO.ParameterList outputList = function.getExportParameterList();
    gbuCountryBean.setGbu(outputList.getString("GBU"));
    gbuCountryBean.setCountry(outputList.getString("COUNTRYCODE"));
    gbuCountryBean.setPersArea(outputList.getString("PERS_AREA"));
    gbuCountryBean.setCompanyCode(outputList.getString("COMPANYCODE"));
    When I tried implementing same in UWL custom connector, I am not able to get instance of 'request' object.
    Any hints/ideas on this?
    Hence as an temporary alternative, I wrote following to successfully execute RFC.
    mConnection = JCO.createClient(sapclient,  sapuser,
    sappassword,  "EN", saphost, sapsysnumber);
    mConnection.connect();
    mRepository = new JCO.Repository("GetLeaveRequestFlag", mConnection );
    IFunctionTemplate ftemplate = mRepository.getFunctionTemplate(Z_BAPI_CHECK_LR_TO_APPROVE);
    myFunction = new JCO.Function(ftemplate);
    JCO.Field OBJECT_TYPE = myFunction.getImportParameterList().getField("OBJECT_TYPE");
    OBJECT_TYPE.setValue("US");
    JCO.Field USERID = myFunction.getImportParameterList().getField("USERID");
    OBJECT_TYPE.setValue(p_userID);
    mConnection.execute(myFunction);
    JCO.Field leaveRequestFlag = myFunction.getExportParameterList().getField("FLAG_LEAVE_REQUEST_RECORD");
    mConnection.disconnect();
    But only catch here is that I need to create & maintain SAP logon credentials for a particular user manually.
    It is not possible to single sign on connector user into SAP system (like its done above).
    Any thoughts on this?
    Thanks & Regards,
    Amey

  • Example-- Call RFC from external Java Application

    Update: I need code example to call RFC from External Java application. Can onybody help me?                                                      
    RGDS
    RP
    hi all.
    i want to create my own log for each interface.
    i saw this blog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
    For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
    I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
    what i must do to get the error I see in monitor and assign it to Sub-Object??
    Rgds.
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra

    Hi,
    Oh, you are using ABAP mapping ......
    then use the following in ABAP mapping ..
    TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
    Regards
    Chilla

  • How to call a report from a web application

    Hi,
    I have a web server in wich is installed Reports 6i. My question is how can I call reports 6i to generate a pdf using a .rep file from my web application (built with java)?

    Hi,
    The below link will be very useful for one who need idea on calling Oracle Report from Java Application,
    http://www.oracle.com/technology/products/reports/htdocs/getstart/examples/reportswebservice/index.html
    Thanks & Rgds,
    M T

  • Calling RFCs from Webdypro application!!!!

    Can anybody show me a suitable example for calling rfc from webdynpro application.

    Hi steve,
    Look at this tutorial..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on accessing abap functions in web dynpro - 4.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on handling transactions with bapis in web dynpro - 5.htm
    Follow the steps provided in those documents.
    You can easily understand how to access ABAP functions from WebDynpro.
    Let me know if you need more help on this.
    Regards,
    Karthick

  • Call BW query from a Web application

    Hi,
    I am trying to call a BW query from a Web application. Could you please let me know how to pass the parameters to the query.
    Thanks,
    Rekha

    I don't know about db2 APIS, but you can use JDBC to connect to DB2 physical files/tables with the DB2 driver. You would need the jar file with the driver info though. I've done this with the webshpere appserver.
    import com.ibm.db2.jdbc.app.DB2Driver;
    Class.forName("com.ibm.db2.jdbc.app.DB2Driver");
    connectionVar = DriverManager.getConnection("jdbc:db2://SERVERNAME/LIBRARY", "user", "passwd");
    That's the basic info that will get you connected and then you can access any files or tables that are in that library with SQL. You would have to use the Java API though - statements, resulsets etc. Hope it helps.

  • Webservice call to XI Interface through SOAP Adapter from a Web application

    I  am getting  the following error, when I try to call the XI Interface using soap adapter from a web application.
    ERROR  :
    SystemError:
              <context>XIAdapter</context>
              <code>ADAPTER.JAVA_EXCEPTION</code>
              <text><![CDATA[
    com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException
    at some time i am getting the following error.
    faultCode: HTTP
    faultSubcode:
    faultString: (500)Internal Server Error
    faultActor:
    faultNode:
    faultDetail:
         {}:return code:  500
    &lt;SAP:Error&gt;&lt;SAP:Category&gt;XIServer&lt;/SAP:Category&gt;&lt;SAP:Code&gt;RCVR_DETERMINATION.NO_RECEIVER_CASE_BE&lt;/SAP:Code&gt;&lt;SAP:Stack&gt;No receiver could be determined&lt;/SAP:Stack&gt;&lt;/SAP:Error&gt;
         HttpErrorCode:500
    (500)Internal Server Error
    can any of  one help to resolve this.
    Thanks  in advance

    Ganie
    You are getting the exception at very first point of Pipeline Service i.e Receiver Determination, do compare the namespace, Sender Interface Name & Sender Service name with the payload you are sending from web-application, they must be exactly same.
    The best way to get the test payload is suggested in above reply.

Maybe you are looking for