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 on SXPG_COMMAND_EXECUTE

Former Member
0 Likes
822

Hi all,

I want to execute a DIR on a external system and I've created a SM69 commant named ZTEST_DIR to do it.

The code of the DIR is RUNRMTCMD CMD('dir t:\docs\cdphtesp ') RMTLOCNAME(XXXXX *IP) RMTUSER(XXXX) RMTPWD('XXX') and it works fine. (with two slash but it does not show)

The probles is that the directory must be variable so, I need to user the additional parameters ( the flag to allow that is checked ).

Then the code of the command is RUNRMTCMD CMD('dir ') RMTLOCNAME(IXXXX *IP) RMTUSER(XXXX) RMTPWD('XXXX') and on the additional parameteres I put the directory as 't:\docs\cdphtesp' (with two slash but it does not show) but it does not work fine it returns an error String '\DOCS\CDPH' contains a character that is not valid.

I've created also a test program to execute it on the SXPG_COMMAND_EXECUTE (I paste the code at bottom) but with the same result.

Can anybody help me?

Thanks in advance.

DATA: d_commandname LIKE sxpgcolist-name,

d_exit_code LIKE extcmdexex-exitcode,

d_status LIKE extcmdexex-status,

d_aditional_parameters like SXPGCOLIST-PARAMETERS.

DATA: li_execution LIKE btcxpm OCCURS 0 WITH HEADER LINE.

d_commandname = 'ZTEST_DIR'.

d_aditional_parameters = 't:\docs\cdphtesp'. (again two slashes)

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

commandname = d_commandname

ADDITIONAL_PARAMETERS = d_aditional_parameters

terminationwait = 'X'

IMPORTING

status = d_status

exitcode = d_exit_code

TABLES

exec_protocol = li_execution

EXCEPTIONS

no_permission = 1.

Edited by: Legoles_ dlb on Jun 10, 2009 3:56 PM

Edited by: Legoles_ dlb on Jun 10, 2009 3:58 PM

1 REPLY 1
Read only

Former Member
0 Likes
464

Finally the problem was resolved; Special characters must be escaped.