FileUpload 
You can use the FileUpload UI element to upload files from the client to the server. The UI element appears with an InputField, in which the directory path and the file name appear, and a Buttonfor searching for the file.
Caution
Note that you must always specify the FileUpload fully qualified path with a FileUpload UI element. Therefore, you cannot specify any URLs.
More information: http://support.microsoft.com/kb/892442/en-us
|
Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore impossible to enter the file name in the entry field. The field always remains empty. Neither are any possible restrictions displayed, for example, file names or file name extensions. The selection of the file name is therefore only possible in new browser versions using the Browse... button. You cannot enter the file name manually (using the keyboard or copy and paste functions) or by setting the file name from the back end (directly or using context binding).
For more details, read the security-related information in Internet Explorer 6 about handling <input type=file>.
For security reasons, the browser only accepts absolute paths or a path selection using the Browse…. switch. If the path name is incorrect, the browser will not even forward the request.
There is no action available to identify a FileUpload. Generally we recommend you use a dedicated screen or popup for the upload, since an upload is triggered by every user interaction requiring a roundtrip, for example scrolling through a table. This makes a roundtrip necessary, which may irritate the user.
Check with every action whether data has been downloaded by reading the data from the context.
The delete the data immediately from the context. Otherwise the file would be kept in the memory until the context is created or a new upload is triggered.
When copying from XSTRING to XSTRING no copy of the data is made due to ABAP string sharing. A copy is not created until the data is modified in one of the XSTRINGs.
Runtime Class |
CL_WD_FILE_UPLOAD |
Name |
Type |
Initial Value |
Bindable |
|---|---|---|---|
STRING |
(automatic) |
No |
|
WDY_BOOLEAN |
false |
No |
|
WDUI_CONTEXT_MENU_BEHAVIOUR |
inherit |
No |
|
WDY_MD_UI_ELEMENT_REFERENCE |
No |
||
XSTRING |
Yes |
||
WDY_BOOLEAN |
true |
Yes |
|
Translatable text |
No |
||
STRING |
Yes |
||
STRING |
Yes |
||
WDUI_STATE |
normal |
Yes |
|
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
Translatable text |
Yes |
||
WDUI_VISIBILITY |
visible |
Yes |
|
STRING |
Yes |
Other properties that can be inherited are defined in the related higher-level classes. The related UI elements are:
To enable the development of accessible applications the property label is checked during the syntax check.
If no label has been set, and no descriptive text has been specified for the appropriate bound context element in the ABAP Dictionary, the property tooltip is checked.
For dynamic programming, the same properties, events and aggregations are available as in the View Designer. But note that the spelling format and use of upper/lower case is different.
View Designer Name |
Runtime Name |
Type |
|---|---|---|
ACTIVATE_ACCESS_KEY |
WDY_BOOLEAN |
|
CONTEXT_MENU_BEHAVIOUR |
WDUI_CONTEXT_MENU_BEHAVIOUR |
|
contextMenuBehaviour: inherit |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT |
|
contextMenuBehaviour: provide |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE |
|
contextMenuBehaviour: suppress |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS |
|
CONTEXT_MENU_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
DATA |
XSTRING |
|
ENABLED |
WDY_BOOLEAN |
|
EXPLANATION |
WDY_MD_TRANSLATABLE_TEXT |
|
FILE_NAME |
STRING |
|
MIME_TYPE |
STRING |
|
STATE |
WDUI_STATE |
|
state: normal |
CL_WD_FILE_UPLOAD=>E_STATE-NORMAL |
|
state: required |
CL_WD_FILE_UPLOAD=>E_STATE-REQUIRED |
|
TEXT_DIRECTION |
WDUI_TEXT_DIRECTION |
|
textDirection: inherit |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-INHERIT |
|
textDirection: ltr |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-LTR |
|
textDirection: rtl |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-RTL |
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
VISIBLE |
WDUI_VISIBILITY |
|
visible: none |
CL_WD_FILE_UPLOAD=>E_VISIBLE-NONE |
|
visible: visible |
CL_WD_FILE_UPLOAD=>E_VISIBLE-VISIBLE |
|
WIDTH |
STRING |
|
For test purposes you can find examples of this interface element in the system in the Web Dynpro application WDR_TEST_UI_ELEMENTS, and in the component WDR_TEST_EVENTS in the FileUpload view.