JCo and HR Minimaster

Hi,
For our application integration with SAP I created an  application client to the SAP test system using JCo . Using "RFC_FUNCTION_SEARCH" I got a list of BAPI's and I used the BAPI "BAPI_CC1_DNLOAD_MINIMASTER" to get the HRMinimaster data. But I didn't get anything on the return and Import tables. My question is am I doing it correct, is there any input parameters needed to make this call? Do I have to create a IDoc Server to receive the downloaded data? If then, how do I trigger a runtime download of HR minimaster using JCo client( I mean which BAPI I need to use).
One general question is , Is it possible to trigger  IDoc downloads from a JCo client using BAPI's like above (instead of using a transaction like PT80 from SAP)  and receive the results as IDoc data using the ALE config and a JCo server??
Thanks,
DT

hi Don
just check this links
Using tRFC or qRFC with JCo
this contains code for u
JCo tRFC
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/fcadaf90-0201-0010-4091-bd0bcd7b7f6a
to check the connection with  r3
/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
this is for idoc with jco
Problem with IDoc, tRFC and JCoIDoc in MiniSAP 4.6D
bit more
http://help.sap.com/saphelp_nw04/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
JCo Server Load Balancing
let me know  am i approched or not
bvr

Similar Messages

  • How to use JCO and RFC

    Hi guys, please help me out
    I'm new to JCO and do not have any idea about it.
    Here is my situation, for testing, I want to call an ABP RFC FM in SAP just to return a single text message to Java application through parameter.
    (Of course, I have access to SAP from my company and I do not have any Java compiler in my computer).
    From my understanding, there 2 main things to concern (Please correct me if i'm wrong and please tell me the steps I should do)
    1) Software installation and configuration
       What software do I need to install on my computer, is
       it JCO, SAPGUI, Java Compiler? What kind of
       configurations do I need for JCO?  
    2) Programming
       a) SAP side
          Write an ABAP RFC FM just to return a text message
          to Java application through parameters (No problem
          with this step)
       b) My computer side
          Write a Java application to call ABP RFC FM
          Do you guys have any simple source code example for
          this?? Please remember that this Java application
          simply call an ABAP RFC FM to get just a single
          text message.
    I really appreciate your help
    Thank you

    Hi Dean,
    USe Eclipse for Java programming.
    If you are downloading the latest version of JCO, make sure you have latest version of SAP Gui as there are version issues as the librfc.dll needs to be of compatible version.
    As far as your sample code is concerned, here it is ...
    import com.sap.mw.jco.*;
    public class CallFunction extends Object {
         public static void main(String args[]) {
              CallFunction app = new CallFunction();
         int count;
         JCO.Client mConnection;
         JCO.Repository mRepository;
         public CallFunction() {
              try {
                   // Logon info
                        mConnection = JCO.createClient("500", // SAP client
                                                   "username", // userid
                                                   "password", // password
                                                      null, // language
                                             "server name", // application server host name
                                                    "00"); // system number
                   mConnection.connect();
                   mRepository = new JCO.Repository("MY_connection", mConnection);
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.exit(1);
              JCO.Function function = null;
              try {
                   function = this.createFunction("ABAP_FM");
                     mConnection.execute(function);
                   System.out.println(
                        function.getTableParameterList().getValue("Exporting_Message"));
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.exit(1);
         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.");
    Here in this mention ur function module in place of ABAP_FM and exporting parameter in place of Exporting_Message.
    Regards,
    Tanveer.
    Please please reward some points if found helpful.

  • Connection between JCo and XI

    Hello,
    I want to establish a connection between an external java program which uses JCo to XI. However, it doesn't work. I'm not able to get a connection between java program and XI.
    Can anybody help me in this case?

    Hi Dinh,
    Here is a sample code I used to test the communication calling function module THPOPUP.
    client = JCO.createClient( ...);     
    // Open the connection
    client.connect();
    // Get the attributes of the connection
    JCO.Attributes attributes = client.getAttributes();
    boolean is_backend_unicode = attributes.getPartnerCodepage().equals("4102") ||
                                       attributes.getPartnerCodepage().equals("4103");
    // Create metadata definition of the input parameter list
    JCO.MetaData input_md = new JCO.MetaData("INPUT");
    input_md.addInfo("CLIENT", JCO.TYPE_CHAR, 255, 255 * (is_backend_unicode? 2 : 1 ),-1, 0, null, null, 0, null, null);
    input_md.addInfo("USER", JCO.TYPE_CHAR, 255, 255 * (is_backend_unicode? 2 : 1 ),-1, 0, null, null, 0, null, null);
    input_md.addInfo("MESSAGE", JCO.TYPE_CHAR, 255, 255 * (is_backend_unicode? 2 : 1 ),-1, 0, null, null, 0, null, null);
    // Create the input parameter list from the metadata object
    JCO.ParameterList input = JCO.createParameterList(input_md);
    // Set the first (and only) input parameter
    input.setValue("020", "CLIENT");
    input.setValue("USERNAME", "USER");
    input.setValue("TEST MESSAGE", "MESSAGE");
    // Create metadata definition of the output parameter list
    JCO.MetaData output_md = new JCO.MetaData("OUTPUT");
    // Create the output parameter list from the metadata object
    JCO.ParameterList output = JCO.createParameterList(output_md);
    // Call the function
    client.execute("TH_POPUP", input, output);
    I suggest you to have a look at the sample code named Example1 that is delivered with jco library.
    Probably there are also higher level functionality to send the idoc via jco (that hide you the call to that function module), using something like IDOC.create() or IDOC.send() but I have never used them because when I worked in this kind of scenario I had to call a RFC, not to send and idoc, via jco.
    Instead I sent Idoc to XI from a non sap system that was built on RFC sdk (similar to jco) and we posted IDOCs to XI via function module IDOC_INBOUND_ASYNCRONOUS.
    Dinh, the reason why the Idoc will be sent to the application layer of XI (SXMB_MONI) and not to the below ALE layer (WE05) is that in XI any call to the function module IDOC_INBOUND_ASYNCRONOUS is catched by the application layer.
    Consider that when an SAP system has to send an IDoc to another SAP system it calls  as well that function module (IDOC_INBOUND_ASYNCRONOUS) to send the IDoc
    So once you call that function module the idoc is created in XI and is a normal XI IDoc scenario.
    Hope it clarify your doubts,
    Kind Regards,
    Sergio

  • RFC calls with SAP JCO and IBM resource adapter for SAP - basic tuning

    Hi experts,
    we are working on a java portal connected to a backend system SAP by calling RFCs.
    On our first integration tests, it appears to be quite slow fetching data from SAP by calling the remote functions from the custom portal. We are using SAP JCo 3.0.6 and IBM resource adapter for SAP 7.0.0.3 to integrate SAP with our portal.
    Is there any basic tuning to achieve to improve performances or any hint of where to tune in SAP ?
    Any help would be greatly appreciated.
    Thanks a lot,
    Jamal

    Hi Jamal,
    I understand you have already checked performance issues in the SAP Server. We had some problems with certain RFC calls and it turned out to be a badly developed ABAP sentence.
    I'd recommend you to use httpwatch or another tool to check the response times from the browser, so you can point accurately where the is.
    Regards
    Francisco

  • About JCO and XI

    Hello,
    I heard some people talking about end of support for JCO..I was wondering if some of you can confirm or not ? Is there any documents/roadmap about this ?
    Those guys were saying that with the promotion of SAP XI and therefore JRA, java proxies and so on..SAP would stop JCO...
    Thanks in advance for your answers !

    Dear Eric,
    JCO :
    SAP Java Connector (SAP JCo) is a middleware component that enables the development of SAP-compatible components and applications in Java. SAP JCo supports communication with the SAP Server in both directions: inbound calls (Java calls ABAP) and outbound calls (ABAP calls Java).
    JRA :
    SAP Java Resource Adapter (SAP JRA) is a J2EE -compatible connector for SAP systems. It enables the integration of SAP systems with J2EE application servers.
    This will help you to understand more
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/b55a4201301453e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5caa85b11d6b28500508b5d5211/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Regards
    Agasthuri Doss

  • JAVA(JCO) and BW Connectivity

    Hi,
    I am using JCO to get data from R/3. At the same time I want to get data from BW server also. Is there any methods available for this activity.
    How make it possible, Please provide details.
    Thanks,
    Ask123

    thanks for the reply Prakash.
    So, i'm using websphere with JCO to connect Bw.
    Actually, i encountered the same return message in my java code and during the se37 transaction.
    In se37 transaction:
    I call the Bapi BAPI_MDDATASET_CREATE_OBJET
    I set manually an mdx command generated with MDXTEST
    on my BW query.
    this BAPI return a DATASETID
    the persistence of the object is ok.
    after that, if i use the bapi BAPI_MDDATASET_CHECK_SYNTAX
    or BAPI_MDDATASET_SELECT_DATA with this DATASETID...
    I have always the same error as return message.
    RS_EXCEPTION : CL_RSR_MDX_COMMAND========CP
    the problem is coming from the DATASETID?
    Thanks,
    best regards,
    Ben

  • JCO and JRA under JBoss

    Hi,
    I'm using Eclipse 3.2 and JBoss 4.0.4.GA and I want to deploy wars on my JBoss that have to connect to one of our SAP servers (kernel 640 138, hot-pack base 620 56, abap 620 56, appli 470 25 and IS-U 472 10 (and some others hot packages).
    I deployed the <b>sapr3-service.xml</b> in the ...\jboss\server\default\conf directory.
    [code]<?xml version="1.0" encoding="iso-8859-1"?>
    <server>
      <!-- ==================================================================== -->
      <!-- Example ConnectionFactoryLoader for SAP R/3 connector                -->
      <!-- Put sap.rar in deploy also. This rar should contain jars             -->
      <!-- ra.jar and jCO.jar.  The native libraries need to be moved by hand   -->
      <!-- to your PATH.                                                        -->
      <!-- Author: David Jencks [email protected]                  -->
      <!-- Author: Paul McLachlan [email protected]                              -->
      <!-- ==================================================================== -->
      <mbean code="org.jboss.resource.ConnectionFactoryLoader"
          name="JCA:service=ConnectionFactoryLoader,name=SAPConnectorFactory">
        <attribute name="ManagedConnectionFactoryProperties">
          server-name=xxx.xxx.xxx.xxx
          system-name=W01
          system-number=00
          UserName=UNAME
          password=PWD
          Language=FR
        </attribute>
        <attribute name="JndiName">eis/SAPJRA</attribute>
        <attribute name="TransactionManagerName">java:/TransactionManager</attribute>
        <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=SAP ConnectorFactory</mbean-ref>
        <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
        <attribute name="ConnectionManagerProperties">#
          BlockingTimeoutMillis=500000
          IdleTimeoutMinutes=30
          MaxSize=10
          CleanupIntervalMinutes=30
          MinSize=0
          MaxIdleTimeoutPercent=1.0
        </attribute>
        <attribute name="PrincipalMappingClass">
          org.jboss.resource.security.ManyToOnePrincipalMapping
       </attribute>
        <attribute name="PrincipalMappingProperties">
          UserName=UNAME
          password=PWD
        </attribute>
      </mbean>
    </server>
    [/code]
    I deployed the <b>sapjco.jar</b> (version 2.1.7) and the <b>sapjcorfc.dll</b> (same version) in the ...\jboss\server\default\deploy directory
    Also I copy the sapjra.rar founded in a WAS 640. It includes a sapjra.jar and a META-INF directory which contains 2 xml files and a manifest.mf. I didn't modify the <b>connector-j2ee-engine.xml</b> file as you can see
    [code]
    <?xml version="1.0" encoding="UTF-8"?>
    <connector-j2ee-engine>
        <jndi-name>eis/SAPJRAFactory</jndi-name>
        <authentication-type>caller impersonation</authentication-type>
        <loader-references>
          <loader-name>library:com.sap.mw.jco</loader-name>
        </loader-references>
    </connector-j2ee-engine>
    [/code]
    but I gave some values to the properties in the <b>ra.xml</b>, like this
    [code]
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.com/dtd/connector_1_0.dtd'>
    <connector>
      <display-name>SAPJRA</display-name>
      <description>J2EE Connector Architecture 1.0 based... and a very long description...</description>
      <vendor-name>SAP</vendor-name>
      <spec-version>1.0</spec-version>
      <eis-type>R/3</eis-type>
      <version>6.45.2</version>
      <resourceadapter>
        <managedconnectionfactory-class>com.sap.mw.jco.jra.JRA$ManagedConnectionFactoryImpl</managedconnectionfactory-class>
        <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
        <connectionfactory-impl-class>com.sap.mw.jco.jra.JRA$ConnectionFactoryImpl</connectionfactory-impl-class>
        <connection-interface>javax.resource.cci.Connection</connection-interface>
        <connection-impl-class>com.sap.mw.jco.jra.JRA$ConnectionImpl</connection-impl-class>
        <transaction-support>LocalTransaction</transaction-support>
        <config-property>
          <description>Client, i.e. 001</description>
          <config-property-name>SAPClient</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>101</config-property-value>
        </config-property>
        <config-property>
          <config-property-name>UserName</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>UNAME</config-property-value>
        </config-property>
        <config-property>
          <config-property-name>Password</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>PWD</config-property-value>
        </config-property>
        <config-property>
          <description>I.e. DE or EN</description>
          <config-property-name>Language</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>FR</config-property-value>
        </config-property>
        <config-property>
          <description>SAP Applicatino Server, i.e. us7400</description>
          <config-property-name>ServerName</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>xxx.xxx.xxx.xxx</config-property-value>
        </config-property>
        <config-property>
          <description>System number, i.e. 01</description>
          <config-property-name>PortNumber</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>00</config-property-value>
        </config-property>
        <!--config-property>
          <description>Setting on false turns off automatic commit for non-transactional calls that improves performance for reading accesses on DB. On default is true</description>
          <config-property-name>AutoCommit</config-property-name>
          <config-property-type>java.lang.Boolean</config-property-type>
          <config-property-value>false</config-property-value>
        </config-property-->
        <authentication-mechanism>
          <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
          <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
        </authentication-mechanism>
        <!-- used on WEBAS 630 for SAP Logon Tickets -->
        <authentication-mechanism>
          <authentication-mechanism-type>Kerbv5</authentication-mechanism-type>
          <credential-interface>javax.resource.spi.security.GenericCredential</credential-interface>
        </authentication-mechanism>
        <reauthentication-support>false</reauthentication-support>
      </resourceadapter>
    </connector>
    [/code]
    and I finally created the file <b>sapr3-ds.xml</b> located in the ...\jboss\server\default\deploy directory
    [code]
    <?xml version="1.0" encoding="UTF-8"?>
    <connection-factories>
      <tx-connection-factory>
        <adapter-display-name>SAPConnectorFactory</adapter-display-name>
        <jndi-name>eis/SAPJRA</jndi-name>
        <rar-name>sapjra.rar</rar-name>
        <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
        <config-property name="SAPClient" type="java.lang.String">101</config-property>
        <user-name>UNAME</user-name>
        <password>PWD</password>
        <config-property name="Language" type="java.lang.String">FR</config-property>
        <config-property name="ServerName" type="java.lang.String">xxx.xxx.xxx.xxx</config-property>
        <config-property name="SystemNumber" type="java.lang.String">00</config-property>
        <config-property name="PortNumber" type="java.lang.String">99</config-property>
      </tx-connection-factory>
    </connection-factories>
    [/code]
    I don't understand why I have to give 3 times the logon (in the sapr3-service.xml, the ra.xml and the sapr3-ds.xml) and I'm confused to understand the difference between the SystemNumber and the PortNumber, as the SystemNumber is sometimes described as being a port number...
    But my problem in booting my JBoss server is this one
    [code]
    [ServiceController] Problem starting service jboss.jca:service=ManagedConnectionFactory,name=eis/SAPJRA
    java.lang.ExceptionInInitializerError
         at com.sap.mw.jco.jra.JRA$ManagedConnectionFactoryImpl.createPrintWriter(JRA.java:1302)
         at com.sap.mw.jco.jra.JRA$ManagedConnectionFactoryImpl.<init>(JRA.java:1140)
    [/code]
    and many lines later
    [code]
    Could not initialize SAP Java Resource Adapter Library. Found SAP Java Connector version 2.1.7 but version 6.30.1 or higher is required.
         at com.sap.mw.jco.jra.JRA.<clinit>(JRA.java:218)
    [/code]
    I already founded a post in this forum (url Re: JRA version conflict) that says
    Remember The JRA implements the JCA 1.0 specification but The JRA is NOT an implementation of the JCA 1.0 specification as it is not portable / plugable into any J2EE 1.xx compliant environment! Thanks SAP.
    Does it mean that we can't deploy the sapjra on a JBoss server ?
    Can you tell me what I can do to solve this problem. Thanks in advance.
    Jean-Michel

    Hi Jean,
    the JRA is supported only within SAP Web AS. So, we cannot provide support for using it within JBoss.
    The error
    Could not initialize SAP Java Resource Adapter Library. Found SAP Java Connector version 2.1.7 but version 6.30.1 or higher is required.
         at com.sap.mw.jco.jra.JRA.<clinit>(JRA.java:218)
    means, that you use in JBoss the standalone JCO. But JRA needs the JCO provided withing SAP Web AS.
    regards,
    Eugen

  • What wrong with JCO and SAP

    I add all necessary class for JCO in my package but it returns error.
    =========================================
    28 &#3617;&#3636;.&#3618;. 2550 16:09:31 org.apache.axis.utils.JavaUtils isAttachmentSupported
    WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    AxisFault
    faultCode: Server.generalException
    faultSubcode:
    <b>faultString: java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO; nested exception is:
         java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO</b> faultActor:
    faultNode:
    faultDetail:
         hostname:tagdvtrat1
    java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO; nested exception is:
         java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at javax.xml.parsers.SAXParser.parse(Unknown Source)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)>>
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at com.pda.IssueBAPISoapBindingStub.doIssue201(IssueBAPISoapBindingStub.java:144)
         at com.pda.testWS.main(testWS.java:14)

    Hi Pornthep,
    this is not the fault of JCO/SAP. There are jar files/classes missing in the classpath. If you are using Axis2 there are some good samples on how to deploy the web service using environmental variables (keywords AXIS2_HOME, ant and maven build file). This may help you to avoid missing libraries. In case you are using Axis1 you can adapt most of the deployment procedure.
    Hope that this may help you.
    Best regards
    Frieder

  • JCO and Single Sign On

    Hi everybody,
    can someone tell me which parameter I have to insert after $MYSAPSSO2$ and where I can find this parameter in the system. I know its the SSO Ticket but I don't know what exactly belongs in there
    client= JCO.createClient(<client>,"$MYSAPSSO2$","",<lang>,<SERVERNAME>, <sysnr>);
    Thanks for your help.

    Hi,
    i think we have to pass the password of the client after $MYSAPSSO2$.
    refer this thread ,i hope it will help
    Re: photo using jsp
    Regards,
    ramesh

  • JCo and SSO and my Java application

    Hi all.
    I have java application that running under the Oracle Application Server and connect to SAP using user/password. I want use SSO ticket from SAP Portal for connet to SAP.
    How I can release next "use case":
    1.User connect to SAP Portal.
    2. User click on button (external iView) and start my application in separate browser.
    3. My application read sso ticket from cookies
    4. My application logon to SAP use sso ticket (via JCo)
    Thanks

    Hi Vyacheslav
    If you can elaborate your statement:
    'How I can release next "use case":'
    we are not sure what you wanted to ask
    Bhudev

  • Connecting Jco and ECC

    Hi Gurus,
           I just changed the ECC client 100 to 200 in Jco connections but Portal is not communicating with backend ECC clent 200. Please advice.
    Regards
    Francis.

    Hi,
          Changing the Joc connection is not working. Therefore I created a Jco connection again. It's working fine. I'm closing this forum.
    Thanks
    Francis

  • Stop and re-start JCo Idoc Server

    Hi
    I created a JCO IDoc server (using the JCoIDocServer class) , so far it works fine for me to send and receive IDocs to R/3. The only issue is when I try to start and stop the JCO Idoc server at runtime. When I call the Stop method(). It seems like the service is stopped but if i call a Start method after that( even on a completely new class instance) I'm getting a nullpointer exception. I have seen documents on JCOServer says that use suspend method for stop the server, but this is not available for the JCoIDocServer class. How can I stop a server which is running, programaticalluy and restart it again ? (I dont mind if I have to reinstantiate the whole server class) . I use JCO and  IDoc libaray version 3.0 . Please help
    Thanks

    Hi,
    Try using the abort() after your stop in a "if" condition. You need to provide a message as a parameter for the abort() method, so that the remote SAP System (in case the IDoc Server is still connected to it) knows the reason why the IDoc server shutdown without any warning.
    So your code should look something like this (warning pseudo-code ) -
    server.stop();
    if(server.alive())
           server.abort("Forcing shutdown because its wakey wakey eggs and beccy time!");
    Try logging the status of the server after the stop() and abort() methods to know what the server is doing. I hate people using the suspend() method to "stop" the server, because it does not stop the server. It only suspends operations, so your connection and session to the remote SAP System remains open.
    After the time out (can be hours) on the remote System, the connection is closed, but until then, the remote SAP System keeps expecting your server to talk back to it. Open sessions are of course more dangerous than runaway trains, so avoid the suspend() method if you can.
    T00th
    Edited by: Sameer Jagirdar on Jan 21, 2010 1:14 PM --> fixed the code display thingy.
    Edited by: Sameer Jagirdar on Jan 21, 2010 1:15 PM

  • Using JCo : IDoc to XML and XML to IDoc

    Hey guys,
    I need some guidance on Creating an xml file out of an IDoc using JCo and vice versa.
    Can anybody please provide with the code samples or any kind of documentation on this topic.
    Points will be rewarded
    +| Eleana West

    Hi,
    what you are looking for is the sapidocjco.jar. You can get if from the service marketplace and it comes with a couple of example Java code which shows how to implement it. You will also need the normal JCo jar to use the sapidocjco.jar.
    Bye,
    Sameer

  • Model and Metadata JCo Destination Config in WD

    Hi!
    I just want to ask or verify if this is a correct JCo setup:
    Logical System Name: WD_APT_MODELDATA_UIP_GDC
    Model Instance Logical System Name: WD_APT_METADATA_GDC
    Thanks!

    Hi,
    Thanks for that link. Yup, I think the project's JCO is interchanged somehow based on the link that you gave me. To give a background, this is just a transitioned project to me and the JCO was set up in that way...
    I don't know why that was the case, but when I reversed the two JCO, it gave me an RFC authorization error. However, when I interchanged the MODEL and METADATA JCO, it worked fine again.
    Would you know why this is the case? I just want to verify if it is alright to interchange JCOs and ensure that the conifgurations are correct.

  • Look Up API through JCO

    Hi all,
    I m using look up through JCO and calling a RFC on backend R/3 for the particular validation.I m using UDF for that.In the UDF i have specified imports as:-
    imports :-java.util.;java.lang.obj.;com.sap.aii.mapping.lookup.;com.sap.mw.jco.;java.io.*;
    source code --
    //write your code here
    JCO.Repository  myRepository;
    // Change the logon information to your own system/user
    JCO.Client  myConnection =  JCO.createClient(
        // all the client information namely client ,user id pwd etc
    myConnection.connect();
    // create repository
    myRepository = new JCO.Repository( "SAPLookup", myConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("xxxxx"); //Name of RFC
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( a , "xxxxx" ); //import parameter of RFC, a is input argument.
    myConnection.execute( function );
    String ret = function.getExportParameterList().getString( "XXXX" ); //export param
    myConnection.disconnect();
    return ret;
    however on test  i m getting follwing error:
    Source code has syntax error:  D:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map6df266d0f96411dbb2a4000bcd3f5f3d/source/com/sap/xi/tf/_MM_Source_To_Target_.java:157: 'class' or 'interface' expected public static void main(String[] args) throws Exception{/!_$ClNRep_/_MM_Source_To_Target_ st = new /!_$ClNRep_/_MM_Source_To_Target_(); st.testExecute(); }
    Can anybody help me out in rectifying this Syntax errror.
    Regards,
    AshwinM

    You are hardcoding the user id , password etc in your UDF. This is something will cause issues asyou move your objects across environments from Dev to Qaulity and production.
    You cannot change the user id and passwordi n your mapping code in your Quality and Prodction. Use of RFC Lookup is strongly recommended with the RFC adapter.
    I dont think using RFC Lookup API causes any perfromance degradations. We have used this feature multiple times in and have never faced performance constraints as a result of this.
    Regards
    Bhavesh

Maybe you are looking for

  • To change the header text of Purchase order using BAPI

    Hi, I am using BAPI_PO_CHANGE to change the header text of PO. But it s not reflecting. Can anyone help me by providing solution for this. <i><b>Points will be rewarded for the useful answers.</b></i>

  • Help with multiple flash movies in same website

    I'm trying to create a website in dreamweaver. I created the artwork in fireworks. a slice of it i exported to flash to create rolling clouds over the background. i also want in the same swf file a screen for my main content. ( I used a scrollPane co

  • How to solve problem with Installer Package for itunes

    Hi! I'm attempting to upadte itunes so I can get the latest software for my iphone. It's a 3GS. Every time when ready to instal it says I have a problem with the installer package  -  something is missing. What can I do to solve this?

  • Quality loss saving an image in .gif extension

    Hello, I've a problem with Adobe Fireworks CS5 when I save an image in .gif extension.  I open a .gif image with Fireworks and if I look at properties of image (tab optimize) these are: format: gif, palette: exact, number of colors 46.  Then, if I wo

  • Handling my own events

    What ive got works. Im just curious about my methods compared to what i "should" be doing... Am using swing, and what I have works a little bit like a forum. So I have a list of sections and entries. When a user clicks a section, the main panel displ