cancel
Showing results for 
Search instead for 
Did you mean: 

how to upload an excel file and how to download logfile

Former Member
0 Kudos

Hi all,

my requirement is if user select mass upload in first line and then he select professional rate table and when he click on browse option excel file from desktop should be uploaded and mail should be mentioned. and in cc mail id should be mentioned when he click on upload button the data should be uploades in professional rate table.

This development i am doing in bw system

i have created 4radiobuttons

select action

1) mass upload if user select this radiobutton and in the next line for example if he select professional rate table.

select rate category

2)professional rate tables (/BIC/AGLDCPRTS00) 2)claims & litigation table (/bic/Agldclmlt00) 3) default rate table(/bic/Agldcdrts00)

upload file -- here we should provide browse option

To - email id should be mentioned

cc -

Upload is the button

kindly send me tne necessary steps how to achieve this functionality i am new to this concept so kindly explain me in detail steps.

Thanks & Regards,

Naveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naveen,

To Download and upload data into Excel file, u have to use FILEDOWNLOAD and FILEUPLOAD ui elements, and ussage of this u can see using nice wkis...

http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP

If you want more... try these also..

http://wiki.sdn.sap.com/wiki/display/WDABAP/Downloadafileintoexcel+sheet

http://wiki.sdn.sap.com/wiki/display/WDABAP/WDAforuploadingDatafrom+Excelsheet

http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP

Hope it might helps you...

Thanks,

Kris.

Former Member
0 Kudos

Hi kISSNAS,

after uploading and it should provide these messages for example

successfully uploaded

380 records in file

200 records in table before upload

580 records in table after upload.

Kindly tell me how to achieve this functionality.

Thanks & Regards,

Naveen

Former Member
0 Kudos

Hi Naveen

If you want to display messages, use message area.

So, now you want total no of records in databse(before upload),

total no of records after upload.

no of records uploaded.

Declare three variable of type i ex : BTOT, ATOT, UREC.

1. to get no of records in table use SY-DBCNT and pass this value to one variable for example : BTOT(before upload)

2.Again read total no of records using SY-DBCNT, and pass this value to another variabable : ATOT.

3. use mathematical operation substract ATOT - BTOT, and this value to one variable : UPREC.

Now BTOT containes - Records in a file before upload

ATOT containes - Records after upload,

UREC containes - records in file.

and use this sample code to print your messages. change according to your requirement.

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component type ref to if_wd_component.

data lo_window type ref to if_wd_window.

data i_error type string_table.

DATA wa_error TYPE STRING.

CONCATENATE UREC 'Records in a file' into wa_error SEPARATED BY space.

append wa_error to i_error.

Hope this might helpful.

Thanks,

Kris.

gill367
Active Contributor
0 Kudos

HI

firs of all uplaoding excel file and readin data from it is not feasible as far as i think.

you need to convert the xls file to txt file using the save as option.

then you can proceed as per the wiki link given by the kissnas and

there in the code when you split the content based on the new line character.

and storing it in an internal table.

you can count the lines in this inetrnal table there and save it soem attirbute and then print the message accordingly.

thanks

sarbjeet singh

Answers (0)