cancel
Showing results for 
Search instead for 
Did you mean: 

How To execute a Remote EXE from SAP ?

Former Member
0 Kudos

Hi,

We are having a case where in from SAP(ABAP) we have to execute a remote

EXE. This Remote EXE can be accessable by sharing the Drives or mapping the drive. i tried using WS_EXECUTE or GUI_EXEC it is not working it gives me the following error.

Component MSWINSK.OCX or one of its dependicies not correctly registered: a file is missing or invalid.

Is it that WS_EXECUTE or GUI_EXEC expect the exe to be available locally. ?

or do i have to create the RFC destination ?

Regards,

Umesh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

The component MSWINSK.OCX is a windows live messenger file that is missin in your system.download that file and try running WS_EXECUTE again.

Reward if useful

Former Member
0 Kudos

Hi

It is possible to have separate ABAP Server and Separate Gateway Server.

Regards

Sumit Jain

Former Member
0 Kudos

can anybody tell me what it is? How i can go abt. this.

Any document which can explain step by step or any link ?

pl. give some more description.

rolfc_weber
Contributor
0 Kudos

Hi Umesh,

I think every thing is already explained.....

As you don't have another SAP system running on your Windows Box, you have to install a "Stand Alone Gateway" on this Windows Box as Peter Simon wrote.

The Stand Alone Gateway can be installed by using the SAP Presentation CD/DVD (SAP GUI installation CD if you want). On this CD/DVD there is a installation description.

Then you have to copy the SAPXPG.EXE (Windows version matching your gateway programs) to the directory where your gateway was installed (\..\exe\run directory). The program can be taken from a Windows "kernel" matching your Windows platform on the SAP Download site.

Afterwards you have to create a RFC connection (SM59) from your SAP system pointing to the SAPXPG program on the Windows machine of this Standalone Gateway (use the Gateway options of the RFC connection !)

The you can create your external command as Sumin Jain as explained (including parameters and so on).

When executing your command, you only have to remote execute the command using you RFC-Connection created before.

Hope this gives you an idea of the steps to perform....

Regards

Rolf

Former Member
0 Kudos

Hi Rolf ,

Thanx for your reply. i have not tried out this. i will get the help of or Basis team & i will update you on this. before that i just want to ask you that, as per my requirement first i have to create one file at the remote machine into some designated directory. Then with the help of this iput file i have to execute an EXE which is actually an input to this EXE. based on this the EXE creates output file in some other directory on remote machine. Is this all activities are possible with the soluation which you have mentioned. Secondly how this Stand alone gateway works. Do i have to write any special ABAP commands to Read/Write Remote input & output file & to execute an EXE. Pl. clarify in detailed or give me some link where i can find more information on "Stand alone Gateway"

P.S. : I am not Basis guy.

Regards,

Umesh

rolfc_weber
Contributor
0 Kudos

Hi Umesh,

In principle, what you can do from a command prompt in Windows, you can also do from within SAP using external commands / programs (Transaction SM49/SM69).

Normally this will not require writing ABAP code, but can be executed directly or by using a SAP job (Transaction SM36).

You original question was how to execute a remote EXE from SAP, and this can be done by installing a so called "Standalone Gateway" on the remote machine, if there is no (ABAP) SAP system running on the machine already.

In short the (standalone) gateway enables SAP to execute OS commands by using RFC connections or calls from SAP system to this gateway.

For more information about standalone gateway you could read the installation guide found under http://service.sap.com/installnw2004s => Standalone Engines => Gateway installation.

If this is the solution for your specific requirement i can't tell, but if you can create a script on the Windows machine that can do every thing you want, you will be able to start this script from your SAP system, by using a external command in combination with a standalone gateway on the remote machine.

I hope this clarifies

Regards

Rolf

PS.: Remember to assign point to every usable answer on you question....

Former Member
0 Kudos

In SAP you can access External OS commands using the transaction SM49/SM69.

Just check if the following link is of any help to you.

http://searchsap.techtarget.com/general/0,295582,sid21_gci1156933,00.html

Former Member
0 Kudos

Dear sumit,

Thanx for your reply.... But i want to update you more on this.

first of all our sap is on HP\UNIX the exe which i want to execute is on windows machine which is Remote machine. This Exe expect some parameters.

It also expect some file to be created in that remote machine which is an input to this exe.

can you pl. tell me step by step how i can do this. & even a progam or FM which can create a file on the remote machine. i dont want to do the shared drive business. because it could be risky.

how abt. RFC port ?

Pl help.

Regards,

Umesh

Former Member
0 Kudos

If there is also an ABAP Server running on the Windows Box (same SID) you can use the batch system to execute commands on Windows.

If there is no ABAP Server running you can install a Standalone SAP Gateway on the windows box and use this gateway to execute commands.

Peter

Former Member
0 Kudos

hi,

what do u mean by ABAP server. or Standalone SAP Gateway are u talking abt. GUI ?

can u give more details on this pl.