Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in FM: SXPG_COMMAND_EXECUTE

Former Member
0 Likes
1,880

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.

4 REPLIES 4
Read only

mithun_shetty4
Contributor
0 Likes
899

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.

Read only

0 Likes
899

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?

Read only

0 Likes
899

Hi,

"C:\usr\sap\DIE\SYS\src\ABC.txt" doesn't sound like an executable program for me

Best regards

Marcin Cholewczuk

Read only

RaymondGiuseppi
Active Contributor
899

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