cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload UI "file Name property"

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (2)

Answers (2)

Former Member
0 Kudos

I get the solution by the above mentioned code.

Former Member
0 Kudos

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.