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

How to define command for SXPG_COMMAND_EXECUTE

Former Member
0 Likes
18,198

Hi,

anyone can help to to create command to be executed by SXPG_COMMAND_EXECUTE.

I need to create a directory (MKDIR command)

Thanks

Salvatore

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,021

I could see a program at http://www.iconet-ltd.co.uk/sap/abap/sxpg.txt

Hope this helps you.

~thomas

6 REPLIES 6
Read only

Former Member
0 Likes
6,022

I could see a program at http://www.iconet-ltd.co.uk/sap/abap/sxpg.txt

Hope this helps you.

~thomas

Read only

0 Likes
6,021

Thanks but also that program is based on 'Y_REMOVE' command...

I need to know how to create it...

Salvatore

Read only

0 Likes
6,021

you can define the command for each operating system using transactions SM69 (You can test it with SM49) and then call it using SXPG_COMMAND_EXECUTE

Read only

Former Member
0 Likes
6,021

Hi ,

You need to creat a UNIX command in tcode SM49.

Command like calling a Shell script as shown below

/usr/sap/trans/bin/zprinter_utilities/zprinter_display_queue.ksh

Once you have created a command you can use the FM and trigger the unix command from ABAP.

Cheers

VJ

If it helps dont forget to mark points.

Read only

uwe_schieferstein
Active Contributor
0 Likes
6,021

Hello Salvatore

I can give you an example for a command (transaction SM49) which execute an ftp.

- Command name = 'Z_FTP'

- OS command = cmd /C ftp

- Parameters = -i -n -s:?

What does this command? It reads a script from the application server and execute the ftp commands written in this script. The script template could look like this:

*open <FTPHOST>
*user <FTPUSR> <FTPPWD>
*cd <FTPHDIR>
*binary
*lcd <OSDIR>
*get <FILENAME>
*delete <FILENAME>                                            <del>
*bye

Hope I could help you with this.

Regards

Uwe

PS: The ftp parameters are based on a Windows OS system.

Read only

Former Member
0 Likes
6,021

Go to SM69 transaction.

Choose from menu. Edit->Create.

Give a name for your command and give the actual unix command and the parameters to be passed.

This would help you better.

http://help.sap.com/saphelp_erp2005/helpdata/en/c4/3a8023505211d189550000e829fbbd/frameset.htm

Regards,

Ravi