Application Development and Automation 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: 
Read only

Execute Batch file in the Application server

Former Member
0 Likes
776

Hi All,

we have a batch file in Application server
usr\..\a.bat,

I have to execute the batch file from my ABAP program, is there any function module.

Thanks,

Nara.

3 REPLIES 3
Read only

Former Member
0 Likes
516

below code will able to execute any application server commands from abap

REPORT ZUNIX.

data: unix_command(50) type c value 'ls -ls /usr/sap/trans/data'.

data: begin of internal_table occurs 0,

line(200),

end of internal_table.

PARAMETERS UNIXCOMM LIKE unix_command

DEFAULT 'ls -ls /usr/sap/trans/data' LOWER CASE.

call 'SYSTEM' id 'COMMAND' field UNIXCOMM

id 'TAB' field internal_table-SYS.

EDITOR-CALL FOR INTERNAL_TABLE DISPLAY-MODE.

Read only

Former Member
0 Likes
516

The code provided in the earlier post is the correctway to do it, all you need to do now is provide the command you want to execute
usr\..\a.bat in the Selection Screen parameter & you will be set to go...

Read only

andreas_mann3
Active Contributor
0 Likes
516

Hi ,

use fm FM SXPG_COMMAND_EXECUTE

and transaction

Andreas