Skip to Content
avatar image
Former Member

File to file bypass scenario


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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Oct 16, 2014 at 03:15 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2014 at 06:42 PM

    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$

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2014 at 07:08 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2014 at 05:23 AM

    Hi Neelima,

    I am using SFTP adapter .

    Thanks,

    Aadi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2014 at 08:18 AM

    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$

    Add comment
    10|10000 characters needed characters exceeded