Calling a perl module

Is the best way to call a perl module to use JNI or just use exec? I haven't seen any examples of calling Perl via JNI nor was I able to get any of the JPL (Java Perl Library) stuff to compile on my machine. Thanks!

Runtime.exec()
URL.openConnection().connect()

Similar Messages

  • Problem calling two perl modules from java in seperate threads(JVM CRASHES)

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

  • How to call a perl module from Java program.

    Hi,
    I create a simple java program as follows
    class test{
    public static void main(String args[])
    {try {                    
    Runtime r = Runtime.getRuntime();
    r.exec("perl test.pl");
    catch(Exception e)
    {e.printStackTrace();}
    and test.pl is located in the same directory as the java program. The program compiles but with no return as I execute it. I am not sure what is wrong.
    Thanks,

    I think the wrong line is here; r.exec("perl test.pl");
    Usually the JVM needs the full path.If the path for either the executable or the script was wrong then, given the code posted, it would not hang.
    >
    To automatticaly get the path (if the file is in the
    class path) use
    System.getProperty("java.class.path")
    That gets paths(plural).
    Try this:
    r.exec("perl " +
    System.getProperty("java.class.path") + "\test.pl");I am rather certain that that won't work on any standard operating system.

  • Calling Perl module in Java

    Hai,
    I like to know, How do I call a perl module from my java program such that the
    output of the perl module is used in my Java program ?
    Regards
    ackumar

    This is my sample perl program.
    #!/usr/bin/perl
            $s=hello();
            print "$s\n";
            sub hello{
                    return "HELLO WORLD"
            }I like to use the perl program in my java program. So I wrote the following code.
    But I don't know how to get the output "HELLO WORLD" of my sample.pl by running my code
    perl_java. java
    import java.lang.*;
    import java.io.*;
    class perl_java{
            public static void main(String args[]){
                    try{
                    Process p = Runtime.getRuntime().exec("perl sample.pl");
                    OutputStream os=p.getOutputStream();
                    }catch(Exception ee){ee.printStackTrace();}
    }

  • How to call external Perl routines from Pl/SQL - Urgent

    Available software in the Test Environment:
    1. Sun Unix 2.8
    2. Oracle 8.1.7 ( 8i)
    3. Perl 5
    Iam trying to call/execute perl scripts from PL/SQL using the DEMO_RDBMS.mk. I am able to call C scripts from PL/SQL, but actually want to call Perl scripts.
    The steps followed for for C are -
    1. Create and compile a simple C program to execute a unix command (eg., touch a file).
    2. Make a shared library of the above compiled program (object), i.e., load the compiled object module into a dynamic load library.
    3. Declare the above library in Oracle using SQL*Plus.
    4. Define a PL/SQL function or procedure to call the external routine.
    5. Test the external routine.
    The above steps run good for a C program, but step 2 fails when run for a Perl script.
    When I tried to use the following command for step 2 -
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_callback \
    SHARED_LIBNAME=cmd_lib.so \
    OBJS=tst_cmd.pl
    got the following error -
    ld: fatal: file tst_cmd.pl: unknown file type.
    ld: fatal: File processing errors. No output written t cmd_lib.so
    *** Error code 1
    This gives me an indication that demo_rdbms.mk does not understand/interpret Perl scripts. Going through the demo_rdbms.mk suggests the same.
    My questions is - How do we call external Perl scripts/routines from PL/SQL ??
    Do I have to get a different version of "demo_rdbms.mk" ?
    PS: The perl scripts used above (tst_cmd.pl) is error free and works as intended in the unix environment.

    Iam trying to call/execute perl scripts from PL/SQL using the DEMO_RDBMS.mk. I am able to call C scripts from PL/SQL, but actually want to call Perl scripts. Well, C is a "compiler" language and Perl is interpreted. In a sense, C is not "scripts".
    When I tried to use the following command for step 2 -
    make -f $ORACLE_HOME/rdbms/demo/demo_rdbms.mk extproc_callback \
    SHARED_LIBNAME=cmd_lib.so \
    OBJS=tst_cmd.pl
    got the following error -
    ld: fatal: file tst_cmd.pl: unknown file type.
    ld: fatal: File processing errors. No output written t cmd_lib.soI guess this compiles an extproc "stub" with your object file, generating an external procedure. So the object file really needs to be an object file :-)
    My questions is - How do we call external Perl scripts/routines from PL/SQL ??I'd guess you need an embedded Perl interpreter in the external procedure.
    Not much help though I'm afraid :-/
    Cheers
    Fredrik

  • Can we call any SOA module from shell

    Hi ,
    I need to call a SOA module from shell.
    is there way to call SOA module from shell ?
    Regards

    Hi,
    i do not exactly know, what you mean with SOA module, but if you are talking about webservices:
    $ORACLE_HOME/bpel/samples/tutorials/102.InvokingProcesses/perl
    There are some Perl examples for calling BPELs.

  • Invoking Perl module from Apex

    I am developing an application using Apex that needs to be integrated with some other modules written in different languages.
    In my application I need to invoke a perl module/API based on some button action.
    Please suggest me the ways how I can do this.
    The perl module is already existing one and now we can not change it to Java program.

    Hello,
    Whilst it's possibly to 'call out' to an external Perl module, I think you're actually probably making things more complicated by going that route.
    As an alternative, why not have the Perl code actually connect to the Oracle database and check for the data changing itself?
    If you do want to perform the external call yourself, then the following AskTom thread should give you some ideas on how to do it -
    http://asktom.oracle.com/pls/ask/f?p=4950:8:9608971842817866565::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241
    There's actually some other options, you could actually connect to the other databases directly from the Oracle DB (using dblinks, hetrogenous connectivity etc), or you could convert the Perl module (or wrap it) so that it's callable via a URL in which case you could then perform an HTTP call from out of the database using utl_http.
    It really depends on the specifics of what your perl module does, what sort of processing etc.

  • Perl Module SNMP.pm do not work

    Hello,
    I want to use SNMP.pm Perl Module bundled with Solaris10,
    but it doesn't work.
    I guess the problem is that
    default_store.so does not link sfw/lib/libnetsnmp.so with absolute path.
    perl -MSNMP -n
    Can't load '/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store: ld.so.1: perl: fatal: libnetsnmp.so.5: open failed: No such file or directory at /usr/perl5/5.8.4/lib/sun4-solaris-64int/DynaLoader.pm line 230.
    at /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/SNMP.pm line 16
    Compilation failed in require at /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/SNMP.pm line 16.
    BEGIN failed--compilation aborted at /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/SNMP.pm line 16.
    Compilation failed in require.
    BEGIN failed--compilation aborted.
    Thanks

    Russell,
    The warranty period on your mac is 1 year. The complimentry phone service period is 90 days unless you have a hardware problem. I'd say you likely have a hardware problem and will not be charged for the phone call.
    I'd suggest 2 things:
    1. Sign up for Applecare as has been recommended countless times.
    2. Make the call to tech support and see what they say about your problem.
    Good Luck,
    John

  • Fail installing perl modules in new sparc server

    Hi,
    I'm trying to install the perl modules needed by my applications in a sparc server SunFire V210 with solaris 9 64bit. All the attempts fail because the interpreter is compiled with forte, this is the explanation i got. I found a solution in CPAN called perlgcc but it doesn't work it build a bad Makefile, the file has a lot of mistakes. Perl.com people tell me to change parameters in the makefiles and Config.pm but it's very hard to find the correct values, i'm not sure i fix the correct things.still it doesn't work.
    I need an urgent solution it permits me to add modules without correction in the each makefile. I hope there is a standar procedure to solve it.
    Thanks!

    Hi,
    Here is your solution (I hope). I've being doing this this week and worked.
    Look the stuff is connected with the compilers used to complie perl and as you see later other stuff on the sun. At the sun the stuff is compiled with sun compiler which is not provided on the solaris 8, 9 nor 10. Fortunately there is gcc installed on the sol10.
    -bash-3.00# gcc --version<br />
    gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
    Copyright (C) 2004 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -bash-3.00#
    The perl is compiled with sun compiler cc
    -bash-3.00# perl -V | more
    More
    Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
    More
    Platform:
    osname=solaris, osvers=2.10, archname=sun4-solaris-64int
    uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=unde
    f
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    Compiler:
    cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_T
    S_ERRNO',
    optimize='-xO3 -xspace -xildoff',
    cppflags=''
    ccversion='Sun WorkShop', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lsee
    ksize=8
    alignbytes=8, prototype=define
    Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
    Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.8.
    4/lib/sun4-solaris-64int/CORE'
    cccdlflags='-KPIC', lddlflags='-G'
    What to do??? Yes - you are on sol10 - then do it
    1. Logon as a root
    2. Check your path and compare with
    -bash-3.00# echo $PATH
    /usr/sbin:/usr/bin:/usr/sfw:/usr/sfw/bin:/usr/sfw/lib:/usr/s fw/include:/opt/sfw:
    /opt/sfw/bin:/opt/sfw/lib:/opt/sfw/include:/usr/ccs/bin:/usr /ccs/lib
    -bash-3.00#
    if differs upto the last /usr/ccs/lib modify your profile file ( anthing ofter the last /usr/ccs/lib can be aded).
    3. Check out the the comands
    gcc --version<br />
    perl -V
    4. If everything upto this step is ok you can proceed
    5. You may do the installation of the perl modules in two ways:
    a.) with CPAN module - Internet connection MANDATORY
    b.) with perl and downloaded tar.gz module
    5.a) With CPAN module
    5.a.1) Launch the command to configure the CPAN module
    perl -MCPAN -e shell
    you will be asked to give the answers inorder to configure CPAN
    5.a.2) When you see cpan> prompt do the following:
    o conf makepl_arg 'CC=gcc CCCDLFLAGS=-fPIC CCFLAGS=" " OPTIMIZE=" " LD=gcc' press return
    5.a.3) Type "o conf commit" press return. You may install your modules now with the install command e.g. install HTML::Parser for example.
    5.b.1) Download your modules from http://www.cpan.org to your server to /var/tmp/packed or whatever folder you want.
    5.b.2) unzip then untar and cd into subfolder
    5.b.3) type ./Makefile.PL -t 'CC=gcc CCCDLFLAGS=-fPIC CCFLAGS=" " OPTIMIZE=" " LD=gcc'
    5.b.4) Type make install
    6.) In both methods you have to check if the modules are installed by issuing the commnad:
    perl -e 'use Your::Module' e.g.
    perl -e 'use HTTP::Parser'
    if no error message on the term you are ready
    Rem. The differrences are in the flags used to compile and link with these two compilers sun cc and gnu cc. There are of course problems with 64bit values on sun64bit e.g. SPARC and Intel stuff cause Perl does not support real 64bit values yet. The Perl modules should use only floating point represetnation with around 53~bit precision. But this issue depends on the module creator not you if you do not want to do the remedy.
    I hope it will help you
    good luck

  • [SOLVED] how to find perl modules in aur

    I want to use yaourt to install a missing perl module.
    I get the following error when running ical2rem:
    Can't locate Module/Runtime.pm in @INC (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /usr/share/perl5/vendor_perl/Class/Load.pm line 10.
    How do I find out which package will provide me the module? I have searched CPAN and found Module::Runtime, so I am confident this is what I want, but I couldn't find the equivalent  by using "yaourt perl-" and grep-ing the thing for "runtime".
    Anyone know how to find this information reliably? Or would you suggest I install directly from within the provided perl-tool? (don't remember what it was called, as I am a perl newbie...)
    Last edited by awayand (2011-10-26 04:10:07)

    I started to get this already few days ago:
    Can't locate Data/OptList.pm in @INC (@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /usr/share/perl5/vendor_perl/Class/Load.pm line 8.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Class/Load.pm line 8.
    Compilation failed in require at /usr/share/perl5/vendor_perl/DateTime/TimeZone/Local.pm line 9.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/DateTime/TimeZone/Local.pm line 9.
    Compilation failed in require at /usr/share/perl5/vendor_perl/DateTime/TimeZone.pm line 13.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/DateTime/TimeZone.pm line 13.
    Compilation failed in require at /usr/lib/perl5/vendor_perl/DateTime.pm line 47.
    BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/DateTime.pm line 47.
    OptList.pm seems to be missing. Related problem, or something else?

  • Problem installing css perl module

    Hey,
    my problem isn't probably arch-related (and possibly very dumb), but I hope someone can help me anyway.
    I'm trying to install a CSS perl module - and here is what I get -
    [root@vlsi-wiki ~]# perl -MCPAN -eshell
    Terminal does not support AddHistory.
    cpan shell -- CPAN exploration and modules installation (v1.9456)
    Enter 'h' for help.
    cpan[1]> install CSS
    Going to read '/root/.cpan/Metadata'
    Database was generated on Mon, 24 May 2010 09:27:04 GMT
    Fetching with LWP:
    ftp://cpan.noris.de/pub/CPAN/authors/01mailrc.txt.gz
    Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
    ............................................................................DONE
    Fetching with LWP:
    ftp://cpan.noris.de/pub/CPAN/modules/02packages.details.txt.gz
    Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
    Database was generated on Tue, 25 May 2010 09:27:47 GMT
    ............................................................................DONE
    Fetching with LWP:
    ftp://cpan.noris.de/pub/CPAN/modules/03modlist.data.gz
    Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
    ............................................................................DONE
    Going to write /root/.cpan/Metadata
    Running install for module 'CSS'
    Running make for I/IA/IAMCAL/CSS-1.08.tar.gz
    Checksum for /root/.cpan/sources/authors/id/I/IA/IAMCAL/CSS-1.08.tar.gz ok
    Scanning cache /root/.cpan/build for sizes
    ............................................................................DONE
    CPAN.pm: Going to build I/IA/IAMCAL/CSS-1.08.tar.gz
    Checking if your kit is complete...
    Looks good
    Writing Makefile for CSS
    cp CSS.pm blib/lib/CSS.pm
    cp CSS/Value.pm blib/lib/CSS/Value.pm
    cp CSS/Parse/Compiled.pm blib/lib/CSS/Parse/Compiled.pm
    cp CSS/Property.pm blib/lib/CSS/Property.pm
    cp CSS/Style.pm blib/lib/CSS/Style.pm
    cp CSS/Parse/PRDGrammar.pm blib/lib/CSS/Parse/PRDGrammar.pm
    cp CSS/Parse/Heavy.pm blib/lib/CSS/Parse/Heavy.pm
    cp CSS/Selector.pm blib/lib/CSS/Selector.pm
    cp CSS/Parse/Lite.pm blib/lib/CSS/Parse/Lite.pm
    cp CSS/Adaptor/Debug.pm blib/lib/CSS/Adaptor/Debug.pm
    cp CSS/Adaptor/Pretty.pm blib/lib/CSS/Adaptor/Pretty.pm
    cp CSS/Parse.pm blib/lib/CSS/Parse.pm
    cp CSS/Adaptor.pm blib/lib/CSS/Adaptor.pm
    cp CSS/Parse/CompiledGrammar.pm blib/lib/CSS/Parse/CompiledGrammar.pm
    Manifying blib/man3/CSS.3pm
    Manifying blib/man3/CSS::Value.3pm
    Manifying blib/man3/CSS::Parse::Compiled.3pm
    Manifying blib/man3/CSS::Property.3pm
    Manifying blib/man3/CSS::Parse::Heavy.3pm
    Manifying blib/man3/CSS::Parse::PRDGrammar.3pm
    Manifying blib/man3/CSS::Style.3pm
    Manifying blib/man3/CSS::Parse::Lite.3pm
    Manifying blib/man3/CSS::Selector.3pm
    Manifying blib/man3/CSS::Adaptor::Debug.3pm
    Manifying blib/man3/CSS::Parse.3pm
    Manifying blib/man3/CSS::Adaptor::Pretty.3pm
    Manifying blib/man3/CSS::Adaptor.3pm
    IAMCAL/CSS-1.08.tar.gz
    /usr/bin/make -- OK
    Running make test
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
    t/01_basic.t ........... ok
    t/02_parse_lite.t ...... ok
    t/03_parse_heavy.t ..... ok
    t/04_parse_compiled.t .. 1/8 Unknown starting rule (Parse::RecDescent::namespace000001::stylesheet) called
    at /root/.cpan/build/CSS-1.08-pVKcD1/blib/lib/CSS/Parse/Compiled.pm line 28
    Compilation failed in require at t/04_parse_compiled.t line 3.
    # Looks like you planned 8 tests but ran 4.
    # Looks like your test exited with 255 just after 4.
    t/04_parse_compiled.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
    Failed 4/8 subtests
    t/05_search.t .......... ok
    t/06_adaptor_simple.t .. ok
    t/07_adaptor_pretty.t .. ok
    t/08_adaptor_debug.t ... ok
    Test Summary Report
    t/04_parse_compiled.t (Wstat: 65280 Tests: 4 Failed: 0)
    Non-zero exit status: 255
    Parse errors: Bad plan. You planned 8 tests but ran 4.
    Files=8, Tests=38, 2 wallclock secs ( 0.05 usr 0.06 sys + 1.15 cusr 0.19 csys = 1.45 CPU)
    Result: FAIL
    Failed 1/8 test programs. 0/38 subtests failed.
    make: *** [test_dynamic] Error 255
    IAMCAL/CSS-1.08.tar.gz
    /usr/bin/make test -- NOT OK
    //hint// to see the cpan-testers results for installing this module, try:
    reports IAMCAL/CSS-1.08.tar.gz
    Running make install
    make test had returned bad status, won't install without force
    Failed during this command:
    IAMCAL/CSS-1.08.tar.gz : make_test NO
    I've tried with both perl 5.10.1 and perl from testing (5.12), didn't help.
    Does anyone have any idea?

    There is a bug upstream according to CPAN's bugtracker.  Someone provided a fix there to regenerate the buggy file that is causing the test to fail.  Here is a source package file I made.  You can build it to apply their fix and make the package.

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Can we call a function module in ADHOC query

    Hi
    Can we call a function module in ADHOC query if yes how.
    Also we ned to know how to call a function module in SAP query.
    An early responce is appreciated.
    Thanks and best regards
    Rajeev

    Okay as far as I understand your aim is:
    To fill a field in the output list with a value that is based on the current line information and calculated by a function module
    So go to SQ02 and create an additional field in the InfoSet.
    You can refer in the coding to the technical names you can see in the left tree window like P0000-PERNR.
    More information is avaiable in the Help part look for additional field in SQ02.
    Regards,
    Michael

  • Upload data from excel with vba by calling a function module

    Hello all,
    i have a problem with the function module "ALSM_EXCEL_TO_INTERNAL_TABLE". I will call this function module with vba to load data from excel to sap with a Buttonclick. I have copied this function module and set it remotable. But i can´t call it from excel.
    Can you give me some tips how can i
    upload data from excel with vba by click a button.
    The problem seems the function: call method cl_gui_frontend_services=>clipboard_import in the function module, because when i comment this function call the vba-call is true but no results. 
    How can I call the function module correct with vba?
    Thanks a lot for your tips!!!!
    Chris
    Message was edited by:
            Christoph Kirschner

    HI
    Uploading data directly from Excel file format
    * Upload data direct from excel.xls file to SAP
    REPORT ZEXCELUPLOAD.
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    * Tick don't append header
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    * No of columns
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS: <fs1>.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = '*.xls'
                static    = 'X'
           CHANGING
                file_name = filename.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = filename
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/ 'Upload Error ', SY-SUBRC.
      ENDIF.
    END-OF-SELECTION.
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
    *                          Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    *-- End of Program
    <b>Excel Upload Alternative - KCD_EXCEL_OLE_TO_INT_CONVERT</b>
    *Title : Excel Uploading
    TYPES:   BEGIN OF t_datatab,
             col1(25)  TYPE c,
             col2(30)  TYPE c,
             col3(30)  TYPE c,
             col4(30)  TYPE c,
             col5(30)  TYPE c,
             col6(30)  TYPE c,
             col7(30) TYPE c,
             col8(30)  TYPE c,
             col9(30)  TYPE c,
             col10(30)  TYPE c,
             col11(30)    TYPE c,
           END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
          wa_datatab TYPE t_datatab.
    Data : p_table type t_datatab occurs 0 with header line.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA: it_tab TYPE filetable,
          gd_subrc TYPE i.
    field-symbols : <fs>.
    *Selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename
                   DEFAULT 'c:test.xls' OBLIGATORY.   " File Name
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      REFRESH: it_tab.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title     = 'Select File'
          default_filename = '*.xls'
          multiselection   = ' '
        CHANGING
          file_table       = it_tab
          rc               = gd_subrc.
      LOOP AT it_tab INTO p_file.
    *    so_fpath-sign = 'I'.
    *    so_fpath-option = 'EQ'.
    *    append so_fpath.
      ENDLOOP.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    * END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3,
                wa_datatab-col4,
                wa_datatab-col5,
                wa_datatab-col6,
                wa_datatab-col7,
                wa_datatab-col8,
                wa_datatab-col9,
                wa_datatab-col10,
                wa_datatab-col11.
      ENDLOOP.
    *&      Form  UPLOAD_EXCEL_FILE
    *       upload excel spreadsheet into internal table
    *      -->P_TABLE    Table to return excel data into
    *      -->P_FILE     file name and path
    *      -->P_SCOL     start column
    *      -->P_SROW     start row
    *      -->P_ECOL     end column
    *      -->P_EROW     end row
    FORM upload_excel_file TABLES   p_table
                           USING    p_file
                                    p_scol
                                    p_srow
                                    p_ecol
                                    p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    * Has the following format:
    *             Row number   | Colum Number   |   Value
    *      i.e.     1                 1             Name1
    *               2                 1             Joe
      DATA : ld_index TYPE i.
    * Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = LT_INTERN
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
         MOVE lt_intern-col TO ld_index.
         assign component ld_index of structure
         p_table to <fs>.
    move : lt_intern-value to <fs>.
    *     MOVE lt_intern-value TO p_table.
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "UPLOAD_EXCEL_FILE
    Regards
    Pavan

  • How to call a function module from the Web Template?

    Hi all,
    how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template?
    Many thanks for your hints.
    Regards, Nils

    Hi!
    I am too working on a similar issue.
    Probably this helps:
    Re: Calling a function module from a Web Template
    Regards,
    Sri

Maybe you are looking for