Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
santhosh_kumarv
Active Contributor
0 Kudos

Adding to the following Blogs this would cater another use case of the OS command.


The specified item was not found.


Executing Unix shell script using Operating System Command in XI


The specified item was not found.



Until the time I answered this Need a clarification in File to File scenario... in the forum truly I only had a theoretical view of the OS command rather practicing it. A week later a mail from my colleague knocked my mailbox addressing a requirement to delete file and also to send mails using the Unix script.  This aspired me to try out the OS Command scenario and the outcome of it is this Blog.


 

The requirement in curtail edition is to delete the inbound file only after the outbound files is posted successfully. The requirment is very genuine and wonder why this cant be made as an inbuilt functionality.



The approach to this is as follows.


 

  1. Archieve the inbound file.

  2. Use the same file name both in case of sender and receiver.

  3. Execute the Unix Script to delete the archived files only after the successful execution.


 

Configuration Steps:



1. In the Sender file adapter set the Processing Mode as Archieve and specify the path. Also enable the Adapter-Specific Message Attributes.





2. In the Receiver file adapter give the exact path of the Unix script in the option Run Operating System Command After Message Processing. Pass the filename as a command line argument to the script using the parameter %f.





3. Use this Script to delete the Files from the Archive Directory.




You can even make an mail notification by adding the following Shell Script.



Output Mail:



This mail brought Grin in my face.

7 Comments
Labels in this area