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

Call System Command

Former Member
0 Likes
2,650

I am executing the following command from a abap program to execute a Unix Script. The script executes successfully but it comes back to the program with a sy-subrc return code of -1????? Anyone have any ideas? We are on 4.6c

Thank You

&----


*& Form EXECUTE_UNIX_COMMAND *

&----


  • *

----


form execute_unix_command.

CALL 'SYSTEM' ID 'COMMAND' FIELD app_script

ID 'TAB' FIELD TABL-SYS.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,156

Hi,

Have you tried executing the external commands using the SM69 and SM49?

I usually do this.

In SM69, create a command for your shell script and than you can call this command from your program using the FM: SXPG_COMMAND_EXECUTE

Hope this helps,

Sumant.

3 REPLIES 3
Read only

Former Member
0 Likes
1,156

Hi Joe,

Check the Below program, you will get this program in latest versions from 4.6c...

RSBDCOS0---->subroutine EXEC

*******************************************************

look OSS Note 9391 for more info

Regards,

Srinivas

Read only

Former Member
0 Likes
1,157

Hi,

Have you tried executing the external commands using the SM69 and SM49?

I usually do this.

In SM69, create a command for your shell script and than you can call this command from your program using the FM: SXPG_COMMAND_EXECUTE

Hope this helps,

Sumant.

Read only

Former Member
0 Likes
1,156

Srinivas & Sumant - Thank you both for your help. It looks like Sumants suggestion will do what I need to do.

Thanks,

Joe