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

SXPG_COMMAND_EXECUTE

Former Member
0 Likes
1,195

Hi all,

i have problem with executing SXPG_COMMAND_EXECUTE

In SM69 we defined an external command 'Z_MKDIR':

Operating system command: c:\sap\create_dir.bat

Parameters for operating system command: &

the script create_dir does following:

@ECHO OFF

mkdir %1

also RFCs are working correctly.

But when we execute

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

COMMANDNAME = 'Z_MKDIR'

ADDITIONAL_PARAMETERS = 'C:\test

OPERATINGSYSTEM = 'Windows NT'

DESTINATION = u_gwdesx

STDOUT = 'X'

STDERR = 'X'

TERMINATIONWAIT = 'X'

IMPORTING

EXITCODE = lf_exitcode

TABLES

EXEC_PROTOCOL = lt_protocol

For some reason folder is not create. Within the table lt_protocol:

31 |Invalid trace level as argument

39 |The syntax of the command is incorrect.

Someone knows what could be the problem?

Many thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
928

Can you test the same, how it works with SM49 t.code.

Regards.

4 REPLIES 4
Read only

Former Member
0 Likes
929

Can you test the same, how it works with SM49 t.code.

Regards.

Read only

0 Likes
928

yes, the result is the same....

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
928

Hello Karol,

Is the BAT file placed on a Windows NT app server? Or is it some presentation server folder?

I'm sure you must be knowing SXPG_COMMAND_EXECUTE can be used to execute commands on app server & not on presentation server!

BR,

Suhas

Read only

Former Member
0 Likes
928

Hi,

ive just checked one the host and additonal parameter is empty.

Do you know why the additional parameter is not attached to the command?

Regards,

Karol