2016 Mar 10 9:03 AM
Dear Experts,
I am using
'SXPG_COMMAND_EXECUTE' ,but it can not work SY-SUBRC return 2, t_result no records, would you please give advice?
ALL 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.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
2016 Mar 10 9:12 AM
I'd start by checking table SXPGCOTABE if the value of C_EXTCOM exists there..
2016 Mar 10 9:29 AM
Hi,
The system command variable c_extcom gets the value from SM69 tcode.
so, you are getting sy-subrc = 2.
create a command using SM69.
Go through the FM documentation you will get a clear idea.
Regards,
Anusha
2016 Mar 10 9:49 AM
2016 Mar 10 2:18 PM
Read first SXPG_COMMAND_EXECUTE: Check Authorization for and Execute an External Command (or FM documentation) to understand exception codes:
COMMAND_NOT_FOUND
Command name, as identified by COMMANDNAME and OPERATINGSYSTEM, has not been defined in the maintenance function (transaction SM69).
Regards,
Raymond