Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Execute external command - batch file

$
0
0

Hello all,

 

Well I searched everything here and couldn't find an answer to my problem. I want to execute a java program on the application server. I therefore put the java file on the server and tested it there in the command line. Everything works perfect. I created a batch file and tested it on the server. Everything ok. JAVA_HOME is set correctly on the server, so no trouble there.

 

Now I want to execute this command from an Abap Program.

What I did:

 

In SM69 I created a new command:

- operating system command: cmd /c

- parameters: c:\test.bat

 

Note, when I execute the bat directly on the server, everything works perfectly. But when I test this command with SM69 (or SM49), I always a get "java.lang.NoClassDefFoundError". I tried everything I could think of (set java_home in bat, various directories ...). I then removed the java program from the .bat and put simply  "md c:\test" in the .bat. No problem at all.

I tried to test FM SXPG_COMMAND_EXECUTE. There I get a "COMMAND NOT FOUND" error, although it has been correctly defined in SM69 (name and operating system).

I also tried to call the java command directly in SM69 (as a parameter, as a operating command , etc ..). I still get "java.lang.NoClassDefFoundError"

 

Could somebody help me?

 

Thank you,

 

Arlindo

 

P.S. Contents of .bat:

Just 1 line (URLReader being the program to be called)

 

java URLReader


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>