Need help on JCo

Hi,
I am getting error message while running JCo java code. I followed the given steps in the installation guide. I know i did something wrong in this.
I created a folder C:\JCO and unzipped the downloaded JCo files librfc32.dll, sapjcorfc.dll and sapjco.jar.
Copied the file librfc32.dll from C:\JCO directory to C:\WINNT\SYSTEM32
Added the path c:\JCO\sapjco.jar; in the environmental variables. [I followed the following --> Right Click on My Computer --> Properties --> Advanced --> Environment Variables --> Edited the existing path and added with java path like C:\j2sdk1.4.2_05\bin;c:\JCO\sapjco.jar;].
After this I am trying to execute the following code. It is copiling without any problem and giving error message while run mode.
C:\JCO>java Bapi1
Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO$Structure
******java code*****
import com.sap.mw.jco.*;
public class Bapi1 extends Object {
   JCO.Client mConnection;
   JCO.Repository mRepository;
   public Bapi1() {
      try {
         // Change the logon information to your own system/user
         mConnection =
            JCO.createClient("020", // SAP client
              "myuserid", // userid
              "****", // password
              "EN", // language
              "myerp server host name", // application server host name
              "00"); // system number
        mConnection.connect();
        mRepository = new JCO.Repository("SAPJCo", mConnection);
      catch (Exception ex) {
        ex.printStackTrace();
        System.exit(1);
      JCO.Function function = null;
      JCO.Table codes = null;
      try {
         function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
         if (function == null) {
           System.out.println("BAPI_COMPANYCODE_GETLIST" +
                              " not found in SAP.");
           System.exit(1);
         mConnection.execute(function);
         JCO.Structure returnStructure =
           function.getExportParameterList().getStructure("RETURN");
         if (! (returnStructure.getString("TYPE").equals("") ||
                returnStructure.getString("TYPE").equals("S")) ) {
           System.out.println(returnStructure.getString("MESSAGE"));
           System.exit(1);
         codes =
           function.getTableParameterList().getTable("COMPANYCODE_LIST");
         for (int i = 0; i < codes.getNumRows(); i++) {
           codes.setRow(i);
           System.out.println(codes.getString("COMP_CODE") + '\t' +
                              codes.getString("COMP_NAME"));
      catch (Exception ex) {
        ex.printStackTrace();
        System.exit(1);
      try {
        codes.firstRow();
        for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
          function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
          if (function == null) {
            System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
                               " not found in SAP.");
            System.exit(1);
     function.getImportParameterList().
       setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
     function.getExportParameterList().
       setActive(false, "COMPANYCODE_ADDRESS");
     mConnection.execute(function);
     JCO.Structure returnStructure =
       function.getExportParameterList().getStructure("RETURN");
     if (! (returnStructure.getString("TYPE").equals("") ||
            returnStructure.getString("TYPE").equals("S") ||
            returnStructure.getString("TYPE").equals("W")) ) {
        System.out.println(returnStructure.getString("MESSAGE"));
     JCO.Structure detail =
       function.getExportParameterList().
       getStructure("COMPANYCODE_DETAIL");
     System.out.println(detail.getString("COMP_CODE") + '\t' +
                        detail.getString("COUNTRY") + '\t' +
                        detail.getString("CITY"));
  catch (Exception ex) {
    ex.printStackTrace();
    System.exit(1);
  mConnection.disconnect();
public JCO.Function createFunction(String name) throws Exception {
   try {
     IFunctionTemplate ft =
        mRepository.getFunctionTemplate(name.toUpperCase());
     if (ft == null)
       return null;
     return ft.getFunction();
   catch (Exception ex) {
     throw new Exception("Problem retrieving JCO.Function object.");
public static void main (String args[]) {
   Bapi1 app = new Bapi1();

Hi Venu,
You have to add the java library sapjco.jar to the java classpath instead of the system classpath. You can do this by adding the -cp or -classpath parameter to your java call. So then you would get:
java -classpath C:JCOsapjco.jar Bapi1
Hope this helps,
Johan

Similar Messages

  • Need help in JCO connection creation/maintanence.

    Hi,
       In our project we have EP system ( Java Stack).We need to form the JCO connection that is required to deploy the web dynpro applications.We have taken a couple of JCO connection which are already there  SAP_R3_HumanResources  & SAP_R3_HumanResources_Metadata.For SAP_R3_HumanResources_Metadata JCO connection the user existing is a dialog user,also not having sufficient authorization to access all DDIC functions.My question is that what authorization required to user in this case to access all DDIC functions?Also for SAP_R3_HumanResources JCO connection what all prerequisites we require?.In this environment CD2 ( Dev.SAP system) is acting as backend to production portal PP6 system.Please let me know if you want any more details from my side.

    Hi nileshshete
    I quote this from sap-img.com:
    There are many functions of DDIC user.
    For E.g.. When you configure TMS you won't be able to configure it using sap*. For this you need a user who has access to Data dictionary and ABAP repository Object like DDIC user or user with sap_all and sap_new permission.
    http://www.sap-img.com/basis/function-and-role-of-user-types.htm
    I think u need a user with sap_all premission.
    Hope it helps,
    Nitsan

  • Need help in creating webas abap system

    hi
    new to create jco and techinical system need help
    experts  i have few faqs on creating techinical system plz help me
    i have 4.7ee r/3  and portal 2004s  sp9
    wer can i find these values plz give me navigation
    SID ==  ?
    MESG SEVER PORT ===?
    to add application server
    application host name ==?
    application instance number ==?
    client number ==?
    logical client name ==?
    it is asking to select a software component wat we have to select to finish
    wen i gave some dummy values
    i get an error
    CIM_ERR_ALREADY_EXISTS: Instance already exists: SAP_BCApplicationServer.CreationClassName="SAP_BCApplicationServer",Name="C11.Number.00.HostName.rama"
    is it necessary to have WAS in r/3 to connect to portal plz explain

    i want to use jco
    but for that we need to create a techinical system
    i followed these steps for techinical system
    1 Step
    selected web as abap
    2nd step
    sid = PRD
    installation number== INITIAL
    database host name== super
    3rd step
    message server name = 3600+instance
    i took system number from sap gui(21)
    so i gave 3600+21=3621
    central application sever
    instance number ==21
    next pressed button -->add new logon group
    entered longon group == entered value
    which i found in t-code -smlg
    4th Step
    Add application server
    host == gave r/3 ip 198.168.0.2
    instance==21
    client number = 800
    logical client = left it empty
    5 th step
    selected one componenet and finished
    after this i created the jco
    1st Step general data
    name =test1
    client=800
    2nd step  j2ee cluster
    checked the box
    use local j2ee engine
    3rd step
    selected dictionary meta data
    4 th
    selected the techinical system
    5th
    user name -->sapuser
    pasww-->india
    pressed finish
    now i found the jco in green color
    but i pinged it 
    i got mesg
    ping failed

  • Need help in Mitigation...

    Hi , I have the CC 5.2 connected to single system and using GLOBAL ruleset.
    In backend i have created a role Z:CONFLICTING_ROLE and assigned to user ERIC.
    Now there are two risks in the role F030 and S027 , i have created two mitigating controls for them and have mitigated the risks at role level .
    When i run the report on the USER ERIC , it should show in there also as mitigated , but there is nothing in mitigation.
    I was under impression that roles once mitigated , users with be mitigated also, what is wrong here ? ?
    The option under Configuration :
    Risk Analysis ->Add Options -> Include Role/Profile Mitigating Controls in User Analysis
    is set to yes..
    Pls help me to resolve this issue.
    regds
    navdeep
    Edited by: navdeep pathania on Aug 25, 2008 11:02 PM

    navdeep,
    I was rather talking about the PFUD in the back-end system.
    But okay, if the synch with GRC is not working in the first place, then this issue should be addressed as well. However, that goes beyond this particular post 'Need help in Mitigation"
    In an attempt to help you : is your diamond shaped adapter green ? are you using the correct model in the JCO in terms of your release of backend system ? did you do a full sync or incremental ?
    for sure, this is your issue why the users are not mitigated through their assigned mitigated roles.
    succes
    sam

  • All Web Dynpros are down... I really need help.

    Hi. I really need help because our portal has serious problems since yesterday. All of them seem to be related to missing Jar files.
    After installing several SCA files using SDM (Software Deployment Manager) yesterday, all Web Dynpros stopped working (even SAP Dynpros such as User Management).
    I've been looking for solutions all day and can't find anything. Any help would be greatly appreciated. Here are the errors I get:
    All homemode Dynpros show the following error:
      java.lang.NoClassDefFoundError
        at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:168)
        at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:178)
        at com.sap.tc.webdynpro.services.sal.sl.core.SystemLandscapeInternal.getJCOClientConnectionUnMapped(SystemLandscapeInternal.java:62)
        at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker$1.fillSldConnection(DataTypeBroker.java:77)
        at com.sap.dictionary.runtime.ProviderFactory.internalResolveLogicalNameToJCODestination(ProviderFactory.java:437)
        ... 61 more
    For SAP's Dynpros, I get the following error:
       java.lang.NoSuchMethodError: com.sap.portal.activitydatacollector.ICollectorHook.isActive()Z
        at com.sap.portal.activityreport.ActivityReportHookInterface.updateADCAfterInteraction(ActivityReportHookInterface.java:176)
        at com.sap.portal.activityreport.ActivityReportHookInterface.onAfterInteraction(ActivityReportHookInterface.java:145)
        at com.sap.portal.activityreport.wdp.InternalActivityReportHookInterface.onAfterInteraction(InternalActivityReportHookInterface.java:128)
        at com.sap.portal.activityreport.wdp.InternalActivityReportHookInterface$External.onAfterInteraction(InternalActivityReportHookInterface.java:167)
        at com.sap.portal.pb.hook.PortalHooksManager.updateHooks(PortalHooksManager.java:58)
        ... 34 more

    I do have access to it.
    Here are two examples of errors/warnings we got a lot during the upgrade:
    Caused by: com.sap.engine.frame.core.locking.LockException: Cannot lock [2010112417061085000000portail......................3814850, DEPLOY_LOCK_AREA, sap.com/com.sap.lcr, X]; it is in use by the same owner. In case of lock mode "R" the lock propagation failed, because the optimistic lock is gone.
    Caught exception during application deployment from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Already started operation with application sap.com/com.sap.lcr in the cluster. No other operation with this application is allowed at the moment..
    Another thing that could help you understand my problem: when I log into Portal and go to Content Admin / Web Dynpro / Main JCO destinations, even if my destination's status is set to OK (green light), I get this Java error if I click on "test":
       java.lang.NoClassDefFoundError
        at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnection (SystemLandscapeFactory.java:150)
        at com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscape.getJCOClientConnection(WDSystemLandscape.java:30)
        at com.sap.tc.webdynpro.tools.explorer.JCOConnectionsDetails.onActionTestConnection(JCOConnectionsDetails.java:226)
        at com.sap.tc.webdynpro.tools.explorer.wdp.InternalJCOConnectionsDetails.wdInvokeEventHandler(InternalJCOConnectionsDetails.java:303)
        at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
        ... 28 more
    Thanks again.
    Edited by: Mathieu St-Gelais on Nov 29, 2010 3:13 PM

  • Need help to develop Pythagoras theorem-

    Hi i need help to develop proofs 2,3,4
    of pythagoras theorems in java as demonstrations
    These are applets can anyone help me with it or give me an idea of how to go about developing it -
    the site is the following
    http://www.uni-koeln.de/ew-fak/Mathe/Projekte/VisuPro/pythagoras/pythagoras.html
    then double click on the screen to make it start

    Pardon my ASCII art, but I've always liked the following, simple, geometric proof:
         a                   b
    ---------------------------------------+
    |       |                                |
    a|   I   |              II                |
    |       |                                |
    ---------------------------------------+
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    b|  IV   |              III               |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    |       |                                |
    ---------------------------------------+It almost goes without saying that I+II+III+IV == (a+b)^2, and II == IV == a*b,
    I == a*a and III == b*b, showing that (a+b)^2 == a^2+a*b+a*b+b^2.
    I hope the following sketch makes sense, stand back, ASCII art alert again:     a                   b
    ---------------------------------------+
    |               .             VI         |
    |     .                 .                |a
    | V                               .      |
    |                                        +
    |                                        |
    |   .                                    |
    b|                                     .  |
    |                                        |
    |                  IX                    |
    | .                                      |
    |                                    .   |b
    |                                        |
    +                                        |
    |      .                                 |
    a|               .                  . VII |
    |  VIII                   .              |
    ---------------------------------------+
                     a                    bThe total area equals (a+b)^2 again and equals the sum of the smaller areas:
    (a+b)^2 == V+VI+VII+VIII+IX. Let area IX be c^2 for whatever c may be.
    V+VII == VI+VIII == a*b, so a^2+b^2+2*ab= c^2+2*a*b; IOW a^2+b^2 == c^2
    Given this fundamental result, the others can easily be derived from this one,
    or did I answer a question you didn't ask?
    kind regards,
    Jos

  • I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?

    What file format did you export it to?

  • Need help to open audios attached in a PDF file

    Hello
    I just need help. I have ordered a reviewer online that has audios and texts in a pdf file. I was told to download the latest adobe reader on my computer. I have done the same thing on my ipad mini. I am not so technical with regards to these things. Therefore I need help. I can access the audios on my computer but not on my ipad.
    I want to listen to audios with scripts or texts on them so i can listen to them when i am on the go. I was also informed that these files should work in any device. How come the audios doesnt work on my ipad.
    Please help me on what to do.
    Thanks

    Audio and video are not currently support on Adobe Reader. :-<
    You need to buy a PDF reader that supports them. My suggestion is PDF Expert from Readdle ($US 9.99)

  • Need help to open and look for file by name

    Hi,
            Im needing help to open a folder and look for a file (.txt) on this directory by his name ... The user ll type the partial name of file , and i need look for this file on the folder , and delete it ....
    How can i look for the file by his name ?
    Thx =)

    Hi ,
        Sry ,, let me explain again ... I ll set the name of the files in the follow order ... Name_Serial_date_chanel.sxc ..
    The user ll type the serial that he wants delete ...
    I already figured out what i need guys .. thx for the help ^^
    I used List Directory on advanced IO , to list all .. the Name is the same for all ... then i used Name_ concateneted with Serial(typed)* .. this command serial* ll list all serials equal the typed , in my case , ll exist only one , cuz its a count this serial .Then i pass the path to the delete , and its done !
    Thx ^^

  • I need help, my ipod touch is not recognized by windows as a harddisk

    i need help, my ipod touch is not recognized by windows like a memory card or a harddisk.
    i would like to transfer the files from pc to my ipod touch without useing itunes.
    as i see theres some people here that theires ipod touch are recongnzed as a digitl camra, mine is reconzied as nothing, some help plz.
    Message was edited by: B0Om

    B0Om wrote:
    ok but i still dont understed, only my itnes recongnize my ipod, when i go to " my cumputer, it dosent show up there, not even as a digital camra
    Your Touch is working correctly. Currently, without unsupported third party hacks, the Touch has NO disc mode. It will only show up in iTunes.
    how do i put programes and games in my ipod touch
    Right now, you don't. The SDK is scheduled to be released in Feburary. Then developers will be able to write programs that will be loadable.

  • Weird error message need help..

    SO.. i havent updated my itunes in a while because i keep getting this weird message.. it comes up when im almost done installing the newest/newer versions of itunes. it says
    "the feature you are trying to use is on a network resource that is unavailable" "click ok to try again or enter an alternate path to a folder containing the installation package 'iTunes.msi' in the box below"
    now when ever i choose a file from the browse box it replies with this message "the file 'xxx' is not a valid installation package for the product iTunes. try to find the installation package iTunes.msi in a folder from which you can install iTunes."
    no idea need help thanks
    ~~~lake
    Message was edited by: DarkxFlamexCaster
    Message was edited by: DarkxFlamexCaster

    +it comes up when im almost done installing the newest/newer versions of itunes. it says+ +"the feature you are trying to use is on a network resource that is unavailable" "click ok to try again or enter an alternate path to a folder containing the installation package 'iTunes.msi' in the box below"+
    With that one, let's try the following procedure.
    First, head into your Add/Remove programs and uninstall your QuickTime. If it goes, good. If it doesn't, we'll just attend to it when we attend to iTunes.
    Next, download and install the Windows Installer CleanUp utility:
    Description of the Windows Installer CleanUp Utility
    Now launch Windows Installer CleanUp ("Start > All Programs > Windows Install Clean Up"), find any iTunes and/or QuickTime entries in the list of programs in CleanUp, select those entries, and click “remove”.
    Next, we'll manually remove any leftover iTunes or QuickTime program files:
    (1) Open Local Disk (C:) in Computer or whichever disk programs are installed on.
    (2) Open the Program Files folder.
    (3) Right-click the iTunes folder and select Delete and choose Yes when asked to confirm the deletion.
    (4) Right-click the QuickTime folder and select Delete and choose Yes when asked to confirm the deletion. (Note: This folder may have already been deleted if QuickTime was successfully removed using Add/Remove Programs earlier.)
    (5) Delete the QuickTime and QuicktimeVR files located in the C:\Windows\system32\ folder. Click Continue if Windows needs confirmation or permission to continue. (Note: These files may have already been deleted if QuickTime was successfully removed using Add/Remove Programs earlier.)
    (6) Right-click on the Recycle Bin and on the shortcut menu, click Empty Recycle Bin.
    (7) Restart your computer.
    Now try another iTunes install. Does it go through properly now?

  • I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    I got new hard driver for my MacBook I don't have the cd but I do have flash drive that has the software I need help because when I turn on my laptop it shows me a file with question mark how can I install the software from the flash driver?

    Hold down the Option key while you boot your Mac. Then, it should show you a selection of devices. Click your flash drive and it will boot from that.

  • Need help adobe bridge cc output module

    I need help. I have an assignment I'm held up on completing because the adobe cc bridge does not have the output modue I need. I followed the adobe instructions page to the letter. I copied and pasted the output module folder to the adobe bridge cc extensions folder in programs/commonfiles/adobe. The only thing is the instructions then say to paste the workspace file into the workspace folder located below the bridge extensions folder. I don't have a workspaces folder there or anywhere. I even tried must making one and adding the file to it, but no go. can someone PLEASE help me with this?    I have an assignment due like now that requires the use of the output modue.thanks!

    oh,my system is windows 8.1. sorry, lol.

  • Trying to create a Invoice based on Order need help Error -5002

    the dreaded -5002 error is haunting me too! and I could not find a matching solution for this in the forum....
    I need help quickly on this. I am trying to create invoices for some orders so the Base - Target relationship is retained. The orders I pick are all Open (DocStatus   = O and the lines are all Open LineStatus = O)
    here is my code
    oInvoice.Lines.BaseEntry = 48
    oInvoice.Lines.BaseLine = 0
    oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
    oInvoice.Lines.ItemCode = "A00001"
    oInvoice.Lines.ItemDescription = "IBM Infoprint 1312"
    'adding Line
    oInvoice.Lines.Add
    oInvoice.Lines.BaseEntry = 48
    oInvoice.Lines.BaseLine = 1
    oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
    oInvoice.Lines.ItemCode = "A00002"
    oInvoice.Lines.ItemDescription = "IBM Inforprint 1222"
    'adding Line
    oInvoice.Lines.Add
    lRetCode = oInvoice.Add
    If lRetCode <> 0 Then
        gObjCompany.GetLastError lErrCode, sErrMsg
        MsgBox (lErrCode & " " & sErrMsg)
    End If

    Indika,
    Only set your base types...
    (not items & description)
    oInvoice.Lines.BaseEntry = 48
    oInvoice.Lines.BaseLine = 0
    oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
    oInvoice.Lines.ItemCode = "A00001"
    oInvoice.Lines.ItemDescription = "IBM Infoprint 1312"
    'adding Line (to fill the second item line)
    ' the 1st line item is there by default
    oInvoice.Lines.Add
    oInvoice.Lines.BaseEntry = 48
    oInvoice.Lines.BaseLine = 1
    oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
    oInvoice.Lines.ItemCode = "A00002"
    oInvoice.Lines.ItemDescription = "IBM Inforprint 1222"
    'DO NOT Add THIS line
    ' (only if you want to add a 3rd line item)
    '''oInvoice.Lines.Add -> Don't add this
    lRetCode = oInvoice.Add
    If lRetCode <> 0 Then
        gObjCompany.GetLastError lErrCode, sErrMsg
        MsgBox (lErrCode & " " & sErrMsg)
    End If
    remember to add :
    oInvoice.CardCode = "your BP"
    oInvoice.DocDueDate = Now
    oInvoiceDoc.CardCode = txtDOCBPCode.Text

  • Installation of Photoshop update 13.1.2 for creative cloud fails with error code U44M1P7 I need help

    I need help installing update 13.1.2 for Photoshop creative cloud, installation fails with error code: U44M1P7. Could someone please help?

    Sorry to bother you.
    I could find the answer after searching previous posts about this language problem.
    Had to change my language in AAM profile and then download PS CS6 again ( english version ).
    Then open the actual Photoshop and in preferences > interface you can besides the Dutch also option for English.
    restart application and Voila.
    Greetz, Jeroen

Maybe you are looking for