Hi All,
I keep getting this error and i dont know what I am doing wrong.I have checked forums but no solutions for this issue.
This is the error.
Can't exec external program (No such file or directory)
WaitForSingleObject failedwith %d (No such device or address
I have tried to execute the program code below to encrypt the pdf "test" but am facing the above errors in the function sxpg_command_execute
REPORT zsxpg_command_execute.
DATA: BEGIN OF command_list OCCURS 0.
INCLUDE STRUCTURE sxpgcolist.
DATA: END OF command_list.
DATA: BEGIN OF exec_protocol OCCURS 0.
INCLUDE STRUCTURE btcxpm.
DATA: END OF exec_protocol.
DATA: status LIKE btcxp3-exitstat,
commandname LIKE sxpgcolist-name VALUE 'ZENCRYPT_PDF',
sel_no LIKE sy-tabix.
* GET LIST OF EXTERNAL COMMANDS
CALL FUNCTION 'SXPG_COMMAND_LIST_GET'
EXPORTING
commandname = commandname
operatingsystem = sy-opsys
TABLES
command_list = command_list
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'SXPG_COMMAND_CHECK'
EXPORTING
commandname = command_list-name
operatingsystem = sy-opsys
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
x_error = 6
too_many_parameters = 7
parameter_expected = 8
illegal_command = 9
communication_failure = 10
system_failure = 11
OTHERS = 12.
CLEAR command_list.
REFRESH command_list.
DATA: v_dir_input TYPE sxpgcolist-parameters.
DATA: v_dir_input1 TYPE sxpgcolist-parameters.
command_list-name = 'ZENCRYPT_PDF'.
command_list-opsystem = 'Windows NT'.
DATA : doc TYPE string.
DATA : pass TYPE string .
doc = 'test'.
pass = '123456'.
DATA name TYPE string.
DATA name1 TYPE string.
name1 = 'owner'.
CONCATENATE 'D:\pdf\'doc'.PDF' INTO name.
CONCATENATE 'cmd /c D:\pdf\encryptpdf' '-i' name '-w ' doc '-u' pass INTO v_dir_input SEPARATED BY space .
READ TABLE command_list INDEX sel_no.
CONCATENATE command_list-opcommand v_dir_input INTO command_list-opcommand SEPARATED BY space.
* CHECK AUTHORIZATION
command_list-addpar = 'X'.
APPEND command_list.
CONSTANTS: c_extcom TYPE sxpgcolist-name VALUE 'ZENCRYPT_PDF',
c_oper TYPE syopsys VALUE 'Windows NT'.
DATA: t_result TYPE STANDARD TABLE OF btcxpm.
v_dir_input = command_list-opcommand.
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.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I have created a directory 'pdf' as and place my encrypt software D:\pdf
In SM69 i have created my command and pass it in the program .But still get this errors.
Please help me see clearly where i am going wrong?
Regards
Jack