2013 Dec 14 4:11 AM
Hi,
Can anyone tell how the FILE_MASK parameter should be passed to FM EPS2_GET_DIRECTORY_LISTING to get a subset of files/file ?
I have these files
1234_file_invoice_E20050.xml
1235_file_invoice_E20060.xml
1236_file_invoice_E20070.xml
For example lets say I want to read file ending with E20060.xml.
I tried passing *E20060.xml - > I get no hits.
I tried passing *E20060* - > I get all 3 files.
I tried passing 12*E20060* - > I get all 3 files.
I tried passing 12*E20060.xml -> I get no hits
Thanks
Krishna.
Hi,
Can anyone tell how the FILE_MASK parameter should be passed to FM EPS2_GET_DIRECTORY_LISTING to get a subset of files/file ?
I have these files
1234_file_invoice_E20050.xml
1235_file_invoice_E20060.xml
1236_file_invoice_E20070.xml
For example lets say I want to read file ending with E20060.xml.
I tried passing *E20060.xml - > I get no hits.
I tried passing *E20060* - > I get all 3 files.
I tried passing 12*E20060* - > I get all 3 files.
I tried passing 12*E20060.xml -> I get no hits
Thanks
Krishna.
2014 Jan 08 2:58 PM
Hi Krishna,
I had the same problem and I searched for documentation.
Finally, I saw that EPS2_GET_DIRECTORY_LISTING calls C_DIR_READ_START and the rules for the filemask are the same as in this function.
The * wildcard may only be used at the end of the search string.
In my case it was possible to use fixed positions, so the + wildcard was also a solution.
Please note that the maximum length of the filemask is 40 characters.
You will see this in OSS note 1860206 - C_DIR_READ_START , C_DIR_READ_NEXT
some lines of this note:
The FILE parameter of the call 'C_DIR_READ_START' is designed for filenames. Some characters in the parameter value have special meaning (syntactical characters). Among those are '+', '?' and '*'.
Each '+' match any printable simple character. It is not specified if it match also to other things.
Each '?' match any printable simple character. It is not specified if it match also to other things.
A '*' at the end match to any remaining legal string. It is not specified, what a '*' matches to, when it is not the last non-space character in the FILE parameter value.
It is not specified whether '<', '>', '[', ']', '{', '}', '(' or ')' have any special meaning.
regards,
Henri
2015 Aug 24 6:46 PM
Instead of using the FILE_MASK parameter of EPS2 function, you can filter the results using string logical operator CP (Contains Pattern), like this:
IF DIR_LIST-NAME CP 'teste*.txt'.
"consider this file
ENDIF.
This worked perfect for me.