07-31-2008 4:38 PM
Searching this forum I found a couple of FM's that apparently only worked for PC files. Is there a parser function for files w/ the Unix naming convention?
08-02-2008 10:20 PM
Hello Steve
I have found the fm DSVAS_DOC_FILENAME_SPLIT also very useful.
Regards
Uwe
07-31-2008 4:46 PM
Check FM '/SAPDMC/LSM_F4_FRONTEND_FILE' and F4_dxfilename_toprecursion
07-31-2008 4:47 PM
You could parse it yourself...
DATA: filepath TYPE char255 VALUE '/usr/<sys_id>/sap/tmp/filename.txt'.
DATA: path TYPE char255.
DATA: file TYPE char255.
DEFINE macro_reverse_string.
call function 'STRING_REVERSE'
exporting
string = &1
lang = sy-langu
importing
rstring = &1.
END-OF-DEFINITION.
macro_reverse_string filepath.
SPLIT filepath AT '/' INTO file path.
macro_reverse_string filepath.
macro_reverse_string file.
shift path right by 1 places. path(1) = '/'.
macro_reverse_string path.
WRITE:/ filepath.
WRITE:/ path.
WRITE:/ file.
Regards,
Rich Heilman
07-31-2008 5:08 PM
yet another approach:
DATA: filepath TYPE char255 VALUE '/usr/<sys_id>/sap/tmp/filename.txt'.
DATA: path TYPE char255.
DATA: file TYPE char255.
DATA: dummy TYPE string.
CHECK filepath CA '/'.
dummy = filepath.
DO.
SHIFT dummy RIGHT CIRCULAR.
IF dummy(1) = '/'.
SHIFT dummy LEFT CIRCULAR.
SPLIT dummy AT '/' INTO file path.
CONCATENATE '/' path INTO path.
EXIT.
ENDIF.
ENDDO.
WRITE:/ filepath.
WRITE:/ path.
WRITE:/ file.
07-31-2008 5:30 PM
08-02-2008 10:20 PM
Hello Steve
I have found the fm DSVAS_DOC_FILENAME_SPLIT also very useful.
Regards
Uwe
01-15-2010 8:15 AM
Hi Guys,
you can also use FM 'SO_SPLIT_FILE_AND_PATH' and it works.
Cheers
Elmer
08-02-2013 5:34 PM
Don't use FM 'SO_SPLIT_FILE_AND_PATH'... it seems to be not working correctly!