Skip to Content
avatar image
Former Member

string operations

Hi,

On the selection screen if the user gives a file location, I have to separate the directory and the filename the problem is the location can change every time one time it can be C:\Documents and Settings\varunk\Desktop\main.bmp and other time it can be

C:\main.bmp so I have to separate both the directory and file name and pass it separetly.

Thanks and Regards,

V

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 17, 2008 at 07:50 AM

    Use this.

    SPLIT filename AT '/' INTO <c1>... <cn> INTO TABLE <itab>

    Also check this.

    [https://forums.sdn.sap.com/click.jspa?searchID=17587409&messageID=6346920]

    Rhea.

    Edited by: rhea on Oct 17, 2008 9:55 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 07:35 AM

    Hello,

    Can you explain me wht is the use of seperating the Directory u r uploading the file or downloading file.

    or Checking the path correct or not.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi as Rhea told split the path, the final record in the itab would be your filename. You can also validate whether the directory and file name you have obtained are correct or not you can use any method from CL_GUI_FRONTEND_SERVICES class.

  • avatar image
    Former Member
    Oct 17, 2008 at 07:39 AM

    Hi,

    try with this FM

    PC_SPLIT_COMPLETE_FILENAME

    Regards,

    Suresh

    Add comment
    10|10000 characters needed characters exceeded