cancel
Showing results for 
Search instead for 
Did you mean: 

File to file bypass scenario

Former Member
0 Kudos


Hi PIExperts,

we need pick the file from source folder with particular format filename .

filename is for example: BC01100000000032014_FC.xml

BC01-->companycode

1 --> is the environment code

0000000003-->the next 10 digits are the SAP document number

and 2014--> the next 4.. are the fiscal year

_FC: are 2 digits and depends of the document type .

apart from this format PI will not suppose to pick the file .

Thanks,

Aadi

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Have you tried to place the below regular expression in the file name field of the channel?

^[A-Za-z0-9]{4}[0-9]{1}[A-Za-z0-9]{10}[0-9]{4}_[0-9]{2}.xml$

Here,

[A-Za-z0-9]{4}   : means 4 characters of company code..It can have characters A-Z or a-z or 0-9

[0-9]{1}    :  means 1 character environment code... Only 0-9 is allowed

[A-Za-z0-9]{10}  : means 10 characters SAP document number. (Allowing A-Z or a-Z as because SAP document can have characters...

[0-9]{4}  : means 4 characters year . Only 0-9 is allowed

_[0-9]{2}: means  2 characters document type. I made this as number... If want to make _FC as only characters then [A-Za-z]{2}...

So final would be:

^[A-Za-z0-9]{4}[0-9]{1}[0-9]{10}[0-9]{4}_[A-Za-z]{2}.xml$

Former Member
0 Kudos

Hi Neelima,

I am using SFTP adapter .

Thanks,

Aadi

Former Member
0 Kudos

Which adapter you are using? FTP or SFTP?

Which are unique things in your file name those won't change forever and differ from other files? like company code or document time..

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

Hi,

As Javier said, you can use file name mask for deciding which file to be picked. This file name mask is usual regular expression. You can find the sample from below thread.

Sample regular expression syntax can be found on the below link:

Java - Regular Expressions

You might need regular expression like below:  

^([A-Za-z0-9]{4})([0-9]{1})([A-Za-z0-9]{10})([0-9]{4})_([0-9]{2}).xml$

or

^[A-Za-z0-9]{4}[0-9]{1}[A-Za-z0-9]{10}[0-9]{4}_[0-9]{2}.xml$

javier_alcubilla
Contributor
0 Kudos

Hi

If i understand well, you want to define masks to get the file?

https://help.sap.com/saphelp_nw73/helpdata/en/44/556e3899c93677e10000000a114a6b/content.htm

Or do you want to take that information from the filename and use it in the mapping?

In this case you can use ASMA & DynamicConfiguration (within a UDF)

Regards

Javi