Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EPS2_GET_DIRECTORY_LISTING using FILE_MASK parameter

krishna_maram
Participant
0 Likes
9,991

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.

2 REPLIES 2
Read only

Former Member
0 Likes
4,363

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

Read only

felipe_ssj
Explorer
0 Likes
4,363

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.