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 issue

Former Member
0 Likes
2,151

Hello Experts,

We have this issue in client server.One of the batch job is frequently failing while executing this function module SXPG_COMMAND_EXECUTE with error as command_not_found.This error occurs frequently on a particular application server but not all the times it fails but we find some job failures 2 to 3 times a day,as this batch job is running every 15min.Please find the sample code below and advice.Many thanks in advance.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'

EXPORTING

commandname = 'ZZ_YP_MKDIR'

additional_parameters = w_command

TABLES

exec_protocol = i_command_results

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.

IF sy-subrc = 0.

LOOP AT i_command_results.

WRITE: / i_command_results-length,

i_command_results-message.

IF i_command_results-message <> space.

w_error = 'X'. "AN14112002

MESSAGE i179(zv) WITH i_command_results-message

v_char_seqno.

"'Make Directory failed'

ENDIF.

1 ACCEPTED SOLUTION
Read only

bbalci
Contributor
0 Likes
1,648

Hi swathv

That function is used for calling Unix scripts on the application server,

You can specify a unix script as a command on transaction SM69

and than you can call this command with function 'SXPG_COMMAND_EXECUTE'

Can you find this command in SM69 and related script,

and learn what is it used for?

Maybe you are using more than 1 application server,

and script file exist on a server but doesn't exist on other.

I hope it helps.

5 REPLIES 5
Read only

bbalci
Contributor
0 Likes
1,649

Hi swathv

That function is used for calling Unix scripts on the application server,

You can specify a unix script as a command on transaction SM69

and than you can call this command with function 'SXPG_COMMAND_EXECUTE'

Can you find this command in SM69 and related script,

and learn what is it used for?

Maybe you are using more than 1 application server,

and script file exist on a server but doesn't exist on other.

I hope it helps.

Read only

Former Member
0 Likes
1,648

Hi,

Yes, you're right more than 1application server is used and the script file exists on all the server.Let me mention that not all the time its failing on this server, only sometimes.Pls advice what needs to be checked with.

Thanks.

Read only

0 Likes
1,648

As you said "This error occurs frequently on a particular application server but not all the times.."

Since it occurs randomly

It seems like a file accessibility problem for that application server and sometimes only.

You can specify which server the Job runs on with transaction SM37.

Just choose your job in the list, click menu item Job > Change

and fill field "Exec.Target" with a problem-free server.

Edited by: Bulent Balci on Aug 4, 2010 3:39 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,648

How is the command 'ZZ_YP_MKDIR' defined & what is the value passed to 'w_command' ?

Read only

Former Member
0 Likes
1,648

Check in SM49 if command you trying execute thru FM exists, may be something might have got changed recently.