cancel
Showing results for 
Search instead for 
Did you mean: 

How to count the number of files read through sender file adapter

Former Member
0 Kudos

Hi ,

I have a scenario where I am reading files from a third party system and trying to send those files to R/3 system .The frequency is 1 file per day .But there can be situation where the source system can put 2 to 3 files in source folder and so XI sender adapter will pick up all the 3 files at time . And I want to send only 1 file at a time to r/3 .

Do you know any way to handle this requirement ?

Thanks ,

Suvarna

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Suvarna

What exactly do you mean by " <i>only 1 file at a time to r/3</i> " ?

Would you like to send 1 file per day ( even when the source BS sends multiple files ).

Else even if your sender file adapter picks 3 files from source directory, it will create 3 different payloads for each file.

- Lalit -

Former Member
0 Kudos

Hi Lalit ,

say if Xi picks up 3 files then I want to send the first file and the second file should be send after 15 mins and so on..

Thanks & regards,

suvarna

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

This can be handled very easliy.

In your sender File adapter, change the Quality of service as <b>"Exactly Once In order"</b> . Now, the files will be processed sequentially one after the other inside the same queue and you can attain what you want.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

Like Bhavesh pointed out, you could EOIO as the Quality of Servie in the sender file adapter.

But I guess this would solve your issue only to a certain extent.

Marking this QOS in the sender file adapter would only mean sequential processing of the files. That is, the second file will be sent only when the first file is successfully received by the end system.

It would not ensure that the files are sent only after 15 mins of the first file is sent.

If the 15 mins time period is important, then this needs to be achieved using a BPM which ensures that the messages are sent to the target only every 15 mins.

In case, the frequency of the incoming files is not known (in which case, the having a BPM would be a bad idea) you could use a ztable, which stores the filename and time the file was sent to the R/3.

You could query this table each time, before sending the file data to the R/3

Regards,

Smitha.

Message was edited by:

Smitha Rao

Former Member
0 Kudos

Hi ,

Thanks for your reply . I was wondering once Xi reads the files from input folder is there any way where Xi can count the number of files read from input folder and use that as counter and send one by one file to R/3 ?

Thanks & Regards,

Suvarna

Former Member
0 Kudos

Hi,

You can achieve it using BPM (http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm)

but conception with EOIO is much better.

regards,

wojciech

Former Member
0 Kudos

Hi,

I am not too sure, why you need a counter if all that you need to do, is to send messages to the target system, every 15 minutes.

In case a counter is mandatory for some reason in your design:

You could do this by using a TimeBasedCollect Pattern BPM.

Here, the files would be collected in the BPM for a specified time period.

Set the adapter specific identifiers check box in the sender file adapter.

After the collection is done, do the necessary transformation, and after that you could place a counter to count the number of unique file names that are present in the payload that has been collected.

This way you would get a count of the number of files that have been picked up by the adapter.

Regards,

Smitha.