Skip to Content
0
Former Member
May 30, 2013 at 07:20 AM

Error “Can't exec external program (No such file or directory)” while executing ‘SXPG_COMMAND_EXECUTE’ for Renaming the file on the Windows base application server

581 Views

Dear Exparts,

We would like to rename a file on the windows application server, For testing purpose we have created a program ZOS_TEST, inside the program ZOS_TEST we simply call the FM ‘SXPG_COMMAND_EXECUTE’ to rename a file on the application server.

But every time we are getting the error “Can't exec external program (No such file or directory)” and “WaitForSingleObject failedwith %d (No such device or address)”

We have run the program through the ID “SAPBATCH” but still we are getting the same error.

We have also tried to execute the del command but here also we are getting the same error message.

When we call the FM ‘SXPG_COMMAND_EXECUTE’ we pass the input parameters as below:

Here “\\xyz.app.abc refers to the application server name

Test 1: Rename with “”

  1. Commandname----à ‘Z_BCM_RENAME’(Entry exist on the table SXPGCOSTAB)SM69 the command is "rename"
  2. ADDITIONAL_PARAMETERS--à "\\xyz.app.abc\interface_asc\Old_File1.txt" "old_new1.txt"
  3. OPERATINGSYSTEM ---à'WINDOWS NT'
  4. TARGETSYSTEM------à'XYZCHSAPEU10'
  5. stdout -------------à ‘X’
  6. stderr------------à ‘X’
  7. terminationwait ---à ‘X’

Results:

Can't exec external program (No such file or directory)

WaitForSingleObject failedwith %d (No such device or address)

Test 2: Rename with out “”

  1. Commandname----à ‘Z_BCM_RENAME’(Entry exist on the table SXPGCOSTAB)the command is "rename"
  2. ADDITIONAL_PARAMETERS--à

\\xyz.app.abc\interface_asc\Old_File1.txt old_new1.txt

  1. OPERATINGSYSTEM ---à'WINDOWS NT'
  2. TARGETSYSTEM------à'XYZCHSAPEU10'
  3. stdout -------------à ‘X’
  4. stderr------------à ‘X’
  5. terminationwait ---à ‘X’

Results:

Can't exec external program (No such file or directory)

WaitForSingleObject failedwith %d (No such device or address)

Test 3: For Deletion with “”

  1. Commandname----à ‘Z_BCM_RENAME_DEL’(Entry exist on the table SXPGCOSTAB)the command is "del"
  2. ADDITIONAL_PARAMETERS--à "\\xyz.app.abc\interface_asc\Old_File1.txt"
  3. OPERATINGSYSTEM ---à'WINDOWS NT'
  4. TARGETSYSTEM------à'XYZCHSAPEU10'
  5. stdout -------------à ‘X’
  6. stderr------------à ‘X’
  7. terminationwait ---à ‘X’

Results:

Can't exec external program (No such file or directory)

WaitForSingleObject failedwith %d (No such device or address)

Test 4: For Deletion with out “”

  1. Commandname----à ‘Z_BCM_RENAME_DEL’(Entry exist on the table SXPGCOSTAB)command is "del"
  2. ADDITIONAL_PARAMETERS--à \\xyz.app.abc\interface_asc\Old_File1.txt
  3. OPERATINGSYSTEM ---à'WINDOWS NT'
  4. TARGETSYSTEM------à'XYZCHSAPEU10'
  5. stdout -------------à ‘X’
  6. stderr------------à ‘X’
  7. terminationwait ---à ‘X’

Results:

Can't exec external program (No such file or directory)

WaitForSingleObject failedwith %d (No such device or address)

Test 5: For Deletion on E:\

  1. Commandname----à ‘Z_BCM_RENAME_DEL’(Entry exist on the table SXPGCOSTAB)command is "del"
  2. ADDITIONAL_PARAMETERS--à E:\interface_WCD\Old_File1.txt
  3. OPERATINGSYSTEM ---à'WINDOWS NT'
  4. TARGETSYSTEM------à'XYZCHSAPEU10'
  5. stdout -------------à ‘X’
  6. stderr------------à ‘X’
  7. terminationwait ---à ‘X’

Results:

Can't exec external program (No such file or directory)

WaitForSingleObject failedwith %d (No such device or address)

Please help us to resolve the issue