cancel
Showing results for 
Search instead for 
Did you mean: 

Storing and retrieving Attachments

Former Member
0 Kudos

Hello,

I have a Webdynpro Java Application in which I want to allow the users to store and retrieve attachments for a form they fill and submit on Portal using Guided Procedures. The attachments need to be stored for each form separately and retrieved accordingly using some mechanism. If anyone has implemented this, please let me know.

Any help would be highly appreciated.

Regards,

Shikhil

Accepted Solutions (0)

Answers (3)

Answers (3)

Abhinav_Sharma
Contributor
0 Kudos

Hi Shikhil

We have done the same thing. However, we stored the documents in backend system i.e. R/3 box. There is a RFC available to save the attachment in Business Document recpository. You can see the attachment using transaction OAOR.

You need to do following steps:

1) You need to upload the document temporarily in context of type Resource.

2) When you are submitting the FORM, call BAPI - BDS_BUSINESSDOCUMENT_CREA_TAB and pass the resource in bytes. This will save the attachment on R/3 system. You need to mention the ClassName, classtype and Object Key to retreive the document.

3) To retreive the attachments call - Bds_Document_Get_Table.

Hope it helps.

Abhinav

Former Member
0 Kudos

Abhinav,

Thanks for the reply. I can follow your steps but can you please tell me why you chose R/3 to store the Attachments rather than Portal Knowledge Management (KM).

Regards,

Shikhil

Former Member
0 Kudos

Abhinav,

I followed your reply. I created a FileUpload UI Element. Binded the resource property of the element to a Context Element of type Resource. Created a button and wrote the following code in the onAction() method of the button:

IPrivate<ViewName>View.IContextElement element = wdContext.currentContextElement();

if(element.getResource()!=null)

{

IWDResource resource = element.getResource();

try

{

InputStream input = resource.read(false);

byte[] b = new byte[5000];

input.read(b);

wdContext.currentBds_Businessdocument_Crea_Tab_InputElement().set<Parameter> }

catch(IOException io)

{

io.printStackTrace();

}

So I need to know the Input Parameter which needs to be set in the Model.

Please help.

Regards,

Shikhil

Former Member
0 Kudos

Anybody...Please help.

Thanks

Former Member
0 Kudos

Anybody ..Please help.

Thanks.