Application Development 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: 

SXPG_COMMAND_EXECUTE

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Regards.

4 REPLIES 4

Former Member
0 Kudos

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

Regards.

0 Kudos

yes, the result is the same....

SuhaSaha
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

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