cancel
Showing results for 
Search instead for 
Did you mean: 

how to attach a file in webdynpro component

Former Member
0 Kudos

Hi all

i got a requirement that in webdynpro component i have to develop a functionality which is used to attach a file for example in our mail how we will attach file how we can achieve this functionality is there any ui elements are there or we have to write any code for this kindly help me how to proceed

thanks & regards

naveen

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hello Naveen,

if I understand your question correctly - you are interested in attaching a file into an email. You would like to know if there are any standard WDA utilities for doing this.

The answer is no. There are WDA UI elements that can help you retrieve a file - as many others here have posted. But to send an email is not really a WDA function.

I would suggest you do a search of SCN, as there are many references about how to send emails from ABAP - but these are not WDA specific, although you could use them in a WDA application.

Good luck in solving your problem.

Chris

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

u may upload a file from the desktop in ur webdynpro .. thn u can save it in database and can download accordingly..

1.create a node 'FILEUPLOAD' with 2 attributes

a) FILECONTENT type XSTRING

b) FILENAME type STRING

2. Create a fileuplaod uielement

a) bind the data property with attribute 'FILECONTENT'

b) bind the filename property with attribute 'FILENAME'

3. Create a button 'UPLOAD'

a) create the action method for this button and save the contents of file in database


Data l_node type ref to if_wd_context_node.
Data l_stru type wd_this->elements_cn_fileupload.
 
l_node = wd_context->get_child_node( 'FILEUPLOAD' ).
l_node->get_static_attributes( importing static_attributes = l_stru ).
"save l_stru-fielcontent in database. Your file will be saved in the database in XSTRING format.

Now when you want to display this file;

1. Create a Node 'FILEDOWNLOAD' with 1 attribute

a) FILE type XSTRING

2. Create a filedownload uielement

a) bind the data property with the attribute 'FILE'

Fetch the file from database and set the File attribute of the filedownload uielemnt to display the file.

regards,

Amit

Former Member
0 Kudos

after uploading the file when i am clicking on browse it is accepting the file now i want to display that data in a pdf file then by clicking on the button the attache file should go and saved in the adobe form can u help me how it is possible

ChrisPaine
Active Contributor
0 Kudos

Um - possibly you responded to the wrong thread?

Former Member
0 Kudos

Hi Naveen,

Where Do u want to File Data to be stored...???

Former Member
0 Kudos

Hi ,

Have a look at the fileUpload UI element.It allows you to select a file from the system and store the contents like file's data,file path,mime type etc in context nodes.

[FileUpload|http://help.sap.com/erp2005_ehp_04/helpdata/EN/b3/be7941601b1d09e10000000a155106/frameset.htm]

Thanks,

aditya.