‎2012 Jan 10 12:57 PM
Hi,
I am using FM: SXPG_COMMAND_EXECUTE to encrypt file for appication server but i am getting below errors:
- Can't exec external program (Unknown error)
- WaitForSingleObject failedwith %d (No such device or address)
Can you please suggest me on this?
Below parameter passing into FM:
w_addparam = 'C:\usr\sap\DIE\SYS\src\ABC.txt'. ( Appication server TXT file path Name)
w_finalencrpt = 'C:\Desktop1\abc1.txt'. (local drive path name)
w_status = space (No value).
w_exitparam = space (No value).
CONCATENATE w_addparam w_finalencrpt
INTO l_encrtpt_ap SEPARATED BY space.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = 'ZIFI_ENCRYPT'
additional_parameters = l_encrtpt_ap
IMPORTING
status = w_status
exitcode = w_exitparam
TABLES
exec_protocol = t_exec_protocol
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
OTHERS = 12.
IF sy-subrc EQ 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2012 Jan 10 1:07 PM
Check if ZIFI_ENCRYPT is available in SM69 ( External OS command).You can try executing from SM69 with the prameters you have specified in additional parameters
The script ZIFI_ENCRYPT should be present in the application server.
‎2012 Jan 10 1:27 PM
Hi,
Yes i can see the details maintained in SM69 as below:
Command Name: ZIFI_ENCRYPT
OS: Windows NT
Name of external program: C:\usr\sap\DIE\SYS\src\ABC.txt
Parameter of external program: &
How to maintain script at application server?
‎2012 Jan 10 1:57 PM
Hi,
"C:\usr\sap\DIE\SYS\src\ABC.txt" doesn't sound like an executable program for me
Best regards
Marcin Cholewczuk
‎2012 Jan 10 2:56 PM
Try to get the log from the called system, like in the following sample
REFRESH lt_protocol.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = lv_command
additional_parameters = lv_parameters
IMPORTING
exitcode = lv_exitcode
TABLES
exec_protocol = lt_protocol.
IF exitcode NE 0.
cl_db6_backend=>set_attribute( id = cl_db6_backend=>id_caller
value = cl_db6_backend=>val_caller_cockpit ).
CALL FUNCTION 'DB6_SHOW_SXPG_ERROR'
EXPORTING
command = lv_command
PARAMETERS = lv_parameters
server = sy-host
return_code = sy-subrc
exitcode = exitcode
TABLES
exec_protocol = lt_protocol
EXCEPTIONS
OTHERS = 0.
ENDIF.Regards,
Raymond