cancel
Showing results for 
Search instead for 
Did you mean: 

FileName Pattern for the sender channel

0 Kudos

Hello All,

We have a File to Proxy Scenario. The Expected File name Pattern is <ABC>_<DDMMYYYY>.txt.
Can we provide specific Date Pattern in the File Name instead of * ? The Placeholder * can consist of anything and hence the file in any case will be picked up by the channel.
This means ABC_DEF.txt or <ABC>_H01012010 will also be picked. 
The Requirement is to fail the scenario in the channel itself and trigger a standard alert instead of handling in Integration engine by other possible ways.
Please suggest.

Thanks,
Piyusha


Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

currently, I dont think the file adapter is flexible enough to recognize patterns. So the only place-holder you can use is *

Answers (3)

Answers (3)

0 Kudos

Thanks All.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Standard file adapter wont support this functionality,if you want to achive this requirement you have two options

1)Check condition in PI mapping level and read sender file name using dynamic configurtaion then compare name with your standard based on the result you can trigger email/send same file to FTP once again(if you want).

2)Using OS command srcipts can be achieve(not sure about stability).

Best Regards,

Raj

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Can we provide specific Date Pattern in the File Name instead of * ?

Yes. It is possible. One possible approach is use UDF and create filename with the desired timestamp and write the filename using dynamic configuration.

Sample code for dynamic configuration.

import java.text.*;

import java.util.*;

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

  Format formatter;

  Date date = new Date();

  formatter = new SimpleDateFormat('ddMMyyyy");

String fileName = formatter.format(date);

  conf.put(key, "ABC_"+fileName);

You might also want to glance this sample link for further help

http://www.roseindia.net/java/javadate/date-format.shtml

0 Kudos

Hi Bhaskar,

The requirement is the File should not picked up at all if it does not follow the pattern. Instead of * can we put any other placeholder or Date Pattern instead of getting into Integration engine?

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Yes you can put placeholder. In addition , You might also want to check exclusion list option in the file channel configuration and configure based on that to avoid the wild char pattern issues. Refer sap help link for the file channel. Please refer below

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/44/556e3899c93677e10000000a114a6b/content.htm