cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Upload file path in webdynpro abap

Former Member
0 Kudos

Hi all, i am working image upload ui element  i am getting image in xstring format can i get the file path of uploaded image in web dynpro, if possible means kindly give solutions. Now iin file name attribute am getting the exact file name only not full path.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nandha,

Hope you are doing well!

Could you please check if the solution works. If no, please inform and if yes, close the thread by marking the right answer.

Regards

Mohit

Former Member
0 Kudos

Hi, Please try below-

Get reference of the UI element, let us say your UI element name is 'ABC' then in the view method you may write below code-

DATA: lr_image TYPE REF TO CL_WD_IMAGE. "Ref of the UI element

lr_image ?= wd_this->get_element( ID = 'ABC'). "Get the specific view UI element (image in ur case)

* Get Path

DATA: lv_path TYPE string.

lv_path = lr_image->get_source( ).

I hope lv_path contains fully classified file name (name and path).

Please let me know of the feedback.

Thanks

Mohit

Former Member
0 Kudos

Dear Mohit Thanks or reply,

When using the above code its showing the error for the code


lr_image ?= wd_this->get_element( ID = 'ABC')

Method "GET_ELEMENT" is unknown or PROTECTED or PRIVATE.

Former Member
0 Kudos

Please separate the logic in 2 lines-

DATA(lr_viewref) ?= wd_this->wd_get_api( ).

lr_image ?= lr_viewref->get_element( ID = 'ABC').

I hope this help.

Thanks

Mohit