cancel
Showing results for 
Search instead for 
Did you mean: 

Question on 'run OS command before message processing'

pansy_leung
Explorer
0 Kudos

I want to have more understandings about the 'Run OS command before message processing' in Process Integration

1.  Where is the OS command executed ?  In PI server, sender server (window server) or receiver server (window server) if I set up the the command in sendor communication channel ?

2.  My scenario is a file-to-file case using FTP. SAP-PI gets a flat file from a directoy (e.g. c:\home\abc) of sender server using FTP. And also sends the flat
file to a directory of receiver server using FTP. Before sending to receiver server, a copy of this flat file will be saved to the other directory (c:\home\abc\archive) of the sendor server. I want to delete all archive files (in c:\home\abc\archive in sendor directory) before message processing.

I try to input 'del c:\home\abc\archive\*.*' in 'Run OS command before message processing' . but failed.

Anyone can help ?

I try to write a DOS batch file for file deletion. but I don't want where the batch should
be put ? In sender server or PI server ?

3.  How to check the error log of such command ?

Accepted Solutions (0)

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>I try to write a DOS batch file for file deletion. but I don't want where the batch should

be put ? In sender server or PI server ?

just as mentioned by Imanuel this batch file needs to be places on the PI server

(and you need to include FTP logon procedure to remove the file from any ftp folders in this batch program)

>>>>3.  How to check the error log of such command ?

you can try my article:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/08/17/xi-operation-system-command--erro...

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hello.

As far as I know - the OS command will be run on the PI server.

Just put a batch file in one of the PI directories, make sure : SAPService<SID> can access it,

and write inside the remote server deletion.

you can also do error logging via the batch file.

P.S. who is putting the archive files in the remote server?if you are doing it via the PI - just change from archive mode to delete mode.

Otherwise - tell whoever is in charge of the archive process to just stop it.

Better stop an unnecessary thing then fix it later.

Good luck,

Imanuel Rahamim.