cancel
Showing results for 
Search instead for 
Did you mean: 

FM-----SXPG_CALL_SYSTEM

Former Member
0 Kudos

what this fm do.

and what is "commandname"--is he running batch file???

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

CALL FUNCTION SXPG_CALL_SYSTEM

IMPORTING

COMMANDNAME = <SAP command name> DEFAULT '*'

i have

COMMANDNAME = ZXXXX

when i can find it???

Former Member
0 Kudos

Hi Rani,

This command can be edited in Tx SM69 and executed in Tx SM49. Just have a look in one of these transactions

Kind regards,

Alexander

Lakshmant1
Active Contributor
0 Kudos

Hi Rani,

check tables SXPGCOSTAB,SXPGCOTABE and SXPGHISTOR.

Thanks

Lakshman

former_member188685
Active Contributor
0 Kudos

Hi,

You can see them in SM49 , all the OS commands.

you can change/create using SM69.

these are external OS commands

check it.

regards

vijay

Answers (0)