/admin

File Upload And In Webdynpro Abap

File Upload And In Webdynpro Abap Rating: 5,0/5 1568 votes

FileUpload

You can use the FileUpload UI element to upload files from the client to the server.The UI element appears with an input field in which the directory path and the file name appear and a button for searching for the file.

Note that you must always specify the fully qualified path with a FileUpload UI element.As a result, you cannot specify any URLs (see http://support.microsoft.com/kb/892442/en-us).

Technical Browser Details Beyond the Control of WDA

To Upload a PDF using ABAP Program, you need to get the location of the file and the pdf file. You need to convert this file in XSTRING. In the code shown below, we have used GUIUPLOAD Function module to get data in an Internal Table. Program to Upload PDF in ABAP. Parameters: pfile type string lower case. Data: gsstorefile type z1127582.

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.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 the 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 via the Browse… button.If the path name is incorrect, the browser will not even forward the request.

Procedure

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 round trip necessary, which may irritate the user.

Check with every action whether data has been downloaded by reading the data from the context.

Then 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.

Note also Security Notes for FileUpload UI Elements.

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.

Details

To enable the development of accessible applications the label property 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 tooltip property is checked.

Example (with Label):

Runtime Class

CL_WD_FILE_UPLOAD

Properties in View Designer

Name

Type

Initial Value

Bindable

ID

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 associated higher-level classes.The associated UI elements are:

UIElement

ContextMenuProvider

ViewElement

Dynamic Programming

For dynamic programming, the same properties, events and aggregations as in the View Designer are available.Bear in mind the different spellings.

Dynamic Programming of Properties

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

textDirectioninherit

CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-INHERITAdobe premiere pro cs6 sequence presets free download.

textDirectionltr

CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-LTR

textDirectionrtl

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

Example

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 View FileUpload.