Skip to Content

OPEN DATASET command fails because filepath is in UPPERCASE

When user selects a filename from the SAP server the filename returned is for example 'USR/SAP/INTERFACES/FILE001.TXT'.

When I perform OPEN DATASET for this fiel I get a subrc 8 that the file or filepath does not exist.

If I manually enter 'usr/sap/INTERFACES/FILE001.TXT' i.e. with the correct lower and upper case values then the OPEN DATASET works.

Obviously at runtime I have no idea which filepath the user will select so I cannot hardcode the file path in lower case?

All help greatly appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jun 05, 2019 at 08:28 AM

    The question is how / where is the user selecting file/path?

    Does your input field support lower case input?

    Is there a chance you can do selection via the F4?

    Also you can do a check if file exist right after user input (program execution) and return message to user.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 05, 2019 at 09:36 AM

    Thank you both for yor answers! In the end I solved by adding LOWER CASE i.e.:

    parameters: p_path LIKE gs_sfile LOWER CASE.

    Add a comment
    10|10000 characters needed characters exceeded