2009 Oct 07 9:50 PM
Hi all.
I need execute a .exe (psservice.exe) in application server. This for restart a service in a remote server I tried using tx sm69, but it's not working. When i'm testing the command, system is hang.
Somebody know another way to do this ?
Regards.
2009 Oct 07 10:04 PM
SM69 is the correct way and the only way. When you execute the exe directly from the application server, are you facing any problems? Are there any parameters (input or output) for the exe? Are there any messages/dialog activities in the exe?
2009 Oct 07 10:23 PM
Yes, i have a problem when i'm executing the command.
This is a example,
c:\pstools\psservice
xxx.xxx.1.1 -u username -p password restart service_name.
When i execute this command in MS-DOS console, it returns a message.
Do you think that it is the problem ?
2009 Oct 07 10:28 PM
Yes, you will to handle all the responses coming from the exe. Also, you mentioned application server, but here you are showing it as C: (local drive).
Try writing a small ABAp program and execute your SM69 command using function module SXPG_COMMAND_EXECUTE and see what error you are getting? Sometimes the test tools have the tendency to convert the data into uppercase which may not be valid in all scenarios.
2009 Oct 07 10:58 PM
[SXPG_COMMAND_EXECUTE to Execute External Commands|http://saptechno.blogspot.com/2008/07/sxpgcommandexecute-to-execute-external.html]
2009 Oct 08 2:47 PM
Hi.
In this moment iI don`t know how handle responses. The .exe is located on dir C:\pstools. (application server)
I wrote a program for execute FM SXPG_COMMAND_EXECUTE, but i'm having a problem. When i marked
option TERMINATIONWAIT, the FM still waiting, and i have cancel transaction. If don't mark this option,
FM don't work.
Why happen this ?
2009 Oct 08 5:17 PM
Hi all.
I checked the task manager in app server, and psservice was running. But i need program ends correctly.
Somebody know how to do resolve this ?
2009 Oct 08 5:25 PM
>
>The .exe is located on dir C:\pstools. (application server)
>
C:\pstools. (presentation server)
/usr/sap/temp/ (application server)
If you have the .exe in your PC C directory.. how are u planning to have that file in a user who is in Taiwan or Mumbai or Brussels?
2009 Oct 08 5:55 PM
What is the SY-SUBRC value you are getting after calling the FM?
2009 Oct 08 5:56 PM
>
> >
> >The .exe is located on dir C:\pstools. (application server)
> >
>
> C:\pstools. (presentation server)
> /usr/sap/temp/ (application server)
>
> If you have the .exe in your PC C directory.. how are u planning to have that file in a user who is in Taiwan or Mumbai or Brussels?
Hi Jay!
C:\pstools is a dir located in Microsoft Server Windows 2003. In this server is installed SAP.
After could move PsTools to /usr/sap/....
Now i need finish correctly .exe, because it remains running(checking task manager of OS), and
not returns.
Regards.
2009 Oct 08 7:04 PM
>
> What is the SY-SUBRC value you are getting after calling the FM?
FM not ends. I have to cancel transaction. However the .exe is being executed by FM, but program never finish.
2009 Oct 08 7:14 PM
I checked ur FM is RFC enabled.. so you can do some thing to kil the task...
taskname(7) TYPE c VALUE 'EXEtest'',
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
STARTING NEW TASK taskname
DESTINATION 'NONE'
PERFORMING ret ON END OF TASK
EXPORTING
.....
.....
IF sy-subrc EQ 0.
WAIT UP TO 1 SECONDS.
ENDIF.
FORM ret USING p_task TYPE clike.
write some code to kill the task..
I am hopeing this would help u..
2009 Oct 08 10:31 PM
>
> I checked ur FM is RFC enabled.. so you can do some thing to kil the task...
>
>
> taskname(7) TYPE c VALUE 'EXEtest'', > > CALL FUNCTION 'SXPG_COMMAND_EXECUTE' > STARTING NEW TASK taskname > DESTINATION 'NONE' > PERFORMING ret ON END OF TASK > EXPORTING > ..... > ..... > IF sy-subrc EQ 0. > WAIT UP TO 1 SECONDS. > ENDIF.
>
>
FORM ret USING p_task TYPE clike. > > write some code to kill the task..
> I am hopeing this would help u..
I tried this and not works. I think that is a System Operative problem, because running directly
file .bat in MS-DOS, it works.
However when i execute file .bat in sm49 ( with sap user ) it fails.
2009 Oct 08 11:15 PM
I would suspect that this is some problem or restruction in the server program psservicei tself.
The name seems to imply it: It might not be intended for remote access.
When running it from DOS as a command line tool you are on the server yourself, right?
When running it remotely, you might be load balanced onto different application server instances so SAPXPG's file path is not that which your server program is expecting or not finding the program.
I am not familiar with this program, but I suspect that although you can start it remotely it is not intended for this scenario.
As already mentioned by J@y, it expects some local interface which you dont have in your ABAP.
Just a guess in the dark,
Julius
2009 Oct 09 3:42 AM
>
> I would suspect that this is some problem or restruction in the server program psservicei tself.
>
> The name seems to imply it: It might not be intended for remote access.
>
> When running it from DOS as a command line tool you are on the server yourself, right?
>
> When running it remotely, you might be load balanced onto different application server instances so SAPXPG's file path is not that which your server program is expecting or not finding the program.
>
> I am not familiar with this program, but I suspect that although you can start it remotely it is not intended for this scenario.
>
> As already mentioned by J@y, it expects some local interface which you dont have in your ABAP.
>
> Just a guess in the dark,
> Julius
Hi Julius.
I run program in command line, in application server.
However, when i'm testing using SM49, program is running( checking task manager in app server), but not ends.
The program psservice can work with services, in a local or remote server.
Really i want execute a program
located in application server, for restart a service located in a remote server.
Do you know another way for do this ?
Regards,
Manuel H.
2009 Oct 15 5:26 PM
Solved. Authorization problem in remote server.
Thank for your answers.
2009 Oct 15 5:26 PM
2009 Nov 17 3:27 AM
Hi Manuel ,
can you tell how you achieved.
when i run it is saying external command not executable.
can you please update me. Possible.
Thankks,
Harikiran