HANA Server site JavaScript how to call functions in another .js file? thanks

In HANA Studio, I have created a .js file and a server site javaScript .xsjs file. The .js file and .xsjs file are in the same path .I create function F1() in js file. Then I want to call function F1 in xsjs file. But it always through an error “f1 was used before it was defined”. Any suggestion? Thanks very much
.js file:
.xsjs file:

Hi Jim,
Now I have found the method how to use external library. If we want to outsource some of xsjs functions to an external library, XSEngine provides a special format for this, called “.xsjslib”. Then in xsjslib file, we define functions need to be outsourced.
In .xsjs file, we can import a library using the following code:
$.import("<Package_Library_was_deployed>","xsjslib File Name");
The Package_Library_was_deployed please refer to:
Access functions inside library by this path:
$.Package_Library_was_deployed.xsjsFileName.FunctionName();

Similar Messages

  • How to call method in another swf file

    Hi. I am at the moment making a website in Flash 8. The
    website consists of a main file with the buttons and then
    additional files for each page. Each of the buttons uses code
    similar to this:
    content.loadMovie("home page.swf");
    where content is the movieclip I am using to load the swf
    file into. In the main file I have a search box where a user can
    type some search terms. I have written some code that will search
    through the text field(s) on the page and highlight any words that
    appear matching the search terms. The only problem is that I cannot
    get to the text fields on the other files. So what I want to be
    able to do is attach some code to the search button that will call
    a method in another swf file using the parameters that I the user
    has specified in the search box. How would I go about doing this?
    Any help is much appreciated
    JM Young

    Place functions in the external swf. Then you can call them
    through the container clip
    content.yourFunction(args);
    Realize however, you cannot call code in an external swf
    until the frames with the functions are loaded. Timing would be an
    issue if the user can beat the loading clock or if you have code
    that is executed automatically after you start the load.
    So if timing becomes an issue, use MovieClipLoader and the
    onLoadInit method.

  • How to call function in included dll file through java application.

    Hi All,
    i am trying to create an java application which call c# functions using JNI. i am completed with the code and it is running fine when i tried to run from netbeans IDE. But when i tried from Calculator.jar file, first time it throws this error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CSharpClient in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at calculator.CalculatorApp.<clinit>(CalculatorApp.java:20)
    After that i included that dll file in the cuurent directory. And compiled and tried to run, it throws an unexpected error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    *# An unexpected error has been detected by Java Runtime Environment:*
    *# Internal Error (0xe0434f4d), pid=2640, tid=3700*
    *# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)*
    *# Problematic frame:*
    *# C [kernel32.dll+0x12a5b]*
    *# An error report file with more information is saved as hs_err_pid2640.log*
    *# If you would like to submit a bug report, please visit:*
    *# http://java.sun.com/webapps/bugreport/crash.jsp*
    Anyone have idea how to solve this error.
    Thanks in advance.

    This error is created whenever things go sour on the native side. The first thing you can try, and I assume you are using a Java<->C++<->C# bridge which includes two dlls, one created by C++ and another by C#. Is to make sure that the C# dll is compiled using /t:module switch during compilation.
    If you are using VS2008, or VS2005, you can add a post build syntax like:
    csc /t:module /out:"$(ProjectDir)$(OutDir)YourModule.dll" "$(ProjectDir)YourCSfile.cs"
    Hope this helps! If not, ensure first that the native code works by creating a native test app for it.

  • How can HANA Server Side JavaScript use "Eval" function?

    Hi HANA Experts,
      I use EVAL function to create an object by classname in xsjs file, but it has an Error "Eval is evil". In Client javascript, we can use the Eval function. How can we use "EVAL" function in HANA server side javaScript?  Thanks a lot.

    That looks like the client side JSLint check to me.  Those can be customized or even turned off. If you truly want to use eval.
    >XSJS inherits most of the features of javascript but do not expect all of its features
    Actually that's not exactly accurate.  XSJS is standard ECMA JavaScript (Mozilla SpiderMonkey VM).  It does run in strict mode, however. This isn't a limitation of XSJS but a conscious decision to force the VM into the strict mode - which is really the recommendation for JavaScript anyway.  We also apply JSLint checks as above. Sometimes they are quite restrictive. However they can be customized or even completely turned off at the project level:
    To the point of Eval, there are some excellent articles online.
    http://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/
    coding style - When is JavaScript&amp;#39;s eval() not evil? - Stack Overflow
    JSLint Error Explanations - eval is evil

  • How to call function in jar file?

    First, I can't write english well.(I'm korean.. ) sorry about that.
    I have known function in jar file.
    but I don't know how to call function in jar file.
    how can I this work?
    My project and another project are respectively developing D-project with me and other man.
    so i need it. or I can't do this work.
    I will paste other's source code in my source code.
    and then recomplie , build it.. but it is not my wish!
    thanks for reading my sentence.

    If you have a jar file with a class that you wish to use, then you must add the jar file to your class path ($CLASSPATH on unix, linux, etc. and %CLASSPATH% on Windows).
    Then you can use the class normally, just as you would if it were not in the jar.
    If you meant something else, you'll need to explain what you meant.

  • HOW TO CALL FUNCTION MODULE INSIDE SMARTFORM

    PLEASE ANYONE TELL ME, ABOUT  HOW TO CALL FUNCTION MODULE INSIDE SMARTFORM. IT IS VERY URGENT!!!!!!!!!1

    Hi,
      Under Global Definitions, we have 'Form Routines' tab. Under this tab, u can have a dynamic subroutine call. With in FORM and ENDFORM, you can call the Function Module.With in the Program Lines editor, u can define the subroutine........PERFORM. 
    If helpful, reward points.
    Rgds,
    CK

  • How to call a exe or bat file from java program

    hi,
    i actually want to know that how to call a exe or bat file from program so that i can run them parallely.

    Try this :
    String strCmd = "myFile.bat";
    try
         Runtime rTime = Runtime.getRuntime();
         Process process = rTime.exec(strCmd);
         InputStream p_in = process.getInputStream();
         OutputStream p_out = process.getOutputStream();
         InputStream p_err = process.getErrorStream();
         p_in.close();
         p_out.close();
         p_err.close();
    catch(Exception e) {
         throw new Exception("Unable to start, "+strCmd);
    }

  • How to call Function Module in Selection Screen

    Hi All,
    I have developed one HR Report (Qualification Overview Report: To display all active employees and their Qualifications along with their Proficiency).
    Already it has 3 selection fields on selection screen and now I want one more field on selection screen like Qualification Id.
    But when the end user press F4 it should display the Popup which comes in TCode: PA30 at the time of Creating Qualification.
    I have debugged the Standard Code and searched the Function Module: 'RH_OBJID_REQUEST' which shows Popup which I wanted to show at Selection screen for newly added field.
    So I have to define new field like 'Qualification Id' and want to attach above Function Module so that it will cater my requirement.
    If anybody has worked on this type of requirement then please let me know.
    Thanks,
    Jay.

    Hi Raymond,
    I have written following code:
    s_quali is used in selection screen for Qualification Id.
    SELECT-OPTIONS :  s_quali   FOR hrp1000-objid NO INTERVALS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_quali-low.
      CALL FUNCTION 'RH_OBJID_REQUEST'
        EXPORTING
          plvar           = '01'
          otype           = 'Q'
          seark           = '*'
          seark_begda     = '18000101'
          seark_endda     = '99991231'
          set_mode        = 'X'
        TABLES
          sel_objects     = git_objects.
      LOOP AT git_objects INTO wa_objects.         " Logic is to fill up the Selection screen field
        s_quali-low = wa_objects-objid.
        APPEND s_quali TO s_quali.
        CLEAR : s_quali, wa_objects.
      ENDLOOP.
    Now problem is that, its not populating all values in selection screen which I select from Popup screen (Choose Qualification).
    I checked that the first value in the internal Table is over written by second records in the internal table
    For e.g.: If I select 001,002,003,004 from Popup screen then I am able to see only 002,003,004 in the Multiple selection view of that field though it is available in the internal table s_quali (because I am filling up the table using Loop-Endloop)
    Please advise me how to overcome this issue. (How to fill up selection screen)
    Thanks,
    Jay.

  • How to call functions defined and packed in a .dll file

    hi,
    my client have provided me with a .dll file which implements all functions tasks.
    earlier we created a applications in vb that accessed functions from the .dll file provided by client.
    now he wants java implementation of the same application written in vb.
    now how to access functions in .dll file provided by the client from java source code.
    regards,
    s.mohamed asif

    For this you should write JNI wrappers for the native functions, that is you create class with the native function prototypes as native methods, implement these methods with native functions in JNI module, each JNI function calls a native function from your DLL.
    I know that JNI coding is a greate pain. That is why I am developing Java Platform Invoke which is a paradigm of .NET Platform Invoke. See my demo at
    http://www.sharewareplaza.com/Java-Platform-Invoke-API-Demo-version-download_49212.html

  • How to call function module/ class method of another system.

    Suppose now i am working in System A. And i need to check the system Status of System B, System C, System D....
    my design is to provide an interface. and each system realize the interface individually.now my question is how cani call the interface, because they are in different systems.
    of course i know about the host name, port and logon information over these systems.
    who can give my some suggestions or other solutions.
    thanks in advance.
    Johnney.

    Hello,
    If u want to call a FM of the other system then that FM should be a RFC enable on one.
    <b>CALL FUNCTION func DESTINATION dest.</b>
    Effect
    Executes the function module from an external source (as a Remote Function Call or RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed in another R/3 or R/2 System. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    To maintain existing destinations, choose Tools -> Administration, Administration -> Network -> RFC destinations
    Note
    Under certain circumstances, an RFC may trigger a database commit. For this reason, RFCs must not be used between pairs of SQL statements that open and close a database cursor (such as SELECT... ENDSELECT).
    Vasanth

  • How to call function module from IP

    Hi
    I need to trigger the process chain from the input ready queries in Bex analyzer. I figured out that I need to call RSPC_API_CHAIN_START.
    How do we go about in calling the above function module in IP.
    Thanks in advance
    I

    Hi Matt
    Thanks for your response, it was very productive at the right time as we saw our process chain running indefinetly. With selecting all chars to be changed, it ran just once with no errors.
    what is TA ? I know rsplan- transaction code for the planning modeler.
    Can you tell me how can we call function module in custom exit planning function.
    Where should I embed the code
    CALL FUNCTION 'RSPC_API_CHAIN_START'
                   EXPORTING
                     I_CHAIN             = 'ZPC_CCATOPCA'.
                   I_T_VARIABLES       =
                   I_SYNCHRONOUS       =
                   I_SIMULATE          =
                   I_NOPLAN            =
                 IMPORTING
                   E_LOGID             =
                 EXCEPTIONS
                   FAILED              = 1
                   OTHERS              = 2
    thanks in advance

  • How to call function which return and out

    My function specifcation is
    FUNCTION GetGoogleScholarActivation (
    pi_clnt_id IN google_scholar_status.clnt_id%TYPE,
    pi_status_type IN ci_status_type_tab_type,
    po_status OUT ci_status_tab_type,
    po_date OUT ci_date_tab_type
    RETURN NUMBER ;
    where type is
    TYPE ci_status_type_tab_type IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    TYPE ci_status_tab_type IS TABLE OF VARCHAR2 (10) INDEX BY BINARY_INTEGER;
    TYPE ci_date_tab_type IS TABLE OF VARCHAR2 (8) INDEX BY BINARY_INTEGER;
    I am trying to call function in SQL PLUS for testing as
    declare
    var number ( 10);
    TYPE p_st1 IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    p_st p_st1 ;
    type p_status1 IS TABLE OF VARCHAR2 (1) INDEX BY BINARY_INTEGER;
    p_status p_status1 ;
    TYPE p_date1 IS TABLE OF VARCHAR2 (8) INDEX BY BINARY_INTEGER;
    p_date p_date1 ;
    Begin
    p_st(0) := 'A';
    var := PQDKGOSH.GetGoogleScholarActivation(11920 , p_st, p_status ,p_date );
    dbms_output.put_line ('Activation_status '|| p_status(0) );
    dbms_output.put_line ('Activation_date '|| p_date(0) );
    dbms_output.put_line ('Retun Value'|| var );
    End;
    but getting error PLS-00306: wrong number or types of arguments in call to
    'GETGOOGLESCHOLARACTIVATION'
    so how to test from SQL Plus

    HI
    I tried to execute below like this
    declare
    var number ( 10);
    p_st ci_status_type_tab_type ;
    p_status ci_status_tab_type;
    p_date ci_date_tab_type;
    Begin
    p_st(0) := 'A';
    var := PQDKGOSH.GetGoogleScholarActivation(11920 , p_st, p_status ,p_date );
    dbms_output.put_line ('Activation_status '|| p_status(0) );
    dbms_output.put_line ('Activation_date '|| p_date(0) );
    dbms_output.put_line ('Retun Value'|| var );
    End;
    still iget error
    PLS-00201: identifier 'CI_STATUS_TYPE_TAB_TYPE' must be declared
    becuse this declareation i did in package specification .
    and i am trying to execute the function .

  • How to call functions in windows or Solaris in servlet?

    Hello,
    Does anyone know if there is a way for servlets to call functions in windows or solaris shell command????
    Thanks :)

    Checkout the Runtime.exec family of methods.
    I would think carefully if calling a shell script or batch file from a J2EE web component is something you really want to do though.

  • How to call function in FOX

    In fox , can I use call function which developed by ABAP?
    I want to use the call function to read table in FOX.
    thanks

    hi
    u can use functions, but not complex.
    the syntax is as follows
    CALL FUNCTION UPC_FUNCEXEC_SAVE
    EXPORTING
    I_NO_TRANSACTION_DATA = FLAG
    tx
    srin

  • HOW TO CALL FUNCTION MODULE FROM ABAP4 EDITOR

    HI !
    friends
    I want to call function module from abap 4 editor.
    is there any shortcut key from edit menu through which if give a function module name then  it calls the function automatically?
    points will be awarded.
    Cheers
    troy

    command will be like this
    <b> call function 'YW2_GET_MNW_PERIOD'
            exporting
              w_budat       = v_datum
            importing
              w_period      = i_date-period
              w_period_desc = i_date-p_desc.</b>
    Regards
    prabhu

Maybe you are looking for