on 12-29-2006 9:05 AM
Hi All,
Can any one provide me the exe file name of SAP GUI related.
I need to call the SAP GUI related exe file from java.
i tried with a small java prog which executes the exe files.
it works fine with notepad.exe,javac.exe . But i am unable to execute the SAPgui.exe.
This is my java code
-
try{
Runtime rt=Runtime.getRuntime();
//String str= "C:
WINNT
system32
notepad.exe";
//Process pp=rt.exec("C:
j2sdk1.4.2_08
bin
javac");
Process pp=rt.exec("C:
Program Files
SAP
FrontEnd
SAPgui
SAPgui.exe");
BufferedReader br=new BufferedReader(new InputStreamReader(pp.getErrorStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
}catch(Exception e){
System.out.println(e);
}
and may i pass any additional parameters inorder to invoke this exe.
Please share your ideas abt this problem.
Its Urgent PLZ
Adv Thanks
Regds
Phani.
Hi rajesh,
to laungh sapgui.exe end logon into a sap system you have to use this string:
String str= "C:\Programmi\SAP\FrontEnd\SAPgui\Sapgui.exe hostName systemNumber";
you can use also the complete connection string:
sapgui /H/<SAP router 1>[/S/<SAP router service 1>][...]/H/<host>/S/<service>
Or if you want only to launch saplogon.exe you can use
String str= "C:\Programmi\SAP\FrontEnd\SAPgui\saplogon.exe";
Hope this help
Francesco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Rajesh,
here my complete code:
try{
Runtime rt=Runtime.getRuntime();
// String str= "C:\Programmi\SAP\FrontEnd\SAPgui\saplogon.exe";
String str= "C:\Programmi\SAP\FrontEnd\SAPgui\Sapgui.exe 10.113.10.201 00";
// Process pp=rt.exec("C:\j2sdk1.4.2_08\bin\javac");
Process pp=rt.exec(str);
BufferedReader br=new BufferedReader(new InputStreamReader(pp.getErrorStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
}catch(Exception e){
System.out.println(e);
}
}
Please note that system number is only two digit and in your case is 00.
Another important think, i'm using the italian version of windows, so the program directory is c:\programmi, please change into c:\program files, or you can modify your code to be language indipendend using an system environment variable (if exist).
Hope this help
Francesco
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.