cancel
Showing results for 
Search instead for 
Did you mean: 

Why file path is disappearing? is it a SAP bug?

former_member194142
Participant
0 Kudos

Hello

In MAIN view, i put a input field, FileUpload UI element and a button (its caption is 'Click this button to upload the file'), well.

I have some validations on the input field (say, user suppose to enter only 'TEST' word/value), if user didn't enter TEST then am throwing an error message by using CALL METHOD lo_message_manager->report_t100_message, well.

Say user picked my_File from the desktop by clicking the BROWSE button of the FileUpload UI element, user  entered XXXX in input field and clicked the uploading meant button, then obviosuly my WDA is throwing the error message on the view, well, but now, if you see at this point the File Path/File Name is disappearing (for visibility its disappearing, but still binding to the context's attribute behind the screens) hence user is in confusion that which fiel he/she browsed!! (where as XXXX is stay remained on the input field). Pls. let me know

1) Why the file name / file path is disappearing in the slot of the File Upload UI element?

2) How can i fix this? In my scenario, i can't use Enable/Disable, Visible/Hide properties of this UI element. I tried by populating the context's attribute explicitly by using SET_ATTRIBUTE method, no use, i also tried

DATA: lr_wd_file_upload TYPE REF TO cl_wd_file_upload,

           lv_my_string_of_file_name TYPE string.

         lr_wd_file_upload ?= wd_this->my_main_view->get_element( 'UPLOAD_MY_FILE' ).

         lv_my_string_of_file_name = lr_wd_file_upload->get_file_name( ).

         lr_wd_file_upload->set_file_name( lv_my_string_of_file_name ).

but, no success!!

Pls. let me know how to stay remain the file name for visibilty

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, 

This is not a bug, this is the way the file upload UI element works. Try adding a text view UI element next to the File Upload UI element and in the method do before action read the file name binded to the file upload ui element and bind it to the text view UI element.

Best Regards,

Arun Krishnamoorthy

former_member194142
Participant
0 Kudos

Thank you, agreed. But, in my point of view, its a  loophole/bug from SAP, why user has to loose the picked file name/path? yes,  i agree/appreciate your answer/text view placing

But, let me chk any work around from other experts...

Any help pls?

former_member194142
Participant
0 Kudos

Any workaroud from any experts?

Thank you

Answers (0)