cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - pick 2 files with a time difference

Former Member
0 Kudos

Hi Guys,

I have a requirement that i need to pick 2 files with different names from the same directory but with a time difference.

I need to process file1 first and after 30 min i need to pick file2 and send it to SAP as IDOCs.

I need to process these 2 IDOC's in SAP with a time difference. any suggestions would be appreciated.

Thanks,

Reddy

Edited by: PIReddy on Feb 25, 2011 7:54 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you are trying to process two different IDOCs in R/3 then best option is to schedule a job to process one kind of idoc first and on completion of first job second job should run. Take help from any ABAPer to do this, It will not take more than 30 min to do it in R3.

The advantage of above mentioned approach is that you can process n number of files in PI at any time and R/3 will take care of processing of idocs in correct order via scheduled jobs.

There is major disadvantages if put some kind of sleep time/ delay in mapping because then this means you are holding the resources for 30 mins. This will definitely cause a performance issue for other interfaces. So putting such a long delay in mapping is not recommended.

Secondly if you use BPM then again what is the guarantee that the first IDOC will be posted successfully. I mean Since processing of second IDOC is dependent of first IDOC then the above approach of scheduling the job should be the best approach for this scenario.

Just don't think from PI prospective.. think from whole scenario prospective.

Answers (3)

Answers (3)

former_member200339
Participant
0 Kudos

PIReddy,

If the two files need to be picked up only at a specified time of the day with a time difference of 30 min i.e. 18:00 Hour and 18:30 Hour, then you can schedule the two channels under Availabilily. It is available in the path RWB -> Component Monitoring -> Communication Channel

Otherwise, you can write a OS based program or a Java (Quartz) API based program so that the two files will be moved from some other directory to the working directory with an interval of 30 mins.

regards,

Rana

Former Member
0 Kudos

Hi Reddy,

File adapter will pick all the files when the polled. So, I think you can write a UDF to make communication channel sleep for the some time using the below UDF

{ try
   {           Thread.sleep (1800);
    }
catch (InterruptedException ie){}
return a;
}

Thanks,

Former Member
0 Kudos

You may design a BPM to receive these two files and proceed only after both are avialable

The file adapter will pick a file as soon as it is avialable

Hence your requirement of 30 minutes wait time needs to be relooked at:

1. Does it mean that source is writing second file in parts at the specified directory? If yes, ask source to initially write file with different name and rename it after the second file is completely written

2. If not then why is it required to wait for 30 minutes?

rgds

gab