cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter: Run OS command unix after processing message

Former Member
0 Kudos

Hi,

in file adapter configuaration, after processing message, I've configured the channel that it has to call an unix script.

The sintax in configuration is:

sh /XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/rename_lib_contabili.sh <variable>.

I tried also without the entire path and without the sh command at start of it.

We have a XI 3.0 sp20.

I don't understand, What other I have to do.

Regards,

Antonello

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

We've got a similar adapter. OS command looks like this: "/home/xiadm/scripts/prog.sh %f file9999.dat"

I remember there was some reason for the %f to be included (because the script doesn't use this input paramter). The script will only be exectued if there is a file to be processed by the adapter, otherwise the script will not start. I assume that the script works from the commandline.

Hope this helps.

Former Member
0 Kudos

Hi Erik,

the script working fine from command line and the user xs0adm (XI service user) have the rights.

I don't understand if I have to put the script, in the adapter config, between double peak (" ").

Regards,

Antonello

Former Member
0 Kudos

no, no quotes.

0 Kudos

¿do you see any error in message monitor details?

Former Member
0 Kudos

No...

It still doesn't work.

The status log in RWB is sussesfully.

have any idea?!

0 Kudos

Antonello,

I don't refer to message status.... it could be successful but, in details screen (audit log) , you can see the value of your parameter and the status of the execution of the script.

For example:

29.09.2009 13:13:50 Success Connecting to FTP server "xxxxxxxxxx"

29.09.2009 13:13:50 Success Execute OS command "sh your_script your_parameter_value"

It's possible that you have an error in this step but status of message is succesful.

I

Regards,

Carme.

Former Member
0 Kudos

No error...

0 Kudos

¿And you have test the same script with the same parameter value in your XI command?

¿Sure your script is correct?

Carme.

Former Member
0 Kudos

Hi Carme,

I found a warning that "describes" the error...

2009-09-29 13:36:15 Success Write to file "/XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/LIBROGIORNALE_test_mov.zip" as binary, size 7248 bytes

2009-09-29 13:36:15 Success Execute OS command "/home/xs0adm/scripts/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip"

2009-09-29 13:36:15 Warning Error when executing OS command "/home/xs0adm/scripts/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip"

2009-09-29 13:36:15 Success File processing complete

2009-09-29 13:36:15 Success MP: Leaving module processor

2009-09-29 13:36:15 Success The message was successfully delivered to the application using connection

File_http://sap.com/xi/XI/System.

2009-09-29 13:36:15 Success The message status set to DLVD.

if I try to execute this script from Unix schell or ABAP OS shell this working fine.

You have any idea?!

Thanks,

Antonello

0 Kudos

Then, file adapter is executing your script but it finish in error.

If you can execute this script without error in command line, then tit would be because of :

  • Permissions executing your script

  • Permissions in your file LIBROGIORNALE_test_mov.zip

¿Perhaps file LIBROGIORNALE_test_mov.zip is your target file created in the same communication channel?

If yes, you must configurate 0 secs in your command message timeout and perhaps insert a 1-2 secs. delay in your script.

i think target file are blocked until message is really finished in adapter engine.

Carme.

former_member181985
Active Contributor
0 Kudos

Try this in OS command.................

/usr/bin/ksh /XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/rename_lib_contabili.sh <variable>

Regds,

Praveen

Former Member
0 Kudos

Hi all,

now also the message monitor audit is OK:

009-09-29 14:10:35 Success Write to file "/XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/LIBROGIORNALE_test_mov.zip" as binary, size 7248 bytes

2009-09-29 14:10:35 Success Execute OS command "/usr/bin/ksh /XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip"

2009-09-29 14:10:35 Success File processing complete

2009-09-29 14:10:35 Success MP: Leaving module processor

2009-09-29 14:10:35 Success The message was successfully delivered to the application using connection File_http://sap.com/xi/XI/System.

2009-09-29 14:10:35 Success The message status set to DLVD.

But I don't see the result of script. It seem not processing from OS.

The script work correctly from ABAP or UNIX schell with the OS command "/usr/bin/ksh /XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip".

I set also the timeout parameter to 5 secs.

Big mystery!

Former Member
0 Kudos

Hi all,

finally revolve!!!

I called the script with %f and not with %F parameter.

If you don't put the absolute path, it call the script with the folder of the J2EE XI adapter (usr/sap/server0).

Infact the message monitor said me "Success" but I didn't see the result on the "Output" folder...

Thanks anyway.

Regards,

Antonello

Edited by: Antonello Didonna on Sep 29, 2009 3:36 PM

0 Kudos

Hi, Antonello,

Go to message monitor and search your message. In details button... ¿can you see any error? ¿or execution of script is successful? if it is'n successful, try to execute your script directly on your XI system.

Regards,

Carme