cancel
Showing results for 
Search instead for 
Did you mean: 

How to Save the file into R/3 Server Path

Former Member
0 Kudos

Hi Friends,

I have one Query on WDJ. Here I have two requirements.

I have done click on u201CExport Excelu201D Button that data was download into Excel file Now my requirement is click on Save Button that file will save into (/exchange/CED) this path of R/3 System.

CED -


>is R/3 System ID

Under System id we can save this file.

Here EP Server and R/3 Servers in Diff Systems.

I was write codeing

InputStream text = null;

int temp = 0;

try

{

File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());

// String File = "abc.xls";

// String file = "anat" + ".xls";

wdComponentAPI.getMessageManager().reportSuccess("File::"+file);

FileOutputStream op = new FileOutputStream(file);

// FileOutputStream op = new FileOutputStream("D://usr//sap//BPE//"+file);

// FileOutputStream op = new FileOutputStream("D://KumarDev-BackUp//"+file);

wdComponentAPI.getMessageManager().reportSuccess("op::"+op);

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

{

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

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

{

op.write(temp);

}

}

op.flush();

op.close();

// path = file.getAbsolutePath();

path = "/exchange/CED/"+file;

wdComponentAPI.getMessageManager().reportSuccess("path:"+path);

}

catch(Exception ex)

{

wdComponentAPI.getMessageManager().reportSuccess("ex.printStackTrace()");

My Req is that file will saved in this path (path = "/exchange/CED/"+file; )

Regards

Vijay Kalluri

Edited by: KalluriVijay on Apr 20, 2010 11:01 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

Former Member
0 Kudos

Hi Friends,

I have one Query on WDJ. Here I have two requirements.

I have done click on u201CExport Excelu201D Button that data was download into Excel file Now my requirement is click on Save Button that file will save into (/exchange/CED) this path of R/3 System.

CED -


>is R/3 System ID

Under System id we can save this file.

Here EP Server and R/3 Servers in Diff Systems.

I was write codeing

InputStream text = null;

int temp = 0;

try

{

File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());

// String File = "abc.xls";

// String file = "anat" + ".xls";

wdComponentAPI.getMessageManager().reportSuccess("File::"+file);

FileOutputStream op = new FileOutputStream(file);

// FileOutputStream op = new FileOutputStream("D://usr//sap//BPE//"+file);

// FileOutputStream op = new FileOutputStream("D://KumarDev-BackUp//"+file);

wdComponentAPI.getMessageManager().reportSuccess("op::"+op);

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

{

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

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

{

op.write(temp);

}

}

op.flush();

op.close();

// path = file.getAbsolutePath();

path = "/exchange/CED/"+file;

wdComponentAPI.getMessageManager().reportSuccess("path:"+path);

}

catch(Exception ex)

{

wdComponentAPI.getMessageManager().reportSuccess("ex.printStackTrace()");

My Req is that file will saved in this path (path = "/exchange/CED/"+file; )

Regards

Vijay Kalluri