Skip to Content
avatar image
Former Member

uploading and displaying image

Hi Experts,

I am very new to web dynpro ABAP. I am trying to learn how to upload image and display that image in the same page.

I searched in SDN threads, and find this steps to upload and displaying in a web page.


You can use fileUpload and file download Uielements

Follow these steps:

1. Create a node 'FILEUPLOAD' with 2 attributes



2. create a node 'FILEDOWNLOAD' with 1 attribute


3. Goto the layout tab

a) Place a fileupload uielement and a button next to it for uploading the image

b) Bind the Data property with the attribute 'FILECONTENT' and filename property with the attribute 'FILENAME'

c) Place a filedownload uielement on the layout

d) Bind the data property of thr filedownload uielement with the attribute 'DOWNLOAD'

4.Create create an action for the button, the Event 'onAction'.

5. In this method write the following code to read the content and set the download attribute

data: l_node type ref to if_wd_context_node.

data: l_content type xstring.

l_node = wd_context->get_child_node( ' FILEUPLOAD' ).

l_node->get_attribute( exporting name = 'FILECONTENT'

importing value = l_content ). " l_content will be your image in xstring format

data: l_node1 type ref to if_wd_context_node.

l_node1->wd_context->get_child_node( ' FILEDOWNLOAD' ).

l_node1->set_attribute( exporting name = 'DOWNLOAD'

value = l_content ) . " retrieved frm above


I followed above steps , But am getting empty page while deploying.

I didn't import image into MIME objects.

Can anyone Help me.

Thanks in Advance!



Edited by: sreelakshmi.B on Jul 1, 2009 4:34 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 01, 2009 at 11:14 AM

    Hi Sreelakshmi,

    you dont need to import image in MIME repository.

    Jusk check if the data property of both the fileupload and filedownload uielement are bound with attribute of type XSTRING and also chexk if you have implemented the Action method for the button.

    Check my replies in this [Regarding file upload;


    Add comment
    10|10000 characters needed characters exceeded