Skip to Content
avatar image
Former Member

How to provide file path while using file_copy/file_move function in SAP DS 4.2 ?

I am trying to use file_copy and file_move functions which are available in SAP DS 4.2. While file_exists function works well with the file path provided, the file_copy and file_move functions throw error saying no such directory exists.

Please assist.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 12, 2017 at 11:27 AM

    Newer versions of SAP BODS have file_copy , file_move functions which can be really painful to use. If you use a path like this ( c:\Program Files\Some Folder\YetMore Folder), these functions will not work. However, if you use a path like this ( c:/Program Files/Some Folder/YetMore Folder), functions will work.

    Make use of replace_substr function to make it work -
    file_copy(replace_substr($G_Quarantine_File ,'\\','/'), replace_substr ( $G_Failed_Dir,'\\','/' ), 1);

    Add comment
    10|10000 characters needed characters exceeded