How to invoke java application from ABAP

How to invoke java application from ABAP  ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
Thanks,
Manish

Hi Manish,
did you get some further documents concerning "abap program calls ejb"?
If yes, could you please send me some informations.
Thank you for your help.
Kind regards, Patrick.

Similar Messages

  • How to call  java program from ABAP

    Hi Experts,
         My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
      Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
    DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
    parameter TYPE string VALUE 'D:java MyFirstProgram'.
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application = command
    parameter = parameter
    OPERATION = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    OTHERS = 8.
    Thanks.

    This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
    Implement an RFC server in 7.0:
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Implement an RFC server in 7.1 or higher:
    http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm

  • How to run Java codes from ABAP

    Hi Gurus,
    I have .JAVA & .CLASS files which connect to the website through HTTPS connection and generates the TEXT file at C:\ by obtaining some data from WEB Site. This java files needs SSL certificate Which has been imported in SAP. How can i run the Java files from SAP R/3, Please help me.
    Thanks
    Ganesh

    hiii
    refer to following link..
    Java from ABAP?
    Re: Calling Java API from ABAP using JCo
    i hope it will solve your problem
    regards
    twinkal

  • How to launch Java WebDynpro From ABAP?

    I have a requirement to launch a Java WebDynpro from ABAP code. Has anyone done this? If so, does anyone know of documentation/sample code or at least an ABAP class/function group I could look at?
    Thanks in advance.

    The webdynpro application can be triggered simply by a URL, so this is really easy in ABAP.
    All you need to know is the URL for the WDJ application running on your java engine.
    report zrich_0001.
    data: url type string.
    url = 'http:\www.sap.com'.
    call method cl_gui_frontend_services=>execute
       EXPORTING
         DOCUMENT               = url.
    Regards,
    Rich Heilman

  • How to remove Java Applications from "Add and Remove Programs" list?

    I have deployed my Java applications (both JWS and Applet) via JNLP with allow-offline option enabled and without installer-desc option specified.
    My questions are:
    1. An entry is added to the Add and Remove Programs list after launching the application via JNLP. Is it due to the specification of JNLP or JWS? Is there anyway to prevent this behavior?
    2. I removed my application by clearing the cache via Java Control Panel but the entry for the application is still listed in Add and Remove Programs. How can I remove the entry in the Add and Remove Programs?
    I have tried following methods but neither works:
    1.Go to Add and Remove Programs, and click [remove] button to the right of my application.
    *Warning message like 'Application cannot be uninstalled completely' is thrown.
    2.Follow instructions listed @ [Microsoft Online Support site|http://support.microsoft.com/kb/314481/en-us] to remove my application manually via Windows registry.
    *Couldn't find appropriate registry entry to delete.
    Thanks in advance!

    Hi, guys!
    This issue has been officially approved as a new bug (Bug Id: 6946221) for the JDK 1.6_20(might include any release below) release.
    It will take a couple of days for it to be shown up in the external Bug database. However, once it becomes available for viewing on external Bug database.I would like to encourage your valuable participation to vote on this bug to get it fixed ASAP by the SUN developer teams.
    Java Bug Database @
    [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6946221]
    Voting for the bug @
    [http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221|http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6946221]
    Thank you for your cooperation!
    Edited by: Jay-K on Apr 23, 2010 12:14 AM

  • How to invoke Java class from post.POST.jsp

    Hi All,
    I am trying to invoke a simple java method from post.POST.jsp
    I am getting below exception while doing it.
    org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 32 in the jsp file: /apps/mywebsite/components/customFormAction/post.POST.jsp
    The method test() is undefined for the type DatasourceUtil
    29:          
    30:           ///
    31:          com.day.test.datasource.DatasourceUtil dsUtil = new com.day.test.datasource.DatasourceUtilImpl();
    32:          dsUtil.test();
    33:           //dsUtil.validateLogin(request.getParameter("username"), request.getParameter("password"));
    34:          
    35:           ////
    It appears to resolve the class correctly. I could run the code, if I only comment  dsUtil.test();. As soon as I uncomment, it gives above error.
    In the Utill I have a simple void method which will print a simple text. My package structure is as follows.
    any help will be great
    Tx

    1.  In the interface [1] not the implementation[2] have u defined the method test?
    2.  If it is implemented, Change the bundle version in bnd file and make a new build. Then from felix console verify the latest version reflected in the bundles.
    If 2 works & you are going to make lot of frequent changes then give the version as snapshot till it get stable.
    [1]  com.day.test.datasource.DatasourceUtil
    [2]   com.day.test.datasource.DatasourceUtilImpl

  • How to invoke Java method from C++

    Hi
    My requirement is In C++ we are having three different structures, like
    struct one{
    int accontno;
    char * accountholdername;
    long balance;
    struct two{
    int startdate;
    int enddate;
    struct three{
    char* userid;
    char* userpassword;
    from c++ how to pass these structures, these structures I have to read in Java class, and in java how receive these structures.
    And the sample methods will be like: getCarsData(Input, output, Error);
    How do i call the method in JNI, if it is static int method we can call like
    getStaticIntMethodID(), instead of int if i have to pass the above mentioned structures how do i do? Should i create an object array in JNI for accessing these three structures?
    Suggestions/Samples welcome
    Thanks,

    Why did you start another thread for this?
    I was answering you in the [url http://forum.java.sun.com/thread.jspa?threadID=712137&messageID=4119725#4119725]old thread and you didn't even bother to answer back my (basic) questions.
    I told you to use the code tags when pasting code. Got ignored. I also gave you a starting example on how to achieve your goal. Flushed.
    Oh well, I'm getting used to it.
    Again.
    Before starting, allways keep near you the [url http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html]JNI reference. All the JNI functions are documented in it.
    First you need to create custom Java classes that will match the C++ stucts (remember?).
    There is no magic wand in JNI that will transform the C++ structs into the custom Java classes and vice versa.
    You'll have to code it by hand, one field at a time. It's a pain.
    So for the one, two, three C++ structs (why not posting some real names instead of this crap?),
    there will be JOne, JTwo and JThree Java classes.
    There is also that other Java class already existing with getCarsData() static method that will fetch the data.
    And finally the DLL function wich will call this Java static method, doing the bridge between the C++ structs and the custom Java classes, finally return the data.
    Due to the lack of explanation from your posts, I will say that the getCarsData() static method receives a parameter of type JOne
    and returns an array of JTwo objects.
    So the get_cars_data() DLL function receives a parameter which is a struct one and
    returns a pointer to an array of struct two elements.
    // C++ structs
    struct one {
        int accontno;
        char * accountholdername;
        long balance;
    struct two {
        int startdate;
        int enddate;
    struct three {
        char * userid;
        char * userpassword;
    // custom Java classes
    class JOne {
        int accontno;
        String accountholdername;
        int balance;
    class JTwo {
        int startdate;
        int enddate;
    class JThree {
        String userid;
        String userpassword;
    // Java class with static method that gets the data
    class DataFetcher {
        static JTwo[] getCarsData(JOne one) {
    // DLL function
    // struct 'one' parameter is already filled with values.
    // Returns an array of 'two' C++ struct obtained from a Java static method
    two * get_cars_data(one o) {
        JNIEnv * env;
        /** not show here is the code to either
            create the JVM or
            attach it to the current thread **/
        // get the data from 'one' C++ struct and put it in a new instance of JOne Java class
        jclass oneCls = env->FindClass("JOne");
        jmethodID oneCtorID = env->GetMethodID(oneCls, "<init>", "()V");
        jfieldID accontnoID = env->GetFieldID(oneCls, "accontno", "I");
        jfieldID accountholdernameID = env->GetFieldID(oneCls, "accountholdername", "Ljava/lang/String;");
        jfieldID balanceID = env->GetFieldID(oneCls, "balance", "I");
        jobject oneObj = env->NewObject(oneCls, oneCtorID);
        env->SetIntField(oneObj, accontnoID, o.accontno);
        env->SetObjectField(oneObj, accountholdernameID, env->NewStringUTF((const char *)o.accountholdername));
        env->SetIntField(oneObj, balanceID, o.balanceo);
        // call the Java static method
        jclass dfCls = env->FindClass("DataFetcher");
        jmethodID getCarsDataID = env->GetStaticMethodID(dfCls, "getCarsData", "(LJOne;)[LJTwo;");
        jobjectarray twoArray = (jobjectarray)env->CallStaticObjectMethod(dfCls, getCarsDataID, oneObj);
        // create the 'two' C++ struct array from the Java array of JTwo objects
        jclass twoCls = env->FindClass("JTwo");
        jfieldID startdateID = env->GetFieldID(twoCls, "startdate", "I");
        jfieldID enddateID = env->GetFieldID(twoCls, "enddate", "I");
        jint len = env->GetArrayLength(twoArray);
        two * pt = new two[len];
        for (int i = 0; i < len; i++) {
            jobject twoObj = env->GetObjectArrayElement(twoArray, i);
            pt.startdate = env->GetIntField(twoObj, startdateID);
    pt[i].enddate = env->GetIntField(twoObj, enddateID);
    // return the resulting 'two' C++ struct array
    return pt;
    Regards

  • How to restart Java Application from state when system crash

    I want to know about the API that provide mechanism to save your program state peroidically or any specific task completed of application and if system crash and next time when application restart it should be started from previous state.
    I required solution urgently plz. replay as soon as possible

    write it yourself.
    Serializable Interface, FileOutputStream, ObjectOutputStream ... that'd be a start for you.

  • Problems to invoke java.exe from Java application, but ok for javac.exe??

    How to invoke DOS application from Java application??
    I try the following but it didn't work to invoke command prompt and java.exe, it
    is working to invoke javac.exe. Any ideas why??
    import java.io.*;
    public class CallJavaTest
    { public static void main(String[] args)
    { try
    Runtime.getRuntime().exec("C:\\WINNT\\System32\\cmd.exe"); //doesn't work!!
    Runtime.getRuntime().exec("javac "+ "Test.java"); //it works!!
    Runtime.getRuntime().exec("java "+ "Test"); //doesn't work!!
    catch(IOException e)
    System.out.println(e);

    hi
    String[] cmd = {"cmd","/c", "start",enteryourdoscommandhere};
    Runtime rt = Runtime.getRuntime();
    Process ps = rt.exec(cmd);
    ps.waitFor();
    int ev = ps.exitValue();
    it works for my winXP.
    hope it can helps and not too late ..

  • How to call a WD JAVA application from a WD ABAP application

    Hi experts,
    Here I have two applications with me. One has been created through WebDynpro ABAP while the other one has been created through WebDynpro JAVA. Now i have to call upon the JAVA aplication from my ABAp application. In other words in need to integrate both the applications so as to have an easy navigation in between them.
    In the whole process I need to take care that the data is not lost from both ABAP or JAVA side.
    Please help me someone knows the solution.
    Regards,
    Kaustubh Maithani

    Hi,
    Usally to run WebDynpro for Java Application, we get the Application URL.
    If you want to call this WebDynpro Java Application from Webdynpro Abap, then create UI element like Link to Action or LinktoURL and give the url as WebDynpro for Java URL.
    Regards,
    Lakshmi Prasad.

  • How do I start and suspend Java Application from say C++ program

    I want to start a Java application via C++ and on some condition i want to suspend the same program not terminate , but suspend

    Have you tried running the virtual machine from your C++ application ? You can start Java applications from your C++ application using JNI after starting the Virtual machine from within your C++ application. According to the Java documentation you can even now stop the virtual machine from within your C++ program.
    I haven't looked at the 'suspend' detail but I suppose it will not be a problem to call a method via JNI to set a flag to suspend a thread etc.
    There is a tutorial: 'Invoking the Java Virtual Machine' at the following URL: http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html.
    This example seems to work only for version1.1 of the JDK. For JDK1.3, version 1.2, (I am not so sure whether I fully understand Sun's version numbers for Java yet) there is some updates on the JNI for starting the VM from C++. This article is called 'JNI Enhancements'. The URL for this article is:
    http://java.sun.com/j2se/1.3.0/docs/guide/jni/jni-12.html
    You have to set version to: JNI_VERSION_1_2
    There is only one problem. I get an error when calling JNI_CreateJavaVM from C++. I could not find any documentation that indicates how you can go about diagnosing what is causing the problem. Normally in Visual C++ you can just get the probable cause by inspecting GetLastError() or the function itself can return helpful diagnostic (error) codes.
    If you manage to start the VM correctly from within Visual C++ please let me know. My email address is [email protected]
    good luck
    Henko

  • Invoke one java application from another?

    Hello,
    Can anyone tell me how to Invoke one java application from another?
    Suppose I have a small java application say, Hello.java which has its own main() method and
    I also have another java application, say World.java which has its own main() method too.
    What I want to do is invoke or startup World.java from Hello.java.
    If possible kindly give code examples?

    main is just a normal method so Hello can invoke the main method of World just as it would invoke any other method.
    Kaj

  • Calling Webdynpro Java Application from Webdynpro ABAP Application.

    Hi,
    We have developed one Application using Webdynpro Java and I m in need to call the Webdynpro Java application from Webdynpro ABAP.
    Require Suggestions to acheive this.
    Thanks In advance.
    Reg,
    Ajay.

    Dear Ajay,
    Assuming that both your applications WDA & WDJ are in the portal & you don't have to pass any parameters to the WDJ application.
    Write the following code on the action  where you would call the WDJ application.
      DATA:
            lr_compcontroller TYPE REF TO ig_componentcontroller,
            l_component TYPE REF TO if_wd_component ,
            lr_port_manager TYPE REF TO if_wd_portal_integration ,
            wa_navigation TYPE navigation.
      lr_compcontroller =   wd_this->get_componentcontroller_ctr( ).
      l_component = lr_compcontroller->wd_get_api( ).
      lr_port_manager = l_component->get_portal_manager( ) .
    * The value inserted into the navigation-target field can be found in the Portal
    * content administration tab of your portal. It is the ID or PCD Location field
      wa_navigation-target = pcd. " Please provide the PCD Location of the WDJ Application here.
      wa_navigation-mode   = '0'.  "0 = INTERNAL(same page) and 1 = EXTERNAL(new page).
      CALL METHOD lr_port_manager->navigate_absolute
        EXPORTING
          navigation_target = wa_navigation-target
          navigation_mode   = wa_navigation-mode.
    You can get the PCD from the Page properties of the WDJ application page in the Portal.
    Hope it helps!
    Warm regards,
    Upendra Agrawal

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

  • How to open a java application from a web page?

    Friends
    I am in a situation to open a java application from a web page. I wrote a applet and placed a button on it. Onclicking of that button i con't open my java application. plz help me to open a userdefined application from web page.
    Ramesh
    e-Brahma technologies

    http://java.sun.com/products/javawebstart/index.jsp

Maybe you are looking for

  • Open Interactive Reporting report using smartcut

    Hello, i was wondering if i can open an Interactive Reporting report from a link from a separate web server (not workspace). I know i can add username and password to my smartcut link to open my report directly. Is there a way to use encrypted passwo

  • Interfering Movie Clips

    Hello Community, I can't believe that I have only run into this (what should be a relatively simple) problem after so many successful AS2 projects. Anywho, here's the skinny: I have a video screen that I feed vids to with the NetStream Class that is

  • Exclude Baggage Files From RH8 Search

    Hi... I have noticed that you can exclude pages from appearing in the RH8 search (Topic Properties > Exclude From Search), but are you also able to do this with baggage files? (now that RH8 indexes those too). I have a large number of PDF baggage fil

  • Installed 64bit CrystalReportsServer2013 in Program Files (x86) - Re-install?

    Hi: I have installed 64bit CrystalReportsServer2013 in Program Files (x86). Should I go back and re-install? Will it even let me change the directory once I have installed it already?                                       ...thanks, Stan

  • Mother wavelet definitions used in Advanced Siglan Processing Toolkit

    I didn't find the functional form nor the center frequency of the predefined mother wavelets used in AWT and CWT anywhere from NI documentation. I assume that wavelet analysis used in Advanced Signal Processing Toolkit follows the general framework o