JCO call from ABAP to Java

Hi to all,
I'm trying to perform a JCO call from an abap function module to a java server program. I've built a java application that extends JCO.Server library, but I'm not able to register my Program to SAP R/3 in order to be called from the abap Function module. when I run my java application directly on XI Server, I receive this error:
"Could not load middleware layer com.???.MiddlewareJRfc".
Can anyone help me, please?
Thanks!

Hi Denis,
Import the model In NWDS for ABAP for RFC.
Please check here [Accessing ABAP Functions using the Adaptive RFC Model |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3?quicklink=index&overridelayout=true]
[Web Dynpro Model: Backend Access|http://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#section10 [original link is broken]]
Also check here /docs/DOC-8661#section10 [original link is broken]
Hope it helps,
Redards,
Arun

Similar Messages

  • Java calls from ABAP code in XI

    Java and ABAP gurus,
    Is it possible to make java call from ABAP. Is a sample out there I can take a look at.
    Please help.
    Thanks.

    Hi,
    YES, Very well it  is Possible,
    This will help you
    /people/bv.pillai/blog/2006/09/28/calling-mdm-java-api-application-executable-from-abap
    /people/vijayasarathy.raghunathan/blog/2005/12/28/java-editor-inside-abap
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    JCo Outbound( calling Java Function from ABAP )
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    Call Java Class and Methods from ABAP
    Regards
    Agasthuri Doss

  • Setup connectivity from ABAP to Java stack

    Hi
    I'm struggling to make connectivity setup from ABAP to Java stack. Objective is to call a java method published on javastack from a report/FM. Can some one guide me with some examples. Appreciate all your responses.
    Thanks

    Hello Yadagiri,
    I found three links that may help you
    http://help.sap.com/saphelp_nw70/helpdata/en/43/783e2beabd1ad0e10000000a114cbd/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/45/f662fb6cc604ace10000000a114a6b/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/45/0e78275adc6cbfe10000000a114a6b/frameset.htm
    I hope it helps!
    With regards,
    Caio Cagnani

  • How To change UME Data source from Abap to Java.

    Hi Experts,
    Can any one give me Detailed Steps of how to Migrate from UME Data Source from Abap to Java, as the Ume Data Source is initally configured for Abap.
    Regards,
    Siva

    Siva,
    Please search before you post a question.
    This has been discussed many a times in here. Please refer to this [thread|To change ABAP UME database to Portal database;.
    Good Luck!
    Sandeep Tudumu

  • How to handle JCO.AbapException on JCO call in ABAP

    Hello Forum,
    I am implementing an JCO Server scenario.
    I use dynamic repositories like Example7.java from the JCO documentation.
    Example7 throws an JCO.AbapException if anything went wrong, e.g. the function is not implemented. My coding is like:
         protected void handleRequest(JCO.Function function) throws AbapException {
              try {
                // Process incoming requests
              } catch (Exception e) {
                log.error(this.getProgID() + ": error handling request " + function.getName(), e);
                throw new AbapException(function.getName(), e.getMessage());
    How to react on this AbapException?
    The examples in SAP Help documentation only catch
    SYSTEM_FAILURE and COMMUNICATION_FAILURE.
    I implemented the JCO call as well like following.
    CALL FUNCTION 'MY_JCO_FUNCTION_MODULE'
        DESTINATION JCO_DEST
        <...>
        EXCEPTIONS
          SYSTEM_FAILURE        = 1  MESSAGE RFC_MESS
          COMMUNICATION_FAILURE = 2  MESSAGE RFC_MESS.
    But these two are only thrown and caught when something with communication went completely wrong, e.g. RFC not found.
    When the exception in the JCO server occured and JCO.AbapException was thrown I always get an ABAP short dump, i.e. the exception was not handled.
    Additionaly, the exception is named like the JCO function called and the message text which was submitted to JCO.AbapException is not displayed. I think that means that the AbapException was not recognized at all?
    The JCO API doc says:
    Creates an exception with the specified key. This constructor is normally used in the server's handleRequest() methods to throw an exception which is part of the function interface definition. In such a case the SAP system will not raise a system exception. If however the specified key is not a defined exception for the currently processed function module the SAP will raise a system exception.
    But whether I define an exception in the function interface definition named like the module (thererfor new AbapException(function.getName(), <...>)) or not, it always dumps. I understand the exception that a system exception is raised when the exception is not defined? But this is not been handled with above ABAP code as well.
    What is wrong here? Could anyone post an example please how the exception has to be handled?
    Please note that I do not define static repositories but have the remote function defined on in the ABAP server to be used by dynamic repository (like the STFC_CONNECTION test rfc). Am I right that the exception should be defined in that RFC remote definition?
    Thanks,
    Carsten

    Dear everybody,
    Finally I solved this old problem
    I am a novice in JCO and played a little with the problem and found an old reference to the difference between J2EEAbapException and AbapException classes. I modified my program and it works! ABAP caller gets the correct exception, not system_failure! The details:
    1. modify beanname.java source
         import com.sap.mw.jco.JCO;
         import com.sap.mw.jco.JCO.J2EEAbapException;
         public interface ... extends EJBObject {
        public void processFunction(JCO.Function function) throws RemoteException, J2EEAbapException;
    2. modify beannamebean.java source
        import com.sap.mw.jco.JCO.J2EEAbapException;
         public void processFunction(JCO.Function function) throws J2EEAbapException {
         throw new JCO.J2EEAbapException("NODATA");
    3. modify beannamelocal.java source
          import com.sap.mw.jco.JCO;
         import com.sap.mw.jco.JCO.J2EEAbapException;
              public void processFunction(JCO.Function function) throws J2EEAbapException;
    I hope it helps for somebody else too!
    Imre

  • RFC Call from ABAP (R3) to Webdynpro EP

    Hi experts,
    I have a requirement to initiate a call from an ABAP program on R3 to a standard Portal (Webdynpro) API. Does anyone have any experience with this?
    I understand that normally Portal (Webdynpro) applications will make the RFC call to ABAP via the established JCO connection. However there's very limited literature elaborating how the call can be made in the other direction i.e. from ABAP R3 to Portal
    Anyone, please kindly advise how, if this can be done. Many thanks!
    Best regards,
    Lionel

    Hi,
    I'm trying to make a RFC call from the ABAP program to a built in Java method residing on EP. It is part of a suite of methods provided by the UME engine.
    Typically a call is made from a webdynpro program to a SAP ABAP function module. In this case, I'd like to make a call from the SAP ABAP report to the EP method.
    Best regards,
    Lionel

  • More complex JCO Server examples (ABAP to Java)

    JCo connections:
    I found a couple of good documents for connecting from Java to ABAP. Whenever it comes to the other direction (ABAP to Java), information is somehow rare.
    I had a look at the examples coming with the JCo lib, however I would like to find some more complex examples. Especially the transfer of larger result sets (obtained on the Java side) is interesting.
    Does anybody know something like this? I have tried Google, but somehow always the same few articles showed up.
    Any hints?

    You can also use the JCO RFC Provider Service of the Web Application Server for your ABAP to Java calls.
    The steps involved in that are
    1. Configure destination in SM59 in SAP.
    2. Create RFC Destination in Visual Admin.
    3. Create a stateless session bean with JNDI name as the name of calling function module in SAP.
    4. Add a business method public void processFunction(JCO.Funtion fn) which is called by the JCO RFC Provider Service. The name should be 'processFunction'.
    5. Set library references in application-j2ee-engine.xml to type weak for the following
        a. com.sap.mw.jco.
        b. com.sap.tc.Logging (if you are using the logging api )
    Here is the sample code for the EJB biz method
    Business Method.
         public void processFunction(JCO.Function function) {
              try {
                   // Get the import parameters for the function module
                   JCO.ParameterList importList = function.getImportParameterList();
                   logger.infoT("The value sent is" +
                   (String)importList.getValue("USER_NAME"));
                   // Set the export parameter value for the function module
                   JCO.ParameterList export = function.getExportParameterList();
                   export.setValue("From EJB", "RETURN");
                   function.setExportParameterList(export);
              catch (java.lang.Exception e) {
                   e.printStackTrace();     

  • Webservice call from Abap

    Hi
    <u>ABAP:</u>
    I wish to know ,Do we need to configure SNC for calling an Abap side webservice using X509 certificate ?I m calling webservice from Abap.I created a certificate through VisualAdministrator and asign it to R/3 in STRUST transaction.Now can I pass it to my Webservice so that it should not ask for user/password.Any other way ,if u can suggest for the same,is welcome.
    <u>JAVA:</u>
    If  i need to do the same with J2EE WAS webservice-then will the steps vary,as i feel no SNC can be configured in J2EE WAS.
    Regards
    Dhanya

    Hi,
      Besides that i think you can do it by configuring the ITS and calling the webservice by means of using BSP applications in ABAP .
    Regards
    Abhishek
    Message was edited by: Abhishek Raj

  • How to (can I?) debug EJB called from ABAP?

    I have developed a small bean that I am calling remotely from ABAP.  I have done the development work in the WebAS 6.40 Sneak Preview NetWeaver Dev. Studio.  I cannot figure how (or even if it's possible) to debug this bean.
    I have followed the instructions on debugging referred to elsewhere in this forum, but I'm hung up at the point where I'm to create a debug configuration.  E.g., what kind of configuration should I specify?  (EJB is not one of the choices.)  If I try any of those that <i>are </i> available, I always get to a point where it says that it can't connect to the JVM.  Well, that's not what I'm trying to do, is it?
    Has anybody successfully done such debugging?  If so, can you get me past this sticking point?
    Thanks...

    Hi David,
    prerequisite to use debugging is, that the server you want to connect to runs in debug mode:
    Open "Window->Show View->Other->J2EE->J2EE Engine". The configurated J2EE engine is displayed. Use the context menu of the "server0" entry to "Enable debugging of process". The server restarts then. If it's (already) running in Debug Mode, this is visible on the right side "Debug Mode = ON".
    I suggest to define a "Remote Java Application" configuration like this:
    Name: Whatever you like
    Project: The project containing the classes to debug.
    Connection Type: Standard
    Host: Hostname or IP of J2EE server host
    Port: 50021
    Choose "Apply" and "Debug".
    Set breakpoints for example by double-clicking on the frame on the left side of the Java editor (or using the context menu -> Add Breakpoint there). There's a very good documentation about debugger usage in the NWDS online help.
    Trigger the remote call from the ABAP system. As soon as a line with a breakpoint is hit, the debugger displays the line and stops the active thread.
    Hope that helps.
    Regards
    Stefan
    PS: As soon as you don't need debugging any longer, disable debug mode of the engine, since it slows down everything.

  • SOFM: Dsiplay method is not working when called from ABAP Webdynpro

    Hi All,
    I want to open an attachment from ABAP Webdynpro.
    I have approached in this fashion:
    1) Get the attachments as SOFM object key
    2) On Click of a link on Webdynpro, I am calling a function module within which I am creating an instance of the SOFM object
    3) Then I am calling the DISPLAY method
    It is not opening.
    But, if it opens when I driectly execute the function module. It open when I directly test the business object.
    Any Idea ?
    Thanks & Regards,
    Deb

    Display Method uses the Dialogue Module, You should not access such methods in web dynpro which are SAPGUI specific.
    Web Dynpro Applications are run in Browser environment which cannot understand Dialog, it can understand only HTML.
    Read the attachments and get the content and use FileDownload UI element to show it to user.
    Abhi

  • BRMS Connector - Calling from ABAP program

    Hi,
    I got some error when I changed the BRFPlus from decision table to BRMS connector when calling it from an ABAP program.
    Is there any difference in the calling of those BRFs from ABAP to get the data?
    Thanks!

    Hi Carsten:
    There are documents in SCN on how to call a BRFPlus from a webdynpro.  Is the call to a BRFPlus Function from a CRM-BSP very different?  I mean, in the Webdynpro documents we found in SCN, they use the terms: controller, methods and classed, which are also terms used in BSPs, hence out of our ignorance we assume there should not be much of a difference.
    It is important to clarify that I am not a developer, but this is all to get an idea whether the scenario is totally different, or to know if what we are trying to accomplish is not possible, which I doubt.
    Any help or link is appreciated.
    Thanks,
    Juan

  • Operating System Calls from APEX with Java and PL/SQL

    Question about operating system calls from apex.
    I created a java file which is wrapped with pl/sql like
    create or replace java source named "ExternalCall" as
    import java.io.*;
    I do the steps from this web page http://www.oracle.com/global/de/community/tipps/oscalls/index.html
    The page is in german, but for experienced users the code on this page says everything.
    In apex i have an application which calls this function with the "move" command in a sql-report region.
    Let's say move c:\work1\file.txt c:\work2\file.txt
    Everything works fine on one host(pc) but if i want to transfer the file from my host to another one then
    i get the messgage "no access" although i have read, write access on the other host.
    By the way, on both hosts i have admin rights.
    Why can't i transfer the file over a network ?
    Thanks in advance for any kind of help.
    Regards
    Stefan

    I guess you are working on a Windows host. In this case Oracle processes are running as Windows services with a build-in MS system account. This account has no access to network ressources. You have two ways to get out of your windows box:
    Assign Oracle services a network enabled account, e.g. domain user with local administrator privileges. (I never tried this and I don't like to recommend it.)
    Use a command script for copying files and use explicite authentication within this script:-
    net use \\myserver\ipc$ tiger /user:scott
    copy c:\temp\xxx1 \\myserver\share\temp
    copy c:\temp\xxx2 \\myserver\share\temp
    Michael

  • Using Jco calls from the message mapping

    can any body tell me how can we use JCO call in a message mapping if posssible with an example
    thanks and regards
    sandeep

    Hi,
    Refer the below code and weblog:
    ?     RFC lookup using JCO (without communication channel)
          /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    Notes:
    ?     Ensure that the function module is RFC-enabled.
    ?     Ensure that the parameters are passed by value and not by reference (mandatory for RFC-enabled function modules).
    IN UDF:
    Import Parameters:
    com.sap.mw.jco.*
    Code:
    Public String UOMLookup(String resultFieldName, Container container)
    JCO.Repository mRepository;
    // Change the logon information to your own system/user
    JCO.Client mConnection = JCO.createClient(
        "800", // SAP client
        "xilookup", // userid
        "test", // password
        "EN", // language
        "tsphl850", // host name
        "00" ); // system number
    // connect to SAP
    mConnection.connect();
    // create repository
    mRepository = new JCO.Repository( "SAPLookup", mConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("Z_SFLIGHT_DETAILS");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue(resultFieldName, "UOMCODE" );
    mConnection.execute( function );
    String ret = function.getExportParameterList().getString( "UOMTEXT" );
    mConnection.disconnect();
    return ret;

  • Issue while sending a zipped file from ABAP to JAVA layer

    Hi All,
    I have a requirement wherein i have to zip a xml file in abap, convert it to base64 encoded string and send it to JAVA layer.
    I'm using the class CL_ABAP_ZIP for zipping the xml string and FM "SCMS_BASE64_ENCODE_STR" to convert the zipped data to base64 encoded string.
    But on the JAVA layer we get an exception while unzipping this data.
    Has anybody come across a similar situtation.
    Please help.
    Regards,
    Ankit Agrawal

    Example
    REPORT  Z_PAP_UP_ZIP_DL.
    DATA: L_ZIPPER TYPE REF TO cl_abap_zip.
    DATA: FILEX type XSTRING.
    DATA: FILENAME type string.
    DATA: PATH type string.
    DATA: zip type xstring.
    DATA: FILE_N_TAB type FILETABLE.
    DATA: FULL_PATH type string.
    DATA: FILE_LENGTH type i.
    DATA: FILE_TAB type w3mimetabtype.
    DATA: WA_INT type int4.
    DATA: PATH_TABLE TYPE TABLE of char1024.
    "    Load the file
    "Which file to upload
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      CHANGING
        FILE_TABLE              = FILE_N_TAB
        RC                      = WA_INT
    "load the (first) file from the frontend the user has selected.
    LOOP at FILE_N_TAB into FULL_PATH.
    "get the file
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
         EXPORTING
           FILENAME                = FULL_PATH
           FILETYPE                = 'BIN'
        IMPORTING
          FILELENGTH              = FILE_LENGTH
        CHANGING
          DATA_TAB                = file_tab.
        exit.
    endloop.
    "create xstring from table
    CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
      EXPORTING
        INPUT_LENGTH       = FILE_LENGTH
      IMPORTING
        BUFFER             = FILEX
      TABLES
        BINARY_TAB         = file_tab
    "get the name of the file. we take entry after the last '\' ...windows.
    SPLIT FULL_PATH AT '\' INTO TABLE PATH_TABLE.
    DESCRIBE TABLE PATH_TABLE LINES WA_INT.
    READ TABLE PATH_TABLE INTO FILENAME INDEX WA_INT.

  • Is SAP going from ABAP to Java

    Upto how much extent are following true, i heard from few SAP people.
    1. lot of features currently implemented on ABAP will be shifted to Java gradually.
    2. all the new functionalities  will be preferably developed by SAP in Java instead of ABAP.
    3. in the future, all of the components/features will be in Java instead of ABAP.
    thanks,
    Ganesh.

    > I have a doubt over here ...All the SAP ESS/MSS applications were in Web Dynpro for Java but now they are slowly been converted to Web Dynpro ABAP ..... so is SAP going the other way round ...converting all its previous Java applications back to ABAP?
    Yes - you're right - but that's something many customers highly appreciate, especially in the case, when they enhanced/modified/adapted the pre-ERP ESS/MSS functionality in ABAP which would now needed to be ported over to Java. Due to the conversion back to WD-ABAP they can stay with their current code logic and "just" need to adapt the frontend to WD.
    I heard from quite some (SAP-)people something like
    ABAP --> Service provisioning
    Java --> Service consumption
    so the business logic stays in ABAP but the frontend, that actually uses the functionality, is written in Java.
    IMO the main problem of all that Java stuff is, that there is no consistency about how it's used across the applications. If you e. g. compare ESS/MSS to the BI (the Java parts) then you'll see, that ESS/MSS uses the ABAP customizing to layout the functionality on the portal but the BI uses real functionality to do that. Some applications use JCo, others use WebDynpro connections, others use ICM - just as the application grew up over the time. This makes handling different applications in a portal so utterly cumbersome because you first have to find out, how they connect to backends before there's a chance to find out, why something is not working.
    Another example is e. g. the Redwood scheduler (provided as a basic license for free with each Netweaver license) - the software itself is VERY good but I would never dare to run such a crucial functionality as batch scheduling (on which we highly rely on for our business) on a Web-AS Java in production.
    Markus

Maybe you are looking for

  • Adobe Reader 11.0.6.70 Crashing Consistently

    We have a call center with 825 users.   During the workflow of the call, the users are filling out a PDF form created by one of our technical writers.   Certain answers will cause the CSR to open a second form and fill in questions on that from answe

  • Planning a materail at plant level and the MRP Area

    Hi Gurus, Is it possible to plan the same material at the plant level and  at the MRP area level ( Storage location MRP)?. If so please provide the steps how this needs to be set-up. what will the implications on the MRP. Thanks! Nagesh.

  • How to transfer iTunes to new mac while keeping library on external drive?

    I have a new iMac (running 10.4.11). Old mac is a G4 powerbook, which is synched to my ipods and iphone. My iTunes library is on an external hard drive. How do I get the new computer to "own" the iTunes account and media library so it will synch with

  • BAPI or FM to create an outbound delivery?

    Hi all, does anyone know of a BAPI or a Function Module that given only the sales order document number and the posting date to create an outbound delivery? (I am looking for something that creates automatically a delivery just like when I create a s

  • Create multiple management packs and groups

    Hi, I wonder if it is a way to create a lots of Groups and management packs automatically/scripted. My problem is that I have a list with about 200 services that I need to setup monitoring for. The monitoring are simple, its just if the service are s