Connectivity of Java and SAP using JCO

Hi,
Using the example5 given along with the JCO package I was able to connect to Java from SAP. Can I use the same server for bi directional data transfer . That is I want to use the same server to recieve data from SAP and also I should be able to Send data to SAP from Java using the same server.
Regards ,
Nagaraju Donikena.

Hi,
You can use the same server for data sending and receiving.
You can also go through the following link for knowing more about JCO.
http://www.persistent.co.in/resource_center/
white_papers/Java_SAP_Integration.pdf
Thanks
Ritushree

Similar Messages

  • Error while connecting for Java to SAP

    Hi All,
    I am encountering the following error while connecting from Java to SAP through JCO:
    RFC_ERROR_LOGON_FAILURE: You are not authorized to logon to the target system
    I have checked the connection string and everything appears to be fine.
    Please let me know what the problem is.
    Regards,
    Rupesh.

    Hi rupesh,
    See this thread:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f3f93ee7-0c01-0010-2593-d7c28b5377c2
    Regards, Suresh KB

  • How to establish a connection from java to SAP Netwevare server

    Hi All,
    As per my requirement i need to create a connection from Java to SAP Netwevaer Server inorder to access the docs from KM. PLZ provide some sample code
    (I know how to connect from java to SAP R/3 syatem using JCo connector).
    Can anybody help me.
    ADV Thanks

    Look
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/6615ea90-0201-0010-be81-e7a300fdf212
    /people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis

  • Error while creating connection between Java and ABAP

    Experts
    I am getting the following error message when I am trying to test the connection between JAVA and ABAP systems.
    1. The system ID is valid
    2. The system was retrieved.
    3. The system object represents an SAP system
    4. The following parameters are valid: Web AS Protocol (http) Web AS Host Name (s09f71v06.svr.bankone.net:8100)
    5. The host name s09f71v06.svr.bankone.net was resolved successfully.
    6. The server s09f71v06.svr.bankone.net *could not be pinged* successfully.
    I have JAVA and ABAP on the same system. I am trying to establish a connection. I have checked all the settings and they looks fine. I have also pinged from other system to this server and the Ping works fine.
    Please do let m eknow where do I need to check for the errros or logs for the above error message.
    Appreciate your quick help.
    Mahesh

    Check the relevant services are test are active on the Backend system through SICF trransaction.
    Also make sure that default icm services are running.See note 517484.
    More important the connector test in the portal system should work properly,recheck the WAS path etc are correct.
    Regards
    Ajay

  • Since the IOS 5 update my iPad seems to run a lot slower connecting to websites and general use? Can anyone help?

    Since the IOS 5 update my iPad seems to run a lot slower connecting to websites and general use? Can anyone help?

    Digging a little deeper on here, and I've Cleared the Safari cache, and rebooted , so i'll see if it is any better!!!!!

  • How to integrate Microsoft and SAP using Web Services?

    Hi All
    How to integrate Microsoft and SAP using Web Services? If any one has document please send it to me. My id is [email protected]... Please
    Help me
    Best Regards
    Ravi Shankar

    Hi Ravi,
    This is for Customizing Email and Other Web Services.
    Create addresses
    The address maintenance of R/3 users is carried out either via the R/3 User Maintenance (Transaction SU01) or the Private office settings (Transaction SO12):
    Address --> Other communication...
    Selection of the required communication service.
    Enter address.
    Copy or save.
    b) Configuration of SAPconnect (Transaction SCOT)
    Set communication method
    4.0 + 4.5: Goto --> Customizing --> Communication methods
    as of 4.6: Settings --> Communication methods
    Set the method of the required communication service to the value 'SAPCONNECT' and save the setting.
    Customized the same for Internet mailing.
    C) If you want to Transfer Table Structure Values from SAP R/3 to Web Services then
           1. Create BAPI and Transfer whichever things you want.(Note: The Structure
               of BAPI should be similar to Web Structure (Datatypes).
           2. Create a BDC and Schedule it in the Background.
    Hope it helps you, Awaiting for the Reward Points.
    Thanks
    Subrato Chowdhury

  • I was trying to connect my ipad and iphone using icloud. After signing in on both devices I clicked merge. I went to check my calendar and all my events were gone. Is there any way I can get my events back?

    I was trying to connect my ipad and iphone using icloud. After signing in on both devices I clicked merge. I went to check my calendar and all my events were gone. Is there any way I can get my events back?

    Check to see if they are on your calendar on icloud.com.  If they aren't, all you can do is try to restore to your last backup, although it isn't clear that calendar events are included in the iCloud backup.

  • Connecting to SAP using JCO: Difference between SAP AS 7.3 & Other Servers

    Hi All,
    I am connecting to SAP system using jar sapjco3. I am able to connect to SAP system successfully. But I observed some difference in connection to SAP system between different servers.
    1. Using TOMCAT  6 and JBOSS 5.1
    While connection, when I call API from my code -
    JCoDestination  dest = JCoDestinationManager.getDestination(ANY_RANDOM_STRING);
    It works successfully and I am able to connect. ANY_RANDOM_STRING is any random RFC destination which is not present in     netweaver administrator -->  Configuration --> Destinations
    2. Using SAP Netweaver AS 7.3
    While connection, when I call API from my code -
    JCoDestination  dest = JCoDestinationManager.getDestination(ANY_RANDOM_STRING);
    It fails giving exception as
    com.sap.conn.jco.JCoException: (106) JCO_ERROR_RESOURCE: Destination SAP_SERVER does not exist.
    But when I replace ANY_RANDOM_STRING with an RFC destination name present  in  netweaver administrator -->  Configuration --> Destinations, it works successfully.
    So, my questions is
    When I give any random string as RFC destination in other servers, it is connecting to SAP and not in SAP AS?
    Is RFC destination always necessary for connection? If it is necessary, then why ANY_RANDOM_STRING  is working in other servers and not in SAP  netweaver AS ?
    Thanks & Regards,
    Anup

    Vivek,
        We have the WebAs 640 Java system running on a AIX server. I placed the following folder under classpath
    /usr/sap/<SAPSID>/JC**/j2ee/cluster/server/bin/ext/com.sap.mw.jco/sapjrfc.jar
    The error thrown is
    JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [Can't find library sapjcorfc  (libsapjcorfc.a or .so) in sun.boot.library.path or java.library.path
    sun.boot.library.path=/usr/java14_64/jre/bin
    java.library.path=/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:/usr/sap/RID/JC15/j2ee/os_libs:/usr/sap/RID/SYS/exe/run:/home/db2_mgr/sqllib/lib:/home/db2_mgr/sqllib/lib:/usr/lib:/usr/sap/RID/JC15/j2ee/os_libs:/usr/sap/RID/JC15/j2ee/os_libs:/usr/lib:/lib:/usr/sap/RID/SYS/exe/run:/home/db2_mgr/sqllib/lib:/home/db2_mgr/sqllib/lib]. java.library.path [/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:/usr/sap/RID/JC15/j2ee/os_libs:/usr/sap/RID/SYS/exe/run:/home/db2_mgr/sqllib/lib:/home/db2_mgr/sqllib/lib:/usr/lib:/usr/sap/RID/JC15/j2ee/os_libs:/usr/sap/RID/JC15/j2ee/os_libs:/usr/lib:/lib:/usr/sap/RID/SYS/exe/run:/home/db2_mgr/sqllib/lib:/home/db2_mgr/sqllib/lib]
    The problem is a search on libsapjcorfc.* only return dll files and no .so or .a files.
    Wondering how ISA loads the native libraries on AIX!
    Thx,
    Bharat.

  • Runtime exception while I connect to SAP using JCO

    I am getting this error when I am trying to write a Java DC Project using NWDS.
    I have added all the JCO API DC to my project and all the classes are available in that.
    I am getting runtime exception class not found - com.sap.mw.jco.JCO$Repository
    I am deploying the java dc in the SAP J2EE Server by making Java Lib DC & deploy that.
    Is it possible to connect to SAP R/3 from Java DC? or we need to have Portal Projects like PAR or Webdynpro only?
    I want to use Background Callable object using GP API here.

    Thank you Venkat. One more question - in one of my java library, I want to make a class a public part and I added as public part but it is not accessible from SAP Portal GP as Background callable object,  getting message: cannot find this class name
    Do you have any idea ?
    see my post:Custom Email Template in GP
    Thank you once again.

  • JCo connection between java and ABAP

    Hi,
    Any pointers for some good material on establishing JCo connection between ABAP and Java to execute ABAP FMs.
    Thanks and Regards
    Arpita Saxena

    Please find following link for your reference.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/85a483cb-0d01-0010-2990-c5168f01ce8a?quicklink=index&overridelayout=true]

  • Calls between salesforce and crm sap using jco

    Hi,
    My requirement is as follows:
    Tight integration of SFDC and SAP CRM in order to make Business Partners in sync across the systems. This will be a two way integration wherein any changes made to any business partner must be reflected in the other system upon batch/ real-time execution.
    I am currently using jco to interact with the crm sap system.
    What am i supposed to do from salesforce side in order to make the 2 systems talk?
    Regards
    Shilpi

    You should do a search on the XIF IDOC adapter in the CRM general and framework forum.  If you need more details on how to set this up, you can also read the documentation of the function module
    CRMXIF_PARTNER_SAVE
    Or look in the IMG at:
    CRM -> CRM Middleware ->Exchanging data with External components ->XIF Adapter Setup
    Take care,
    Stephen

  • SAP connectivity from Java to SAP 4.0

    Hi All,
    I am tried to send an IDOC(whose basic type, extension are known) to SAP system(ECC 6.0) using the SAP JCo API 3.0 and all works well.
    Now I used the same piece of code to connect to SAP 4.0 system but the following basic line of code has ran into a IDOCRUNTIMEEXCEPTIION
    doc = iDocFactory.createIDocDocument(iDocRepository, iDocType, iDocCymType);
    com.sap.conn.idoc.IDocRuntimeException: Unable to get metadata for MATMAS03 with extension YES2P_IEXT_MATMAS03: Function module "IDOCTYPE_READ_COMPLETE" not found.
    at com.sap.conn.idoc.jco.rt.SAPRepository.queryRootSegmentMetaData40(SAPRepository.java:1330)
    at com.sap.conn.idoc.jco.rt.SAPRepository.queryRootSegmentMetaData(SAPRepository.java:1122)
    at com.sap.conn.idoc.jco.rt.SAPRepository.getRootSegmentMetaData(SAPRepository.java:886)
    at com.sap.conn.idoc.rt.DefaultIDocDocument.<init>(DefaultIDocDocument.java:119)
    at com.sap.conn.idoc.rt.DefaultIDocDocument.<init>(DefaultIDocDocument.java:57)
    at com.sap.conn.idoc.jco.rt.JCoIDocDocument.<init>(JCoIDocDocument.java:58)
    at com.sap.conn.idoc.jco.rt.JCoIDocRuntime.createIDocDocument(JCoIDocRuntime.java:143)
    at com.sap.conn.idoc.jco.rt.JCoIDocRuntime.createIDocDocument(JCoIDocRuntime.java:32)
    at com.sap.conn.idoc.rt.DefaultIDocRuntime.createIDocDocument(DefaultIDocRuntime.java:228)
    at com.sap.conn.idoc.rt.DefaultIDocRuntime.createIDocDocument(DefaultIDocRuntime.java:24)
    at mxsapconnectorcore.actions.SendIDocToSap.executeAction(SendIDocToSap.java:76)
    at mxsapconnectorcore.actions.SendIDocToSap.executeAction(SendIDocToSap.java:38)
    at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57)
    at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457)
    at hC.b(SourceFile:207)
    at com.mendix.core.Core.execute(SourceFile:226)
    at ll.a(SourceFile:69)
    at mv.a(SourceFile:72)
    at mu.a(SourceFile:151)
    at mu.executeAction(SourceFile:98)
    at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:57)
    at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:457)
    at hC.b(SourceFile:207)
    at com.mendix.core.Core.execute(SourceFile:304)
    at com.mendix.core.Core.execute(SourceFile:280)
    at mxsapconnectorcore.actions.IDocOutputQueue.run(IDocOutputQueue.java:116)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.sap.conn.jco.JCoException: (104) JCO_ERROR_SYSTEM_FAILURE: Function module "IDOCTYPE_READ_COMPLETE" not found. (raised by system D10|hslsid10)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:677)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.execute(MiddlewareJavaRfc.java:1830)
    at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1120)
    at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:953)
    at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:936)
    at com.sap.conn.jco.rt.ConnectionManager.internalExecute(ConnectionManager.java:411)
    at com.sap.conn.idoc.jco.rt.SAPRepository$ConnectionProvider.execute(SAPRepository.java:1722)
    at com.sap.conn.idoc.jco.rt.SAPRepository$ConnectionProvider.access$100(SAPRepository.java:1671)
    at com.sap.conn.idoc.jco.rt.SAPRepository.queryRootSegmentMetaData40(SAPRepository.java:1256)
    ... 26 more
    Caused by: RfcException: [D10|hslsid10]
        message: Function module "IDOCTYPE_READ_COMPLETE" not found.
        Return code: RFC_SYS_EXCEPTION(3)
        error group: 104
        key: RFC_ERROR_SYSTEM_FAILURE
    Exception raised by D10|hslsid10
    at com.sap.conn.rfc.engine.RfcIoOpenCntl.RfcReceive(RfcIoOpenCntl.java:2038)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.execute(MiddlewareJavaRfc.java:1778)
    ... 33 more
    Caused by: com.sap.conn.rfc.exceptions.RfcGetException: Function module "IDOCTYPE_READ_COMPLETE" not found.
    at com.sap.conn.rfc.engine.RfcImp.ab_rfcerror(RfcImp.java:1148)
    at com.sap.conn.rfc.engine.RfcGet.ab_rfcget(RfcGet.java:120)
    at com.sap.conn.rfc.engine.RfcRcv.ab_rfcreceive(RfcRcv.java:33)
    at com.sap.conn.rfc.engine.RfcIoOpenCntl.RfcReceive(RfcIoOpenCntl.java:1980)
    ... 34 more
    Now my question is how do I create an IDOC(a blank one) using this API for 4.0 system which doesnt seem to have this function module OR does anyone know other method create IDOC using SAP JCo3.
    Please comment. Thanks in advance

    We are also still looking for an answer for this issue. The server in our case is running SAP 4.0 package 17 and the function (IDOCTYPE_COMPLETE_READ) only gets added in package 42. However the JCo connector page states it supports R/3 3.1 and newer, so is this a bug or is there an alternative function we could use?

  • Unable to connect to JAVA from SAP

    Hi
    My requirement is ABAP program should call java program through JCO. So i have created RFC destination in SAP machine.
    I have created the java and ABAP programs also for the same.
    After setting every thing I have executed a function module in ABAP which calls the java program.
    This call is executing successfully once or twice out of 10 attempts of execution of the ABAP program.
    I am getting below error
    "Bean Y_TEST_RFCnot found on host XXXXXXX, ProgId =XXXX:
    Can some one tell me why it is failing most of the times?
    Regards,
    Chaitanya.

    Hi thanks for responding back to me.
    I am already using unicode property. As i mentioned we are able to connect to RFC destination from ABAP program, but this connection is not consistent. Please check my server class (RFCServer_proj extends JCO.Server)constructor below.
    public  RFCServer_proj(String gwhost,String gwserv,String progid,IRepository repository)
                   super(gwhost,gwserv,progid,repository);
                   this.setProperty("jco.server.unicode", "1");
                   JCO.addServerExceptionListener(this);
    I am using another class to start the above server.  Please check my server start up code below
    private static RFCServer_proj serverConnections[] = new RFCServer_proj[20];
    public  static void  startServers()  {
    Experian_props props=new Experian_props();
    JCO.addClientPool(props.getProperty("jco_pool"),  20, props.getProperty("sap_client"), props.getProperty("sap_user") ,props.getProperty("sap_pwd")  ,props.getProperty("sap_language"),props.getProperty("sap_host") ,props.getProperty("sap_sysnum"));
    IRepository repository = JCO.createRepository("REP", props.getProperty("jco_pool"));
    for(int i=0;i<CONNECTIONS;i++){
            serverConnections <i> = new RFCServer_proj                                      (props.getProperty("gwhost"), props.getProperty("gwservice"),
                     props.getProperty("progid"),repository);
             serverConnections <i>.start();
    Here I am creating connection pool  of 20 and server instances also 20. Intially I used single server instance.... after increasing the instances to 20 then my days become somewhat good. Connection is successful for every RFC call.
    But is it correct way of doing?
    I have used SAP server name as gateway host, gateway service as "sapgw00".
    Do i need to set any thing in RFC destination?

  • XML data file links java and sap

    Hi ,
    Please help me this
    How to connect xml file to java into sap
    please send me sample scenario.
    in java i call the this sap function module  'BAPI_MAT_BOM_EXISTENCE_CHECK'.
    1. Check BOM existence with BAPI_MAT_BOM_EXISTENCE_CHECK
    2. Exit BOM diff if BOM doesn’t exist
    3. Read BOM structure with CSAP_MAT_BOM_READ
    4. Compare SAP BOM items incl. subitems to XML BOM items and subitems

    currently I use following methods tu opload and to transfor the xml into a string.
    * Method to create XML from data file
      CALL METHOD instance->import_from_file
        EXPORTING
          filename = gf_filename
        RECEIVING
          retcode  = ch_retcode.
    * Convert into XML-Stream
      CALL METHOD instance->render_2_string
    *  EXPORTING
    *    pretty_print = 'X'
        IMPORTING
        retcode      = ch_retcode
          stream       = lf_string .
    *    size         = .
    When I use read dataset the output of the xml is into an internal table where I have many lines depending on the XML data file, this means if my xml has 10lines the internal table of read dataset has also 10 lines but I need a string to make the transformation of the xml.

  • Calling external Java from ABAP using JCo?

    Does anyone know if one can use JCo to write a server application that can be called from ABAP.
    We are presently using JCo to communicate from Java to SAP.
    But we need to call an external Java program from within ABAP.
    Is this possible?
    Thanks for any input.
    Fred

    Hi Gregor,
    I was hoping you would reply to this -- these posted messages had been here for quite sometime now.
    Anyway, here's the case. Our Basis team is installing the JCo in our SAP development server. This is our first time to implement this technology, so no one has a clue at all.
    Got a couple of questions for you...
    1. What do we need the JDK for? Is it mainly for editing, running, and compiling java files (e.g. Example5.java)?
    2. Does the JDK need to be installed at the SAP server as well? Or it doesn't matter, as long as the java files will be accessible from where it was installed at?
    Thanks for any response!

Maybe you are looking for

  • Error When Refresh Formatted Data inside Excel Analyzer

    I have build a Excel template and load up this to the BI Publisher Server. When I call this template after the log in works fine. When I refresh the data normal it works also fine, but when I try to refresh formatted Data I get the error "Error: This

  • Ftp setup question

    sorry if this a repeat question, but i'm stumped. i've set up a number of sites previously, and never had a problem using the ftp with dw. my typical setup has been ftp host: ftp.mysite.com host directory: public_html/ username password never a probl

  • Cursor disappears in PS CS5 after OS10.8 upgrade

    Hello, I have a problem in Photoshop CS5 (v. 12.0.2) after ugrading my Mac system to Mountain Lion 10.8.1. I use a mouse (not wireless, also tried changing mouse). When I work with a picture using the brush tool and move the cursor to a palette or me

  • What's the best way to integrate third party shopping carts with ATG's (10.6)?

    Hi, We are using ATG (10.6) for our e-commerce platform and we have many other websites which try to engage the end user to buy our products. Those other websites are developed using different technologies but we would like to allow the visitor to cl

  • Motion 5.0.2 won't export, need help

    Hey everybody, so i am having this problem that when i hit export or i use command+E nothing happens, a window should scroll down with all the options and stuf, but instead nothing happens, i have a video explaining my problem better: http://www.yout