cancel
Showing results for 
Search instead for 
Did you mean: 

upload images and store it in database

Former Member
0 Kudos

Hi friends,

Please give your suggessions or steps , regarding how images (bmp/jpeg .....) can be uploaded and stored in database as string or rawstring on a button click in webdynpro abap.

regards ,

radhika

Accepted Solutions (0)

Answers (2)

Answers (2)

uday_gubbala2
Active Contributor
0 Kudos

Hi Radhika,

Try going through Thomas Jung's replies in this [thread|;.

Regards,

Uday

Former Member
0 Kudos

You can use fileUpload Uielement to upload the image and store it as an Xstring.

Follow these steps:

1. Create a node 'FileUpload' with 2 attributes

a) filecontent type Xstring

b) filename type String

2. Goto the layout tab and place a fileupload uielement.

3. Bind the Data property with the attribute 'filecontent' and filename property with the attribute 'filename'

4. Place a button the view and create create an action for the Event 'onAction'.

5. In this method write the following code to read the content


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

Check standard component WDR_TEST_EVENTS ( File Upload View ) .

Check this link too

[http://help.sap.com/saphelp_nw70/helpdata/EN/b3/be7941601b1d09e10000000a155106/content.htm]

Regards,

Radhika.

Edited by: Radhika Vadher on May 19, 2009 12:11 PM