Entering content frameSXPG_COMMAND_DEFINITION_GET: Read Single External Command  Locate the document in its SAP Library structure

Use this function module to read the definition of a particular external command into an internal table.

You must set the COMMANDNAME and OPERATINGSYSTEM parameters to the appropriate values before you call the function module.

Syntax:

CALL FUNCTION ‘SXPG_COMMAND_DEFINITION_GET’
IMPORTING
COMMANDNAME =
<Name of command in R/3 System>
OPERATINGSYSTEM =
<Target OS as defined in R/3 System>
TARGETSYSTEM =
<Host system for running command>
" Default '*'
EXPORTING
COMMAND =
<Command definition> " Structure
" SXPGCOLIST
EXCEPTIONS
COMMAND_NOT_FOUND
" Command not defined in R/3 database
OTHERS.

Parameters

IMPORTING Parameters

Parameter name

Use

COMMANDNAME

The name of the definition of the external command, as specified in the maintenance function (transaction SM69).

Must be set before you call the function module.

OPERATINGSYSTEM

The type of operating system upon which a command is to be carried out.

Must be set before you call the function module.

TARGETSYSTEM

Host name of the system upon which the selected command is to be carried out.

Optional: use to have the system check on the user’s authorization to run commands on the target system. If the user is authorized, then COMMAND_LIST-PERMISSION is set to ‘X’ . Otherwise, the field is set to space ‘ ‘ .

EXPORTING Parameters

Parameter name

Use

COMMAND

Contains the definition of the selected command in the format shown in transaction SM49 or SM69 (structure SXPGCOLIST). The user can have the command run, if you pass the user’s selection on to SXPG_COMMAND_EXECUTE.

If no command is found, then the exception COMMAND_NOT_FOUND is triggered.

Notes on fields:

· COMMAND_LIST-PERMISSION shows whether the calling user is authorized to run a command on the system that you name in TARGETSYSTEM (optional). ‘X’ means that the user is authorized, ‘ ‘ means that the user does not have authorization to run commands on TARGETSYSTEM.

· COMMAND_LIST-TRACEON and COMMAND_LIST-CHECKALL are set to ‘X’ if the user has the authorization to maintain external commands.

· COMMAND_LIST-SAPCOMMAND is set to ‘X’ if the command in that row is an R/3 standard command. These commands may not be modified in customer systems.

Leaving content frame