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?
Check FM '/SAPDMC/LSM_F4_FRONTEND_FILE' and F4_dxfilename_toprecursion
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
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.
steve,
Use the fm TRINT_SPLIT_FILE_AND_PATH........ it will work.
Hello Steve
I have found the fm DSVAS_DOC_FILENAME_SPLIT also very useful.
Regards
Uwe
Hi Guys,
you can also use FM 'SO_SPLIT_FILE_AND_PATH' and it works.
Cheers
Elmer