‎2007 Jul 11 4:30 AM
hi,dear all:
I want to call an external program of a windonws 2003 system using function SXPG_CALL_SYSTEM,can you give me some advice,notes or give me some example about it?
‎2007 Jul 11 4:38 AM
Hi,
please check out the link below it might help you
http://help.sap.com/saphelp_46c/helpdata/en/fa/096c67543b11d1898e0000e8322d00/frameset.htm
http://help.sap.com/saphelp_40b/helpdata/en/fa/0971ee543b11d1898e0000e8322d00/content.htm
http://www.thespot4sap.com/Articles/SAP_Mail_UNIX.asp
http://naxos.bsz-bw.de/rekla/show.php?mode=source&eid=uni_0_10811073-1kap
http://www.sapfans.com/sapfans/alex.htm
**********please reward points if the information is helpful to you****************
‎2007 Jul 11 4:47 AM
Jian,
check the documentation of the FM in SE37...
********************************************************
FU SXPG_CALL_SYSTEM
___________________________________________________
Text
Execute an External Command
Functionality
SXPG_CALL_SYSTEM: Execute External Command (Express Method)
Using this function module, you can:
o Check a user's authorization to execute a command
o Execute the command
To determine the system on which the command should be executed, the
function module uses by default the current host system and the current
operating system type of the user.
As the function module is RFC-capable, you can use the RFC interface
(Remote Function Call Interface) to run the function module in a
different SAP application server. The external command is then
accordingly executed in the host system of the other SAP server.
SXPG_CALL_SYSTEM uses the following rules to determine which variant of
a command is used for the execution:
o If a command with the same operating system type as the one in the
sytem field SY-OPSYS exists, this definition is used for the
execution of the command.
o If the first check fails, the syntax group for SY-OPSYS is determined. A syntax group is an SAP construct that groups operating
systems that use the same syntax for commands and filenames. If a
command whose operating system type matches the determined syntax
group, this definition of the command is used.
o If no matching definition is found for the syntax group, the
function module searches for a definition with the operating system
type ANYOS (executable in all supported operating systems). This
definition is then used, if found.
o Otherwise, the exception COMMAND_NOT_FOUND is triggered.
se
Syntax:
CALL FUNCTION SXPG_CALL_SYSTEM
IMPORTING
COMMANDNAME = <SAP command name> DEFAULT '*'
ADDITIONAL_PARAMETERS = <Argument string> default <space>
EXPORTING
STATUS = <Exit status of command>
TABLES
EXEC_PROTOCOL = <Log> In structure BTCXPM. Can
contain STDOUT, STDERR
EXCEPTIONS
NO_PERMISSION Command rejected by User exit auth.
check
COMMAND_NOT_FOUND Command not defined in SAP database
PARAMETERS_TOO_LONG Complete parameter string exceeds
128 characters
SECURITY_RISK Security check failed
WRONG_CHECK_CALL_INTERFACE Problem with function
module for additional security
check
PROGRAM_START_ERROR Error while starting program
==============
This command can be edited in Tx SM69 and executed in Tx SM49. Just have a look in one of these transactions
http://help.sap.com/saphelp_nw04/helpdata/en/fa/0971ee543b11d1898e0000e8322d00/content.htm
Don't forget to reward if useful....