cancel
Showing results for 
Search instead for 
Did you mean: 

Parse method is not possible for this type Exception in web dynpro

Former Member
0 Kudos

I have a file upload component and one button in a view.

I have created a binary type context element and mapped it with fileupload component.while clicking the submit button I am getting " Parse method is not possible for this type" exception.

help me out.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Sridhar,

U must add

IWDAttributeInfo file=wdContext.nodeUpolad().getNodeInfo().getAttribute(IPrivateHomeView.IContextElement.<UploadVariable>);

IWDModifiableBinaryType b=(IWDModifiableBinaryType)file.getModifiableSimpleType();

in the wdDoinit()

Regards

Fahad Hamsa

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I am trying to upload a file to km using webdynpro java. I am using sap netweaver 04. i have a FileUpload ui and a upload button. Context i created an attribute of type "binary". I got an error at runtime

" Parse method is not possible for this type". How did you resolve this error. I cannot find "Resource". You have some blog or code for this.

Could you please help me out in solving this issue?

Regards,

Divya

Former Member
0 Kudos

Hi sridhar,

Use this code for Upload

context u create one attribute(up),u assign the data type as "Resource"(which is dictionary type)

InputStream text = null;

int temp = 0;

try

{

File file = new File(wdContext.currentContextElement().getUp().getResourceName());

FileOutputStream op = new FileOutputStream(file);

if(wdContext.currentContextElement().getUp()!=null)

{

text = wdContext.currentContextElement().getUp().read(false);

while((temp=text.read())!=-1)

{

op.write(temp);

}

}

op.flush();

op.close();

}

catch(Exception e)

{

e.printStackTrace();

}

Former Member
0 Kudos

Hi,

Please use <a href="/people/community.user/blog/2006/10/18/how-to-parse-xml-file-uploaded-from-client blog for a way to use the FileUpload UI element. Don't use the binary types.

Regards,

Satyajit.

former_member720137
Active Participant
0 Kudos

Hi

U have to create two contexts, one of type binary and bind it to data property of FileUpload UI element and other of type type com.sap.ide.webdynpro.uielementdefinitions.Resource and bind it to Resource property of FileUpload UI.. now paste the code of ur action here..

Read this

/people/bertram.ganz/blog/2007/05/25/new-web-dynpro-java-tutorials--uploading-and-downloading-files-in-sap-netweaver-70

Regards

Puneet

Former Member
0 Kudos

i could not found the Resource in com.sap.ide.webdynpro.uielementdefinitions.

Former Member
0 Kudos

i could not found the resource in com.sap.ide.webdynpro.uielementdefinitions.resource

Former Member
0 Kudos

Hai Sridhar,

Resource is avaialable in nw04s.

Regards,

Naga