Skip to Content
author's profile photo Former Member
Former Member

File Upload UI "file Name property"

Hello Experts,

I am facing one problem while using this file Upload UI element in Webdynpro ABAP.

When I am showing the error or information message I want to show the file name also at end of the message.

But the FILE NAME property reads the whole path of the file like " C:\Documents and Settings\Administrator\Desktop\test.pdf "

But I want only the file name " test.pdf " .

How I can achieve this please suggest.

Thanks

Pradeep

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2010 at 12:53 PM

    Check if you have this class cl_fitv_gos in your system.

    If so , use the method in this class to separte path and filename.

    • get file name

    CALL METHOD cl_fitv_gos=>split_path

    EXPORTING

    iv_path = lv_filefullname

    IMPORTING

    ev_filename = filename.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2010 at 12:58 PM

    Hi,

    Refer the code in above mentioned class to get filename :

    DATA:  wa_dummy TYPE str,
             lt_dummy TYPE STANDARD TABLE OF str.
      DATA:  lv_path TYPE string,
                  lv_cnt type I,
    ev_filename type string.
    
    ***** iv_path has the path *********
    * Change \ with /
      lv_path = iv_path.
      TRANSLATE lv_path USING '\/'.
    
    * Split the whole path at /
      SPLIT lv_path AT '/' INTO TABLE lt_dummy.
    
    * get the filename from the last line of table
      DESCRIBE TABLE lt_dummy LINES lv_cnt.
      READ TABLE lt_dummy INDEX lv_cnt INTO wa_dummy.
      ev_filename = wa_dummy.

    Finally ev_filename will have the name of File.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2010 at 04:55 PM

    I get the solution by the above mentioned code.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.