Calling java APIs from a function module

Hi,
Can someone tell me whether it is possible to call Java APIs from a function module in SAP system?
Thanks in advance,
Vineetha

Hi,
I guess you have changed the properties of screen only.
I assume you have made a Ztransaction Code.
When you define a transaction code, you need to specify a screen number for radio option program and screen and you need to specify a screen and not subscreen.( I think so!!)
You changed only the code without changing the transaction code properties.
Therefore, i think u r getting a dump.
If you want to call your subscreen, call it in some screen and then call that screen using your transaction code properties.
To include a subscreen screen in the subscreen area of the main screen and call its PBO flow logic, use the following statement in the PBO event of the main screen:
PROCESS BEFORE OUTPUT.
  CALL SUBSCREEN <area> INCLUDING <prog> <dynp>.
To call the PAI flow logic of the subscreen screen, use the following statement in the PAI flow logic of the main screen:
PROCESS AFTER INPUT.
CALL SUBSCREEN <area>.
Refer:
http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
Regards,
Tanveer.
Please mark helpful answers.
Message was edited by: Tanveer Shaikh
Message was edited by: Tanveer Shaikh

Similar Messages

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Calling Java API from ABAP using JCo

    I need to call Java API from ABAP & BSP also. For this I have got useful information related to JCo from following blog:
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    But, I am facing one problem. On executing Java program myExample5.java (recommended by Gregor Wolf) from command line I get following error message:
    Server JCOSERVER01 changed state from [ STOPPED ] to [ STARTED ]
    Exception in server JCOSERVER01:
    com.sap.mw.jco.JCO$Exception: (129) JCO_ERROR_SERVER_STARTUP: Server startup failed at Thu Apr 26 13:46:32 IST 2007.
    This is caused by either a) erroneous server settings, b) the backend system has
    been shutdown, c) network problems. Will try next startup in 1 seconds.
    Connect to SAP gateway failed
    Connect_PM  TPNAME=JCOSERVER01, GWHOST=gateway, GWSERV=3300
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'gateway' unknown
    TIME        Thu Apr 26 13:46:32 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        336
    DETAIL      NiPGetHostByName2: hostname 'gateway' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1.
    Can anyone please help me out. Do I need to do any setting?
    I'll surely reward points.
    Thanks & Regards,
    Nilesh Kumar

    Hi Nilesh,
    From the error i think that the error is with the hostname.
    Please enter the the Application Server IP/Hostname.
    If you are loggin to SAP System "XX1" from SAP GUI. Then click the change Item tab and see Application server name/IP let say "XX2" for hostname or "xx.xx.xx.xx" for IP.
    Replace <i>srv[0] = new Server("gateway","sapgw00","JCOSERVER01",repository);</i>
    with <i>srv[0] = new Server("XX2","sapgw00","JCOSERVER01",repository);</i>
    If App Server is IP then replace with
    <i>srv[0] = new Server("xx.xx.xx.xx","sapgw00","JCOSERVER01",repository);</i>
    Let me know if it is throwing any error.
    Thanks,
    Prashil

  • How to call Java API from BSP?

    I have a requirement to call Java API from BSP application.
    I have checked the forum and found that it is possible by using some ABAP codes.
    However there is no pointer on how this is done.
    Can someone explain the details on how to call Java API from BSP is done?
    I found class CL_EJB_JAVA_OBJECT_METHODS to call a method in EJB but can't find function or SAP class to call Java API.
    Actually is there any BSP extention which can used to call Java API?
    Thanks,
    Hendri

    check out these weblogs, it should give you an idea how to go about it.
    /people/ignacio.hernndez/blog/2006/12/04/speech-synthesis-listen-the-application-server-is-talking-to-you
    /people/puru.govind/blog/2006/12/20/let-abap-speak
    Regards
    Raja

  • Calling Java API from ABAP using JCo (Part 2)

    Hello,
    This is an additional question to thread Calling Java API from ABAP using JCo
    Has anyone managed to get the input parameter value
    input.getString("REQUTEXT")
    that is being passed from ABAP?
    If yes, what kind of setting you need to do? Because when I execute, it has no value.
    Thus, the below ECHOTEXT parameter returns blank value:
    output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
    When I debug by printing the below line, the input XML is indeed without value:
    System.out.println(input.toXML());
    Anybody knows how to pass input variable from ABAP to JAVA using JCo?
    rgs,
    hiroshi

    Hallo Hiroshi,
    as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
    Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
    Bye,
    Sameer

  • Calling java method from c function

    Hi,
    I have been through some forums and tutorials, but nothing helps me yet.
    Here's my problem : I want to access java funtion from c function.
    <code java>
    public class MyClass {
    public int oneMethod() {
    return 5;
    </code java>
    <code c++>
    void main(int argc, char *argv[]) {
    // creation of JVM -> no problem
    cls = (env)->FindClass("MyClass");
    if (cls != 0) {
    // it finds the class
    mid = (env)->GetMethodID(cls, "oneMethod", "()I");
    if (mid != 0) {
    // it finds the method
    intReturn = (env)->CallIntMethod(cls, mid);
    printf("Result of oneMethod: %d \n", initReturn);
    </code c++>
    the initReturn gives me 0, and not 5. So what do you think the mistake is ?
    Should I pass by the GetClassObject() funtion, but in this case, what object would I pass in reference since I'm using a call from c to java.
    Thanks a lot for your response, and Happy new Year to all the comunity.

    1. You are - apparently - trying to call a method of a java object.
    2. But you are instead making the call on a class.
    3. You can do one of the following:
    o Pass a reference to the object as you call C.
    o Call some other java method (maybe static) that gets you a reference to a java object.
    o Use JNI to call a java constructor to create a java object.
    o Change your code to get the class object and call a static method.

  • Call Java Method From JavaScript Function

    hi everyone
    i need a help in calling Java method from a javaScript method
    ex:
    function confirmAddRecord() {
    cHours =document.getElementById('frmP:ChargeHours').value;
    cSTime =document.getElementById('frmP:ChargeStartTime').value;
    var answer = confirm("Are you sure you want to add Record?")
    if (answer){
    here i want to call the Java Method that is located in session bean that takes the upper params cHours & cSTime
    else{
    return false;
    i know i can do it as an action button but it is required me to be in that way can any one help plz
    Message was edited by:
    casper77

    That depends on the nature of your parameters. I guess you calculate the params on client and then want to submit them. In this case and if you don't want to use Ajax simple add some <input type="hidden"> elements (of course there correspondend components dependent of your framework) and store the params there. If the javascript isn't invoked by a button click, you can use a button nevertheless. Set visible="false" and call
    document.getElementById('client_id_of_my_hidden_button').click();
    (or maybe doClick() dependent on your framework).

  • Problem with calling a report from a function module. Please help! URGENT!

    Hi Experts,
       I have a scenarion like this:
      XI -
    > Function Module -
    > ABAP Report
      From XI I am callingf a function module in another R/3 system. This function module inturn calls a ABAP report using SUBMIT statement. The function module and the report reside in the same R/3 system.
      I am calling the report like this:
    SUBMIT yseg_save_bp_data WITH SELECTION-TABLE rspar
                                 AND RETURN.
    The problem is when I run the function module directly in the R/3 system then it calls the report without any problem.
    On the other hand, when I call the function module from XI then the report is not called. On debug mode I found that the program exits just at the Submit statement. Why is this strange problem?
    What mistake am I doing? Is there any limitations or restrictions with SUBMIT statement.
    What is the correct way of using submit statement in this scenario?
    Kindly help me!
    Thanks
    Gopal

    Hi Rao,
       I have created the FM as remote RFC. Infact XI is able to call the FM. Only problem is when it reaches the point where the report is called via SUBMIT it exits.
    Help me please!
    Thanks
    Gopal

  • Calling Java APIs from Adobe AIR Front End

    HI ,
    I have developed an desktop application entirely in java.
    Currently it is console based, but i am planning to have a UI for the same in Adobe Flex.
    I wanted to know how do I communicate between the two, ie call methods that are defined in my java classes from AIR and return results to Adobe AIR.
    There is no server involved.
    I want to keep Adobe AIR as front end and Java as back end which will take care of the business logic .
    Thanks and Regards,
    Santoshi

    The best way is probably to use the NativeProcess APIs available in AIR 2 (now in Beta).
    Next, would be to use sockets to communicate between the two processes. In AIR 1.5, it is difficult to guarantee that both processes are running, at least when controlling thins from the AIR side rather than the Java side. In AIR 2, you can start other processes, so this is also easier.
    There are some 3rd party tools, like Merapi, that help you pass objects between Java and AIR, too.

  • Calling Java API from HBR

    Hi guys,
    I’m trying to use Java API to update ASO cube from Planning forms. So there are several steps:
    1.     Planning form passes variables to HBR
    2.     HBR passes variables and calls Java CDF
    3.     CDF performs some operations and uses JAPI classes to update ASO cube.
    When I run CDF as runtime command or from JDeveloper/Netbeans if works fine. When I run CDF from HBR but do not use JAVA API methods it works too. But when I call CDF from HBR AND use JAPI methods it doesn’t execute JAPI methods. I do not receive any error; methods that use JAPI methods are simply not executed.
    Any ideas why it happens?
    Thanks,
    Dmitry

    Hi,
    Have you tried running it from an essbase calc script first and run the essbase server in the foreground (not as a service if you are on windows) then if you have any System.out.prints on errors or in your code they should be outputted to the window.
    It usually easier to get it running from a calc script first because you sometimes get better messaging than business rules.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Call Java Method from Callback function

    I am writing a JNI wrapper in c++ for a particular event driven DLL. The DLL makes a network connection to another device and then calls a callback function when events are raised on the device. The DLL has 3 basic functions: connect, disconnect, and registerEventListener. RegisterEventListener takes a function pointer which is called each time an event is raised on the device.
    My wrapper DLL exposes connect and disconnect functions via JNI. I can call these functions just fine from my Java code. Now the question... How do I call a Java method from my c++ callback function? I can call a Java method using env->CallXXXMethod(...) from within a function that is accessible to Java but I don't have access to the JNI parameters in my Callback function.
    So how do I call a Java method from a callback function? If this cannot be done then what is the "right way" to handle native event notification with JNI?

    jschell wrote:
    JNI parameters? Meaning what exactly?
    General outline of a callback
    1. Entry
    2. Get the VM, env - there are methods for this
    3. Attach the thread
    4. Get a java object - how depends on what you are doing, but create it or a static reference.
    5. Get the java method
    6. Call the java method.That is exactly correct. The callback function is called from a separate thread so using a cached pointer to JNIEnv, obtained from the original native method, crashes the JVM. The jmethodID and jclass objects (which are needed to call the static Java method) can be cached without problem. The following is the code I used to attach the current thread and call my static method.
    void MyClass::onEvent(int system_id, char* data)
         //get a pointer to the Java Environment
         JNIEnv *env;
         jvm->AttachCurrentThread((void **)&env, NULL);
         //Call the Java method with the newly aquired data
         jstring js = env->NewStringUTF(data);
         env->CallStaticVoidMethod(cls, mid, system_id, js);
    }My last question is about cleanup in this function. When I use NewStringUTF to "convert" my char* to jstring do I need to do anything special to clean up or will the Java garbage collector take care of it since the jstring is being passed to a Java method?
    Thanks for you help

  • Call Java Program from ABAP Program

    Dear all,
    In our scenario, we need to let ABAP call services provided by a standalone Java program. From online help I found some overview introduction and I'd make the called program a registered program in a RFC with type "T" (TCP/IP Connection). Can anybody give some concrete documentation? A step-by-step guide would be greatly appreciated.
    Best Regards
    Jerome

    check this thread
    Re: Calling Java API from ABAP using JCo

  • Getting values from a function module called in a WDA method

    Friends,
    I am trying to execute a function module from WDA.
    I have created a service call for the function module. The function module takes values from the user, looks up the corresponding values of another field and returns the values in an internal table.
    I am using the "Method Call in Used Controller" of WD Code wizard to call the function module.
    When the event handler method containing the call to the function module is executed, nothing happens.
    I am not sure how to pass values to the function module and to get the return values from the function module.
    I am new to using function modules from WDA. Please help me out.
    Thanks and Regards.

    Rashmi,
    Is the function module intended to collect input data from the UI and process it? - Yes
    If yes, then the input (importing parameter) to the Function Module is a table of values (which should be ideally from the context mapped to the Table UI Element). - The importing parameter is a single value NOT a table and is mapped to the view context.
    Now this table UI Element is bound to the view controller context , which in turn is mapped to the component controller context. And you are indeed being able to read the value of this internal table in the component controller method where the function module is being called by means of get_static_attributes_table (Is this right? - Yes, I am able to read the table of values that is passed from the component controller view to form view context by using get_static_attributes_table.
    Or are you being able to read it in the event handler method of the view controller and not being able to read it in the component controller method) -
    The function module takes a single value as import parameter and returns a table of values as return value.
    It works fine when no importing parameter is being used and returns the table of values that is getting passed from component controller context to form view context when i am able to read it using get_static_attributes_table.
    Now the question is: how to pass the import parameter value to the function module. I assumed since the importing parameter is a context node (like the return values are), i should set the value ( captured when the user enters the value in the form) to the importing parameter context attribute using set_attribute method. Since it is mapped to the component controller context, i assumed it will get passed and the method will take it as input parameter.
    Let me know if my assumptions are correct regarding passing the import parameters and what is missing here.
    Thanks and Regards.

  • Calling a Selection Screen from a Function Module/Method

    Hi,
      I would like to call a selection screen from a function module or method. I understand it is not possible by the definition. Are there any alternative options as I am looking for the Variants Save option on the screen. Any thoughts?
    Thanks
    Raghav

    Since i don't know your exact requirements (standard SAP selection screen? your own selection screen?) the onl;y thing i can come up with is:
    1. in your function pool create your own screen with a subscreen area
    2. create your own selection screen as a subscreen.
    3. include the selection subscreen in the first screen
    4. call the first screen in your function.

  • Call a remote Java API from PL/SQL

    Hi
    I want to call a remote Java API from my PL/SQL. Can someone please provide me the steps to do this?
    Thanks in advance
    -G

    Hello
    thanks for the link. But is not telling me what I want.
    I dont have java in my computer. I will be supplied with a java API name which I have to call by connecting to remote server. I will be have the username and password to connect and call the remote API. I need to get the return value from the remote Java API in my PL/SQL. I hope I have explained the issue clearly.
    Thanks again.
    -G

Maybe you are looking for

  • Vendor Account group assign recon. account

    Hi Experts, I'm looking tcode to assing recon. account for vendor account group. I created Vendor account group and recon. account. I would like to have in tcode fk01 assing Vendor account group to recon. account. Now in tcode fk01 I choose vendor ac

  • Linksys WRT54 and WRT110 doesn't pass internet connection through it

    Hi guys, I have a WRT54 and recently got a WRT110 to try to add another access point since our house is too big for just one. After trying to make it work, the direct connections do not work anymore. If I connect directly (through a coupler) from the

  • PSE 7 Green Eyes

    I obtained a trial version of PSE 7.0 to try to correct green eyes in photos of our Westies. The Photoshop web site says the red-eye fix in Quick Fix also removes green and white eyes for animals. I tried it on three photos, and it does not. I also t

  • Add IDOC in TCODE IDX2

    Hi all Im trying to add a IDOC from the ecc system to the xi system in idx2. When I try to add the IDOC I get error: Runtime error RFC_NO_AUTHORITY has occurred Anyone know why this error is occuring? Regards

  • Can WEBI Insert external files in report?

    BO 6.5 can a Webi report be instructed to insert external files in the report layout, from .pdf or .doc files stored externally on the BO server Windows system? This will be static information, for eg a Cover Sheet.  Currently I am able to insert a s