cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload Application

Former Member
0 Kudos

Hello Everyone,

We are trying to develop an application that allows the users to upload an Excel sheet to an iView from the local machine and behind the scenes the iView should upload the Excel sheet to the Backend system where the program runs the data in the excel sheet. Is this possible?

Regards,

Gopal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello everyone,

Thanks a lot for all your replies. I appreciate your help. I very much aware about the process of uploading the document using UploadUI Element. Sorry that I was not able to explain my requirement due to some lack of knowledge about the ABAP side. Now I spoke to our ABAPer and here it is:-

We want to create a Document Posting Application using "BAPI_ACC_DOCUMENT_POST" which allows the end users to replicate the process of FB10 through portal. I was able to do this for on Vendor in one document, but we need this for multiple vendors.

So, we came up with a scenario where the user inputs all the data on an Excel sheet and then uploads it to the BDC where we can run the Excel and generate the invoices. But, this seems to be very complicated process.

Has anyone ever implemented this kind of scenario so that you can advise me a solution which can be resolved by using the "BAPI_ACC_DOCUMENT_POST".

Please let me know if this is possible. I would appreciate your help.

Regards,

Gopal.

Former Member
0 Kudos

Hi gopal,

This code will solve your problem.

InputStream text=null;

String path;

int temp=0;

IPrivateCreateDirView.IContextElement element1 = wdContext.currentContextElement();

IWDResource resource = element1.getResource();

try

{

File file = new File("C:
"wdContext.currentContextElement().getDirectoryName()"
"+wdContext.currentContextElement().getResource().getResourceName().toString());//created a new file in server

FileOutputStream op = new FileOutputStream(file);

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();

wdComponentAPI.getMessageManager().reportSuccess("File Path is "+path);

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);

}

Regards,

Sunaina Reddy T

former_member197348
Active Contributor
0 Kudos

Hi Gopal,

Using fileUploadUI element you can achieve it. check this [article|https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/607e9392-8167-2b10-b9a8-e0aa297e88c6&overridelayout=true]

Regards,

Siva

former_member40425
Contributor
0 Kudos

Hi,

go to this link.

You will fnd so many threads for the same.

Regards,

Rohit