‎2006 Oct 12 5:24 AM
Hi, fellow.
I met a problem.
I want to use a RFC function named "SXPG_COMMAND_EXECUTE".
I just don't understand WHY a totally same function "SXPG_COMMAND_EXECUTE" appears in codes of function "SXPG_COMMAND_EXECUTE".
============
IF NOT APPSERV_DESTINATION IS INITIAL.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
DESTINATION APPSERV_DESTINATION
...........
============
Does "SXPG_COMMAND_EXECUTE" need to call itself ???
Is't commanded by implement of a RFC function ???
Any help is appreciated.
Thanks.
‎2006 Oct 12 6:14 AM
Hi,
I found some documentation in the same FM.
First, for platforms without remote shell try to get to the
target host by an internal rfc. If an application server
runs on the target host so does a gateway which then starts
SAPXPG by some kind of FORK mechanism rather than by remote
shell. (This is only tried if there is no explicit
rfc destination given by the optional parameter destination.)
Regards,
SCK
‎2006 Oct 12 6:11 AM
This seems to be recursion where function being defined may be used within its own definition.
A simple example for it to explain is :
function factorial(n)
{
if (n <= 1)
return 1;
else
return n * factorial(n-1);
}
The function calls itself recursively on a smaller version of the input (n - 1) and multiplies the result of the recursive call by n, until reaching the base case, analogously to the mathematical definition of factorial.
procedure ProcessTree(node)
{
ProcessNode(node); // perform specific operation with the given node first
foreach child_node of node do ProcessTree(child_node);
}
RFC is basically a remotely called Function module which may or may not use recursion.
Hope this helps!
Cheers!
‎2006 Oct 12 6:14 AM
Hi,
I found some documentation in the same FM.
First, for platforms without remote shell try to get to the
target host by an internal rfc. If an application server
runs on the target host so does a gateway which then starts
SAPXPG by some kind of FORK mechanism rather than by remote
shell. (This is only tried if there is no explicit
rfc destination given by the optional parameter destination.)
Regards,
SCK
‎2006 Oct 12 10:10 AM
Sannamane,
I must say the comments you found seems to describe another issue.
In that function, two conditions are considered.
Only when rfc destination is empty, what you mentioned occured.
and Jain,
I read your reply carefully.
Though I'm not sure you're right, I believe that should be a kind of thought towards right direction.
‎2013 Jun 24 1:40 PM
v_dir_input = 'cmd /c c:\winzip\wzzip.exe -stestpass g:\IV.zip g:\test.pdf'.
| DATA: t_result | TYPE STANDARD TABLE OF btcxpm. |
DATA: v_dir_input | TYPE sxpgcolist-parameters. " Input Directory |
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = c_extcom
additional_parameters = v_dir_input
operatingsystem = c_oper
TABLES
exec_protocol = t_result
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
OTHERS = 15.