‎2006 Jun 30 6:34 AM
Hi.
I just want excute java.exe in bw unix without using function 'SXPG_CALL_SYSTEM'.
cause that function has limit number of command string.
I think I can use this command but somehow it returns null.
don't know what is problem and actually not sure usage of CALL 'SYSTEM' function.
anyone can fix this problem?
DATA: INFO_SGL(700) TYPE C OCCURS 0 WITH HEADER LINE.
data: COMMAND_STR type string.
data: CODE_number_500 type string.
CODE_number_500 = '43423424324........'.
concatenate '/opt/java1.3/bin/java -jar'
' test_v2.jar'
CODE_number_500
INTO COMMAND_STR.
CALL 'SYSTEM' ID 'COMMAND' FIELD COMMAND_STR ID 'TAB' FIELD INFO_SGL-SYS.
loop at info_sgl.
return_value = info_sgl.
endloop.
thank you.
‎2006 Jun 30 6:57 AM
Hi,
Try using trx SM69 to register the UNIX command and then use it.
I think system functions are not for external use.
Regards,
Shashank
‎2006 Jun 30 6:57 AM
Hi,
Try using trx SM69 to register the UNIX command and then use it.
I think system functions are not for external use.
Regards,
Shashank
‎2006 Jun 30 7:20 AM
hi.
thank you for answer.
but that is useage of function 'SXPG_CALL_SYSTEM'.
I already done this but 'SXPG_CALL_SYSTEM' can work because parameter 'CODE_number_500' is too long.
so I try find other way that is send string directly.
and some other programs use that 'SYSTEM' function.
so think that can be work for external use.
but don't know how to get useage of this function.
‎2006 Jun 30 7:44 AM
Hi,
Length of the parameter COMMANDNAME is 18.
Hence 'CODE_number_500' should work.
There must be some other problem.
Go thru following documentation.
Hope it helps.
FU SXPG_CALL_SYSTEM
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.
Use
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
PROGRAM_TERMINATION_ERROR Error while requesting final
status of program
X_ERROR Reserved
PARAMETER_EXPECTED Required parameter not specified
TOO_MANY_PARAMETERS User arguments not allowed by
supplied in call
ILLEGAL_COMMAND Command not legitimately defined
OTHERS
Parameters
COMMANDNAME
ADDITIONAL_PARAMETERS
STATUS
EXITCODE
EXEC_PROTOCOL
Exceptions
NO_PERMISSION
COMMAND_NOT_FOUND
PARAMETERS_TOO_LONG
SECURITY_RISK
WRONG_CHECK_CALL_INTERFACE
PROGRAM_START_ERROR
PROGRAM_TERMINATION_ERROR
X_ERROR
PARAMETER_EXPECTED
TOO_MANY_PARAMETERS
ILLEGAL_COMMAND
Function Group
SXPT
Regards,
Shashank
‎2006 Jun 30 8:18 AM
there is misunderstanding .
value of 'CODE_number_500' is not just '43423424324'.
that is huge number of series about 500 character.
I already used that 'SXPG_CALL_SYSTEM' function before and works well until that parameter is less than 255 long.
after exceed 255 character that function are not working anymore so I need get other solution that is my problem.
thanks for finding these reference.
do you have any idea executing external unix program other than this?
‎2006 Jun 30 8:31 AM
Hi,
Not very sure but did you try using the parameter
ADDITIONAL_PARAMETERS
for the function module 'SXPG_CALL_SYSTEM' ?
It helps in specifying the arguments to be passed to the ext command.
Regards,
Shashank
‎2006 Jun 30 7:30 AM
Hi
Check out these links. They will surely help.
http://dev.mysql.com/doc/maxdb/en/41/80201592c31034e10000000a114cbd/content.htm
http://dev.mysql.com/doc/maxdb/en/90/ed2640632cea01e10000000a155106/content.htm
http://www.jochen.org/~jochen/sap-r3/advisory-2001-04.html
http://www.dell.com/downloads/global/power/ps4q05-20050174-SAP-SOE.pdf
http://www.sapdb.org/htmhelp/e7/b8e0d50eea11d5a9f600a0c9449261/content.htm
http://www.pixelbeat.org/cmdline.html
http://www.computerhope.com/unix/ucp.htm#05
http://blogs.ittoolbox.com/security/specialist/archives/linux-os-hardening-4293
http://blogs.ittoolbox.com/linux/world/archives/cool-linux-command-line-and-shell-script-tricks-6848
http://www.experts-exchange.com/Applications/SAP/Q_21864452.html
http://www.aboutdebian.com/linux.htm
http://yolinux.com/TUTORIALS/LinuxEditorial-Advantage.html
If you find this answer useful, please reward me for the same.
Good luck
Karthik Potharaju