This website is not affiliated with, sponsored by, or approved by SAP AG.

.bat execution in ABAP

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

.bat execution in ABAP

Postby Kirti12 » Tue Jun 03, 2003 2:29 am

Hi all,

Can anybody tell me how to run a file with ".bat" extension or any script file using ABAP.


Postby Rich » Tue Jun 03, 2003 3:15 am

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.



I'd normally say use the search function because this has been answered lots of times, but I've got a hangover and can't be bothered.


Abap KC:
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Postby Kirti12 » Tue Jun 03, 2003 3:34 am

Hi Rich,

I am asking this coz am really not able to figure it out what will be the command which I will be passing in it.
I am able to use this function module properly, in the sense, when I am trying to do it using transaction code se49 and se69 for simple command "mv" and "cp" etc... I am able to do it..but how to call/what will be the command in this case.

Please help.


Postby Kirti12 » Tue Jun 03, 2003 8:42 pm

Hi all,

I am still waiting for the reply..

To elaborate my question, it goes like this,

I want to make a call to some external application which might be diffrent from my SAP OS..

I have tried using SGPX* function module, It works fine if I use command like "CP" and "move" and "ls" etc...
But I really don't know how to do it when I want to execute some executable file on my SAP server as well as some diffrent application/server.
I came to know if it can be made .bat file or any script can be written than it might resolve the problem..

This time your help will be highly appreciated.


Return to ABAP

Who is online

Users browsing this forum: No registered users and 7 guests


This website is not affiliated with, sponsored by, or approved by SAP AG.