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

GZIP and External command.

Former Member
0 Likes
787

Hello,

My problem might seem simple but I have tried for a couple of days now to make researches on that matter and it still doesn't work, no matter what.

I had to make, with SM69, two external commands. One was using the command "mv" which is working very well and the other must be a "gzip" with a parameter "-c" and, in a module function, with the function "SXPG_COMMAND_EXECUTE_LONG", I have to send the path and the file name.

So since I am not able to make it work in the module function I'm creating, I am working to make it work on SM69. So here what I have entered so far...

Operating System Command: gzip

Parameters for operating sytem command: -c

Additional parameters: path/file.txt > newpath/file.txt.gz

Though, the only thing I am receiving is no change at all and I'm receiving u2039 È ®J as a message. The Exit code is at 1 and the exit status is E.

I know it means there is something wrong but all my researches lead me to do it that way so I'm not sure where I am going wrong and how to make it work appropriately.

Can you please help me?

I am open to questions if you have any.

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
515

Hi, kindly check the following example



Command name : ZTEST
Operating system command : cmd /c


v_dir_input = 'cmd /c c:\winzip\wzzip.exe -password  g:\test1.zip g:\test.pdf'.
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.

1 REPLY 1
Read only

Former Member
516

Hi, kindly check the following example



Command name : ZTEST
Operating system command : cmd /c


v_dir_input = 'cmd /c c:\winzip\wzzip.exe -password  g:\test1.zip g:\test.pdf'.
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.