cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use webdynpro.uielementdefinitons.Resource to pass it to RFCs ?

Former Member
0 Kudos

Hi there,

I saw a document about document upload on Java server

[Uploading in WD Java|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71]

But i am wondering if we can use the same webdynpro.uielementdefinitons.Resource type directly to RFC or we need to so some conversion of this data before we can pass. and what will be relevant ABAP data type of the parameter.

Rgds,

Sudhir

Accepted Solutions (1)

Accepted Solutions (1)

former_member720137
Active Participant
0 Kudos

Hi Sudhir

The document u r referring can also be used to upload a file in R/3. You need to create a Binary import parameter in R/3 to store the bytes of the file.

In Web Dynpro u need to bind this Resource Context to the FileUploadUI Element . Then referring to the above document you can access the binary content from this ResourceType and set the Import parameter in R/3.

Hope u understand in case u need any help regarding code and all, ask here only.

Regards

Puneet

Former Member
0 Kudos

Thanks a lot Puneet for your reply.

Actually we are not storing this data, intend import file is a xml which will be parsed and then it will be passed in a internal table for some comparison. So all i need from WebDynpro side is to pass the file to RFC which will parse and use the file.

I got two questions on this:

1) What would be RFC parameter type for capturing this binary data, i am unable to get a Binary data type?? which one is suggested

2) As i understand we can convert resource into binary data .. can you suggest me sample code which i can use here.

Thanks a lot for your help.

Rgds,

former_member720137
Active Participant
0 Kudos

Hi Sudhir

1. As far as i know u can use XSTRING data type in R3 for storing Binary Content of a File.

2. Go to Page 10 of that document..

e.g:

//FileResource is a context of type Resource and binded to FileUploadUI element.

IPrivateUploadView.IContextElement element =wdContext.currentContextElement();

//if a file in the FileUpload field exists

if (element.getFileResource() != null)

{

Set file name and type in R3 in case u want to save them also..

}

// Now set the resource in import parameter of RFC

input.setBinary_Content(wdContext.currentContextElement().getFileResource());

//execute the BAPI

RFC_Input input = new RFC_Input();

I hope it will solve ur problem.

Regards

Puneet

Answers (0)