cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering XI interface based on a trigger file

Former Member
0 Kudos

I have a requirement in such a way that many files are placed in an FTP Server. Once all the files are written completely, a trigger file is placed which intimates that the files are ready to be processed. As this is not scheduled on a daily basis, XI Interface has to be triggered based on the trigger file. Can you please suggest some of the ways to achieve this?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member202642
Participant
0 Kudos

Hi Jerene,

The trigger file is a simple (sometimes even empty) file that indicates that the original file is written completely and can be processed further. Usually it has an identical file name as the original file, except for the extension.

Working with trigger files is quite simple. just follow below steps;

1. Define an additional file in File List parameter, let us call it "TriggerFile".

2. Specify the part of your file name that needs to be replaced to get the name of the trigger  file as the value of TriggerFile.namePart parameter. For instance, assuming your original file's extension is .csv and trigger file's extension is .trg, use the value ".csv"=".trg". Both files must be placed in the same directory and have their names almost identical (except for the part you define here).

3. Set the TriggerFile.optional parameter value to NO. Your message will not be processed if the trigger file does not exist.

Have a look at the image below:

Former Member
0 Kudos

Set the TriggerFile.optional parameter value to NO. Your message will not be processed if the trigger file does not exist.

That's true, but I recognized that for each run without the trigger file a log entry for the communication channel and within the NetWeaver Log is created.

Error: java.lang.Exception: Add attachment: Mandatory additional payload file xxxx

And it looks as there is no possibility to prevent that as if you set the optional paramter to yes there is no log entry but the data file can be processed without trigger file.

former_member184681
Active Contributor
0 Kudos

Hi,

One additional question: do you need to maintain some reference between those files, or process them together? If not, then you can simply ignore the trigger file and check for each particular file if it has already been created completely, with the standard sender file adapter feature "Msecs to Wait Before Modification Check". See more details in Question #2 here: http://wiki.sdn.sap.com/wiki/display/XI/Sender+File+Adapter+Frequently+Asked+Questions

If you still want to work with trigger file, you can even go a step further, comparing to what Baskar Gopalakrishnan suggested. Create the "main" interface to process the interface files. Additionally, create additional file to SOAP scenario, that will call the interface that starts/stops the sender CC of the main interface, based on the trigger file as the interface source.

Hope this helps,

Greg

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You might trigger XI interface by externally controlling the polling sender file communication channel. Once required files are processed, you can trigger the channel externally. By doing this way you don't need place trigger file. This is one possible solution.

http://help.sap.com/saphelp_nwpi71/helpdata/en/45/0c86aab4d14dece10000000a11466f/content.htm

some of the possible solutions are

1.Create a script to control the channel for starting and stopping the channel. Refer this link....

http://scn.sap.com/people/william.li/blog/2007/05/04/control-communication-channels-externally-witho...

2.Use abap program to control the communication channel.

http://scn.sap.com/people/katlegojackmohlankana.maja/blog/2011/05/24/startstop-a-communication-chann...

3. Thanks to Santosh. Nice feature. Controlling communication channels using Webservice

http://scn.sap.com/people/santhosh.kumarv/blog/2012/03/01/sap-pi-startstop-communication-channel-usi...