Calling a native function from a dll

Hi all,
I want to call an api function exported from a dll using java. For example l like to call a function from kernel.dll (Windows). How can i do this. Do i have to create another dll for this?

hi,
you need to use JNI
you have to create de DLL , and call kernel32.dll in.
like that:
java_class.class ==> first_dll.dll ==> kernel32.dll

Similar Messages

  • Calling native functions from java w/out DLL

    If I invoke a JVM inside my c++ app and try to start up a class that calls a native function, do I still need a DLL for that? Or will it look to my header file and then look to my implementation somewhere in a c++ class?
    For example:
    WinMain() - Invokes JVM and loads "HelloWorld" java class, then calls its 'main' method.
    HelloWorld.java - 'main' method calls "displayHello();" a native function.
    HelloWorld.h - defines displayHello native interface
    So it looks simply to the cpp implementation of the interface...I tried executing this but it isnt working...is it even possible?

    OK, I attempted what you posted by writing the following code... please look at because I get a 'main' not found error. I am trying to execute this from a win32 app...
    Callbacks.java:
    class Callbacks {
      private native void nativeMethod(int depth);
      private void callback(int depth) {
        if (depth < 5) {
          System.out.println("In Java, depth = " + depth + ", about to enter C");
          nativeMethod(depth + 1);
          System.out.println("In Java, depth = " + depth + ", back from C");
        } else
          System.out.println("In Java, depth = " + depth + ", limit exceeded");
      public static void main(String args[]) {
        Callbacks c = new Callbacks();
        c.nativeMethod(0);
    }InvokeJVM.cpp:
    #include "InvokeJVM.h"
    //Log any windows errors
    void InvokeJVM::LogWin32Error(const char * pTitle){
         PCHAR pBuffer;   
         LONG  lError = GetLastError ( );
         FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
              NULL,                   
              lError,                   
              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),                   
              (char *)&pBuffer,                   
              0,                   
              NULL );
         //LogError ("Win32 error: %s %s\n",pBuffer,pTitle);
         LocalFree ( pBuffer );
    //Get a string returned from the windows registry
    bool InvokeJVM::GetStringFromRegistry(HKEY key, const char *name, unsigned char *buf, int bufsize){
         DWORD type, size;
         if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0 && type == REG_SZ && (size < (unsigned int)bufsize)){
              if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0){
                   return true;
         return false;
    //Get the path to the runtime environment
    bool InvokeJVM::GetPublicJREHome(char *buf, int bufsize){
         HKEY key, subkey;   
         char version[MAX_PATH];  
         /* Find the current version of the JRE */
         if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY,0,KEY_READ,&key)!=0){
              //LogError("Error opening registry key '" JRE_KEY "'\n");          
              return false;   
         if(!GetStringFromRegistry(key,"CurrentVersion",(unsigned char *)version, sizeof(version))){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\CurrentVersion\n");          
              RegCloseKey(key);          
              return false;   
         if(strcmp(version, DOTRELEASE)!= 0){
              //LogError("Registry key '" JRE_KEY "\\CurrentVersion'\nhas value '%s', but '" DOTRELEASE "' is required.\n", version);
              RegCloseKey(key);          
              return false;   
         /* Find directory where the current version is installed. */   
         if(RegOpenKeyEx(key,version,0,KEY_READ, &subkey)!= 0){
              //LogError("Error opening registry key '"JRE_KEY "\\%s'\n", version);          
              RegCloseKey(key);          
              return false;   
         if(!GetStringFromRegistry(subkey, "JavaHome", (unsigned char *)buf, bufsize)){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\%s\\JavaHome\n", version);          
              RegCloseKey(key);          
              RegCloseKey(subkey);          
              return false;   
         RegCloseKey(key);   
         RegCloseKey(subkey);   
         return true;
    //Native interface call to printf
    jint JNICALL _vfprintf_(FILE *fp, const char *format, va_list args){
         //LogError(format,args);     
         return 0;
    //Native interface call if the VM exited
    void JNICALL _exit_(jint code){     
         //LogError("VM exited");     
         exit(code);
    //Native interface call if the VM aborted
    void JNICALL _abort_(void){
         //LogError("VM aborted");     
         abort();
    //Load the Java Virtual Machine
    void InvokeJVM::LoadJVM(char* dir){
         HINSTANCE handle;     
         JavaVMOption options[5];     
         char JREHome[MAX_PATH];     
         char JVMPath[MAX_PATH];                                             
         char classpathOption[MAX_PATH];     
         char librarypathOption[MAX_PATH];
         if(!GetPublicJREHome(JREHome, MAX_PATH)){          
              //LogError("Could not locate JRE");          
              abort();     
         strcpy(JVMPath,JREHome);     
         strcat(JVMPath,"\\jre\\bin\\client\\jvm.dll");
         if ((handle=LoadLibrary(JVMPath))==0) {          
              //LogError("Error loading: %s", JVMPath);          
              abort();   
         CreateJavaVM_t pfnCreateJavaVM=(CreateJavaVM_t)GetProcAddress(handle,"JNI_CreateJavaVM");
         if (pfnCreateJavaVM==0){          
              //LogError("Error: can't find JNI interfaces in: %s",JVMPath);          
              abort();     
         strcpy(classpathOption,"-Djava.class.path=");
         strcat(classpathOption,dir);     
         strcat(classpathOption,";");     
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib");     
         strcat(classpathOption,";");
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib\\comm.jar");     
         strcpy(librarypathOption,"-Djava.library.path=");     
         strcat(librarypathOption,JREHome);     
         strcat(librarypathOption,"\\lib");
         OutputDebugString("classpath option=");     
         OutputDebugString(classpathOption);     
         OutputDebugString("\n");     
         OutputDebugString("librarypath option=");     
         OutputDebugString(librarypathOption);     
         OutputDebugString("\n");
         options[0].optionString=classpathOption;
         options[1].optionString=librarypathOption;          
         options[2].optionString="vfprintf";     
         options[2].extraInfo=_vfprintf_;     
         options[3].optionString="exit";     
         options[3].extraInfo=_exit_;     
         options[4].optionString="abort";     
         options[4].extraInfo=_abort_;
         vmArgs.version = JNI_VERSION_1_2;
         vmArgs.nOptions = 5;   
         vmArgs.options  = options;  
         vmArgs.ignoreUnrecognized = false;
         if(pfnCreateJavaVM(&jvm,(void**)&env, &vmArgs) != 0){
              //LogError("Could not create VM");
              abort();     
    }Winmain.cpp:
    #define WIN32_MEAN_AND_LEAN
    #define WIN32_EXTRA_LEAN
    #include <windows.h>
    #include "oglwindow.h"          // the OpenGL window class
    #include "vector.h"
    #include "engine.h"               // the engine's main class
    #include "BrimstoneEngine.h"
    #include "InvokeJVM.h"
    JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject){
        MessageBox(NULL, "Hello From Java!", "Error", MB_OK);
        return;
    JNIEXPORT void JNICALL Java_Callbacks_nativeMethod(JNIEnv *env, jobject obj, jint depth){
      jclass cls = env->GetObjectClass(obj);
      jmethodID mid = env->GetMethodID(cls, "callback", "(I)V");
      if (mid == 0) {
        return;
      printf("In C, depth = %d, about to enter Java\n", depth);
      env->CallVoidMethod(obj, mid, depth);
      printf("In C, depth = %d, back from Java\n", depth);
    JNINativeMethod methods[] = {"nativeMethod","()V", Java_Callbacks_nativeMethod};
    WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow){
         InvokeJVM javaVirtualMachine;
         int loopRet;
         javaVirtualMachine.running = false;
         CoInitialize(NULL);
         if (!COGLWindow::RegisterWindow(hInst)){
              MessageBox(NULL, "Failed to register window class", "Error", MB_OK);
              return -1;
         BrimstoneEngine *engine = NULL;
         try{
              char path[MAX_PATH];  
              char drive[MAX_PATH];   
              char file[MAX_PATH];   
              char dir[MAX_PATH];   
              char ext[MAX_PATH];
              jclass  cls, cls1;     
              jmethodID mid;     
              jobjectArray args;
              jint err;
              _splitpath(path,drive,dir,file,ext);          
              javaVirtualMachine.LoadJVM(dir);     
              if(javaVirtualMachine.env == NULL){               
                   MessageBox(NULL, "Could not load VM", "Error", MB_OK);
                   abort();          
              if(GetModuleFileName(NULL, path, MAX_PATH) == 0){               
                   javaVirtualMachine.LogWin32Error("Getting module filename");          
                   abort();          
              cls = javaVirtualMachine.env->FindClass("Callbacks");
              if(cls == NULL){               
                   MessageBox(NULL, "Could not find class %s (or its superclass)", "Error", MB_OK);
                   exit(-1);          
              err = javaVirtualMachine.env->RegisterNatives(cls, methods, 1 );
              mid = javaVirtualMachine.env->GetMethodID(cls, "main", "([Ljava/lang/String;)V");
              if(mid == NULL){
                   MessageBox(NULL, "Could not find method 'main'", "Error", MB_OK);
                   exit(-1);          
              args = javaVirtualMachine.env->NewObjectArray(2-2, javaVirtualMachine.env->FindClass("java/lang/String"), NULL);          
              if(args==NULL){               
                   MessageBox(NULL, "Could not create args array", "Error", MB_OK);
              for(int arg=0; arg < 2;arg++)     {               
                   javaVirtualMachine.env->SetObjectArrayElement(args, arg, javaVirtualMachine.env->NewStringUTF(argv[arg+2]));      
              javaVirtualMachine.env->CallStaticVoidMethod(cls,mid,args);     
              javaVirtualMachine.jvm->DestroyJavaVM();
              engine = new BrimstoneEngine("OpenGL Game", FALSE, 800, 600, 16);
              loopRet = engine->EnterMessageLoop();
              delete engine;
              return loopRet;
         catch(char *sz)
              MessageBox(NULL, sz, 0, 0);
              delete engine;
         CoUninitialize();
         return -1;
    }any help is always appreciated

  • Calling a function from a DLL, exectution in background mode.

    Dear Experts,
    We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
    Do you know a way to solve the problem when executing in background mode?
    Best regards.
    Antonio

    Hi Gabriel,
    Let me explain in details about my DLL function.
    We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
    I am sending my code for your considerations.
    Instancia a DLL
      CREATE OBJECT dll 'MTCODE.CPFONET'.
      IF sy-subrc NE 0.
        RAISE without_dll.
      ENDIF.
    Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
      it_name[] = ti_name[].
    Para cada registro importado
      LOOP AT it_name.
        CLEAR v_string_ret.
        wa_matchcode-zregid     = it_name-zregid.
        wa_matchcode-name1_text = it_name-name1_text.
        v_string = it_name-name1_text.
        CONDENSE  v_string.
        TRANSLATE v_string TO UPPER CASE.
        CALL METHOD  OF dll 'SetNome' EXPORTING #1 = v_string.
        CALL METHOD  OF dll 'ExecMatch'.
        CALL METHOD  OF DLL 'GetMCData' = v_string_ret.
        FREE OBJECT dll.
      Preenche os campos do match-code de acordo com o retorno da DLL
        SPLIT v_string_ret
        AT '|'
        INTO wa_matchcode-zparmcln
             wa_matchcode-zparmcfn
             v_empty
             wa_matchcode-name_first
             wa_matchcode-name_last
             wa_matchcode-namemiddle.
      Adiciona o registro com o match-code correspondente na TE_MATCHCODE
        APPEND wa_matchcode TO te_matchcode.
      ENDLOOP.

  • Can I call a function from a dll in LabVIEW that returns:double*string and int.?

    I have a function from a dll that return a double* string and an integer. How can I call this function from LabVIEW? There is a possibility to work in LabVIEW with a double* string?

    pcbv wrote:
    > Hello all,<br><br>The header of the function is:
    >
    > "HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems);"
    >
    > where WRAPI_NDIS_DEVICE have this form:
    >
    > typedef struct WRAPI_NDIS_DEVICE<br>{<br>
    > WCHAR *pDeviceName;<br>
    > WCHAR *pDeviceDescription;<br><br>}
    > WRAPI_NDIS_DEVICE;<br><br>
    >
    > The function is from WRAPI.dll, used for communication with wireless card.
    > For my application I need to call in LabVIEW this function.
    Two difficulties I can see with this.
    First the application seems to allocate the array of references
    internally and return a pointer to that array. In that case there must
    be another function which then deallocates that array again.
    Then you would need to setup the function call to have a pointer to an
    int32 number for the deviceList parameter and another pointer to int32
    one for the plItems parameter.
    Then create another function in your DLL similar to this:
    HRESULT WRAPIEnumExtractDevice(WRAPI_NDIS_DEVICE *lpDeviceList, long i,
    CHAR lpszDeviceName, LONG lenDeviceName,
    CHAR lpszDeviceDesc, LONG lenDeviceDesc)
    if (!lpDeviceList)
    return ERROR_INV_PARAMETER;
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceName, -1,
    lpszDeviceName, lenDeviceName,
    NULL, NULL);
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceDescription, -1,
    lpszDeviceDesc, lenDeviceDesc,
    NULL, NULL);
    return NO_ERROR;
    Pass the int32 you got from the first parameter of the previous call as
    a simple int32 passed by value to this function (and make sure you don't
    call this function with a higher index than (plItems - 1) returned from
    the first function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Call multiple functions from same dll with call library function

    hi,
    i am working on a project in wich we need to make a UI to read out a sensor network.
    the UI should be usable in any project, but every node needs a different piece of code depending on the type of sensor with wich it is equipt.
    so i need to be able to call different pieces of code when i need them, and still be able to use the UI in future projects with possibly new types of node we now don't have.
    so someone told me to use DLL's, cause then i would be able to call the code i need the moment i need it.
    but i have never worked with DLL's (just learned about this option 3 day's ago) so i have a question.
    i know i can dynamicly change the DLL i call with the call library function, but can i dynamicly change the function i call from that DLL ?
    or do i have to put a new call library function for each function i want to call, even if its from the same DLL ?
    kind regards,
    stijn

    nazarim wrote:
    ok so there is no (easy and ubderstandable) way for me to dynamicly change wich function i want to call from a certain DLL.
    but now i started wondering, the path on the call library function is not ment to dynamicly change a DLL
    but it does work so, if i am carefull, can i use it for that purpose or will labview give me a series of problems once i start using it in larger programs ?
    Thepath on the Call Library Node can be used to load a different DLL. Obviously since you can't change the function name your other DLL would have to export exactly the same function name and of course with the same parameters. This is seldom the case so it is not the main use of the path input to the Call Library Node. It's main use is as indicated to load DLLs at runtime rather than at load time of a VI. So that an application can run even when the DLL is missing, until the moment the functionality from that DLL is needed.
    If you can make sure that all your DLLs export the same function name with the same parameter you can use the Call Library Node to call into different DLLs through the path input. If however you would need to call different function names you would have to resolve to some DLL which does do the dispatching and invocation using LoadLibrary() and GetProcAddress(). But unless you need to go with DLLs for some reason using the Call By Reference Node can give you an even more flexible approach. 
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling a function from a dll written by using visual studio c++

    Hi, how can i call a function from a dll which is written by visual studio c++ in test stand?  Although the functions in dll are exported and i've chosen c/c++ adapter, i saw no function in test stand. Is there a different step while i'm calling a function from a dll written by c++ than calling a function from a dll written by cvi?

    Hey Sadik,
    Selecting the C/C++ DLL Adapter Module should be sufficient for this. When you drag an action step for this onto the Main Step and navigate to the location of the DLL, the function list should populate and you should be able to select the function you want to use. If this is not the case, would you be able to post this DLL so that we can test this on our end?
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • Calling a native library from Java

    Hello,
    I'm trying to call a native method (windows dll) from a web service implemented in Java. I've confirmed that the class I've created to call the native method works when used outside of my web service (ie. in a standard Java application). However, when I try to use the class in the web service, an exception is thrown when
    System.loadLibrary("MyLibrary");
    is executed. The exception thrown is:
    InvocationTargetException
    JAXRPCSERVLET28: Missing port information
    Does any one have any suggestions as to what might be causing this error?
    Thanks

    There are basically 3 steps to calling a native method from your Java code.
    1. Create a C/C++ stub function that will translate between your Java call and the native C method.
    2. Create the dll that exports the stub function.
    3. Invoke the System.loadLibrary("myDllName") method.
    Here's what I did to learn how to use the JNI.
    I first created the class that would be calling the dll:
    public class CallDll
    /** Creates a new instance of CallDll */
    public CallDll()
    static
    //LVtoJava is my dll name.
    System.loadLibrary("LVtoJava");
    //AddDll is the name of the function I'm exporting from my Dll
    //It does not have to be static
    public native static double AddDll(int func, double x, double y);
    I then used the javah utility in the jdk/bin directory to create the C stub header file. Once you have the generated stub header file, you can create an implementation file, and compile it into a dll.
    //My C++ stub, generated by javah utility
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class LabViewDll_CallDll */
    #ifndef IncludedLabViewDll_CallDll
    #define IncludedLabViewDll_CallDll
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: LabViewDll_CallDll
    * Method: AddDll
    * Signature: (IDD)D
    JNIEXPORT jdouble JNICALL Java_LabViewDll_CallDll_AddDll
    (JNIEnv *, jclass, jint, jdouble, jdouble);
    #ifdef __cplusplus
    #endif
    #endif
    You may want to note the stub function's signature and how it decorates the function name that you created from your Java class. Do not modify it, as the format is required by the JNI. The javah utility appends the fully qualified package name and the word Java, separated by underscores, to your original function name. You do not need to change the name in your Java class.
    All the other special key words in the function's signature are defined in the jni.h or the jni_md.h (if your using windows).
    You may want to refer to the JNI documention on Sun's website. The book I learned out of is the Core Java Volume 2, published by Sun Microsystems Press. It goes through the details of invoking your first native function and I've found it to be a good reference.
    Hope this helps,
    PS. I seemed to have found the issue with calling my dll from a web service. My dll is actually calling another dll and that seems to be the source of my problems. When I removed the call to the 2nd dll, everything worked fine. So now I need to figure out why the 2nd dll call is an issue.
    Any suggestions?

  • Can I call a C function from Java (using JNI) ??

    hello,
    I need to call one C function from remote device and get its return value(o/p) (for my application it is device SSID ) and display in the client PC.
    Is it possible in java without using SNMP connction?.
    please give me idea about it.
    I need this information as soon as possible.
    Thank you.

    see JNI...
    basically declare a native method in your java class, then run javah on the class thus generating a *.h file. Then implement the c/c++ function. Compile the c/c++ part as a shared library, and make sure its accessible from your LD_LIBRARY_PATH env variable.
    Go through the steps in the JNI docs, and things shoulde be fine... hopefully ;)

  • Using PostLVUserEvent function from Labview.dll

    I am trying to use the PostLVuserEvent function from the labview.dll and corresponding extcode.h file.  I have made my own dll using CVI that uses this function.  I then use Labview to call my dll.  My dll compiles fine.  No issues, no errors.  LabView can call my dll function containing the PostLVUserEvent function with no errors.  However, the event number LabView passes my dll is not the same event number I receive so no LabView event is triggered. 
    Has anyone had this issue? 
    We are trying to solve it from the LabView side and the CVI side but cannot seem to get it to work.  The examplesI have found here were compiled using C++ and those seem to work.  I do not know why when I compile my program in C, it creates the dll but does not work.   If I had to guess, i think it's an issue with pointers vs non-pointers.  When the LAbview program selects my function from the dll, it shows the argument PostLVUserEvent as a pointer when in my dll, it is not a pointer PostLVUserEvent....
    Any ideas?
    Thanks in advance. 

    Hello Blue
    Take a look to this one, it was created on C, I think the .c and the .h files will give a good idea, how the function should be implemented. It is important when calling the dll on LabVIEW, to use the std calling convention and run it on the UI thread.
    Regards
    Mart G
    Attachments:
    LabView EventTest.zip ‏1041 KB

  • How to call a SQL function from an XSL expression

    Hi
    In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
    The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
    The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
    1) How to call a SQL function from an XSL expression that is allowed in BI template.
    If anyone ahs faced similar requirements please share your approach.
    Thanks
    Srimathi

    Thank u..
    but i'd seen that link wen i searched in google..
    Is it possible without using any 3rd party JARs and all?
    and more importantly plz tell me what should be preferred way to call a javascript function?
    Do it using addLoadEvent() or Windows.Load etc
    OR
    Call it thru Xsl? (I donno how to do dis)
    Thanks in Advance..
    Edited by: ranjjose on Jun 3, 2008 8:21 AM

  • How can I call a plsql function from an attribute?

    I have an attribute defined in an element. I want execute a PLSQL function from the attribute, and display the returne value with an HTML template.
    I've defined the attribute's type like PLSQL, and I've put the called of the function in the value of the attribute, but it doesn't work. The only value I obtain is an URL (I think that is the URL of the function or someting like this).
    How can I call to my function from the attribute and display the returnes value in the page?
    Thanks.

    Thanks, but it doesn't work. I have an attribute called ID_BOL and I want to associate a sequence to that attribute. I've created a function, with the sequence. This function return de value of the sequence. I want taht the attribute takes the value of the sequenece dinamically.
    I've tried it, creating the type attribute like PLSQL, and calling the function from the attribute, but it doesn't work.
    How can I return the sequence value to my attribute?
    Thanks.

  • How to call a Javascript function from backing bean without any event

    Hi,
    Someone knows how to call a Javascript function from backing bean without any event ?
    thanks

    Please review the following thread:
    ADF Faces call javascript
    Luis.

  • Help needed in calling a javascript function from a jsp

    Hey guys,
    I need help.
    In my jsp I have a field called date. When i get date field from the database, it is a concatination of date and time field, so I wrote a small javascript function to strip just the date part from this date and time value.
    The javascript function is
    function formatDate(fieldName)
              var timer=fieldName;
              timer = timer.substring(5,7)+"/"+timer.substring(8,10)+"/"+timer.substring(0,4);
              return timer;
    Now I want to call this javascript function from the input tag in jsp where I am displaying the value of date. Check below
    This is one way I tried to do:
    <input size="13" name="startDate" maxLength="255" value=<script>formatDate("<%=startDate%>")</script> onChange="checkDate(this)">
    I even tried this:
    <input size="13" name="startDate" maxLength="255" value="'formatDate(<%=startDate%>)'" onChange="checkDate(this)">
    But it dosen't work
    Please help. I am struggling on this for days.
    Thanks,
    Ruby

    Hey all you developers out there , Pleaseeee help me with this one.

  • IP - Is it possible to call exit planning function from ABAP Report..

    Hi All,
    Greetings.
    Is it possible to call exit planning function from ABAP Report (t-code SE38) ? Or I mean is not limited only to be called from ABAP Report, perhaps from BSP / Web-Dynpro / Function Module.
    If somebody here has been doing it before, I'm keen to ask to kindly share it. Particularly how to call and transfer data to that exit function.
    Or if somebody has done in BPS, appreciate if it can be shared too .
    Thanks a lot and have a good day,
    Best regards,
    Daniel N.

    Hi.
    You can achive this as suggested by Mattias in your previous post.
    Lets say you have next data structure:
    CostCenter | Amount | PercentForDistibution |
    Create input ready query in this format. Restrict cost center by variable type range.
    Create WAD with analysis item.
    When you run web page you enter range of cost centers (lets say you will enter 101004 to 101010).
    I assume you have data only for 101004 in your cube (lets say 1000).
    You will see only one record in your webpage.
    CostCenter | Amount | PercentForDistibution |
    101004       | 1000     | NOTHING
    When you create WAD in analysis item properties set "NUMBER_OF_NEW_LINES" to lets say 1 (so in WAD you will see always one blank line for entering new data).
    Just add 6 new records:
    CostCenter | Amount   | PercentForDistibution |
    101005       | NOTHING| 10
    101006       | NOTHING| 30
    101007       | NOTHING| 20
    101008       | NOTHING| 25
    101009       | NOTHING| 5
    101010       | NOTHING| 10
    Then run planning FOX function like this:
    FOREACH Z_COST_CENTER.
    IF {Amount, Z_COST_CENTER} <> 0
    Z_AMNT_TO_DISTRIBUTE = {Amount, Z_COST_CENTER}.
    ENDIF.
    ENDFOR.
    FOREACH Z_COST_CENTER.
    IF {PercentForDistibution Z_COST_CENTER} <> 0.
    {Amount, Z_COST_CENTER} = Z_AMNT_TO_DISTRIBUTE * {PercentForDistibution Z_COST_CENTER}.
    ENDIF.
    ENDFOR.
    It is not perfect FOX, but as an idead, it should work.
    Regards.

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

Maybe you are looking for

  • How do I import photos from iPhoto in to adobe lightroom?

    I've read in several forums that to do this you must go into the finder right click on iPhoto.  Click show package contents.   This pulls up a file named contents.   All of the forums say to either look for a masters file or a original file and copy

  • Need Help for Photo gallery

    Hello, I am a photographer and am new to website design but i have built my own website: Nathan Lopez photography on the gallery's I have simply resized and pasted my picutures on the page. i would like to have a way for my customers/clients view the

  • Apple 4 camera not working

    My iphone 4 camera not working it opens afters closing 2-3 times before but its can not open now i totaly reset,restore,formet and change software version but still now its not open that is 5-6 month now please tell me what to do now

  • Insert into DB table

    Hi experts, Iam trying to insert ITAB values into ZTABLE. While inserting the data <b>iam getting only the first record</b> into Ztable.(Actually i have 10records). What might be reason? I have 80 fields in Ztable. So iam using move corresponding. No

  • Delivery address in PO item level

    Hi, in PO item level there is a tab "Delivery address". Under this tab there is a Field "Address" having data for eg. 22706. 1.Please tell me from where this "address" comes. where is the customization for this "address". 2.Delivery address, is it re