Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Running windows batch file from abap

Former Member
0 Kudos

Hi all.

Does anyone know a way to activate a batch file threw abap?

Thanks in advance,

Rebeka

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rebeka,

Have a look at function module GUI_EXECUTE or WS_EXECUTE. Another way to do this if the batch file is on the server is to use transactions SM69 and SM49 and then function module SXPG_COMMAND_EXECUTE.

Regards,

C.A

6 REPLIES 6

Former Member
0 Kudos

Hi Rebeka,

Have a look at function module GUI_EXECUTE or WS_EXECUTE. Another way to do this if the batch file is on the server is to use transactions SM69 and SM49 and then function module SXPG_COMMAND_EXECUTE.

Regards,

C.A

0 Kudos

Hi.

First of all, thanks..

Second, that's exactly the problem:

I'm activating FM SXPG_COMMAND_EXECUTE with a command that cannot work on background.

For that reason we had created a batch file ...

FM gui_execute does not exist and WS_EXECUTE cannot work with batch mode......

My only possible way is to find a fm that can activate a batch file and works with background mode.

I'll apriciate it if you could help me find one.

Regards,

Rebeka

0 Kudos

Hi Rebeka,

Try using fm rfc_remote_exec.This works in background.

Regards,

C.A

0 Kudos

Can't find it.

What is thespesific name of this FM?

Thanks,

Rebeka

0 Kudos

HI Rebeka,

You won't find it because the fm resides on the gui. So just refer to oss note 77075 on service.sap.com on how to use it.

Regards,

C.A

0 Kudos

Preconditions / Restrictions, for example:

- Available from R/3 Release 2.1.

- You can execute extensions .com/.exe/.bat.

- Install the RFC server program RFCEXEC.EXE with the Desktop Development Kit.

- The destination (in the example, LOCAL_EXEC) was created with transaction SM59

Example 1: call the program TEST1.EXE. report ztest1.

data: Path1(256) type c value 'C:\PROGRAM FILES\TEST1.EXE' .

call function 'RFC_REMOTE_EXEC'

destination

'LOCAL_EXEC'

exporting

COMMAND = Path1 .

Most probably you would have the rfcsdk installed on your desktop

Regards,

C.A