Allowing client to upload/download standardised excel file for testing [Beginner]
Hi,
New to development so please bear with me if this stuff is super easy (really hope it is).
I'm developing a simple web app that will run some stat tests on data, however, I want any user to be able to upload the info they want to test in a pre-formatted excel sheet rather than have them input it. The website would then show the tables, run the
tests in the cloud, and return results plus highlighting individual rows that are over certain thresholds. I then want the user to be able to download the result and the highlighted rows back to a new excel sheet.
I'm looking for a simple way to do this that will allow me to
mess around a bit with the formatting of the uploaded table to make it look a bit nicer and more in line with the flat design of the site
make sure the file you download looks good when you open it in excel again
I've heard office 365 has a lot of useful API calls and as there's now a free version online perhaps it's possible to integrate that into a site? I'm also assuming there are some conversion methods to migrate an excel file into MySQL, but are there then
potential issues migrating back, especially formatting etc?
Thanks in advance, and sorry again if this is just too basic.
Hi Freppas,
For this requirement, I suggest that you could consider Open XML SDK for office. For this way, you could easy do something for the uploaded excel file.
There are some links that can help you:
# Welcome to the Open XML SDK 2.5 for Office
https://msdn.microsoft.com/en-us/library/office/bb448854.aspx
# Open XML Format SDK 2.0: Getting Started Best Practices
http://blogs.msdn.com/b/erikaehrli/archive/2009/05/14/open-xml-format-sdk-2-0-getting-started-best-practices.aspx
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Similar Messages
-
hi guru,
I want to upload data from excel file for mm02.. first of all help on the matter of how to upload data from excel...
i hv used the FM ALSM_EXCEL_TO_INTERNAL_TABLE.. but its not working it uploading garbage value ... so tell me how to used it...
help me on this matter.Check below example.
parameters : p_file LIKE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_file_name.
PERFORM get_file_to_excel.
*& Form get_file_name
FORM get_file_name.
DATA: lv_name LIKE sy-repid.
lv_name = sy-repid..
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = lv_name
dynpro_number = syst-dynnr
static = 'X'
CHANGING
file_name = p_file.
ENDFORM. " get_file_name
*& Form get_file_to_excel
FORM get_file_to_excel.
DATA: idata LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '2'
i_end_row = '60000'
TABLES
intern = idata
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
STOP.
ENDIF.
* Get first row retrieved
READ TABLE idata INDEX 1.
* Set first row retrieved to current row
DATA: gd_currentrow TYPE i.
gd_currentrow = idata-row.
LOOP AT idata.
* Reset values for next row
IF idata-row NE gd_currentrow.
APPEND f. CLEAR f.
gd_currentrow = idata-row.
ENDIF.
CASE idata-col.
WHEN '0001'.
f-belnr = idata-value.
ENDCASE.
ENDLOOP.
APPEND f. CLEAR f. -
Upload and download of excel file in the application server in background
Hi all,
i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode..
i mean i'll schedule the program in background.
im using FM ALSM_EXCEL_TO_INTERNAL_TABLE its working fine in fore ground but not in back ground.
what method i have to follow ?Hi Ankit,
I think this is not possible to open a Excel-File from the application server because the Excel format before Office 2007 where a binary format (Suffix: .xls). The newer Office file format (Suffix: xlsx) is a zipped XML Format. To read the binary Excel-Format you need an OLE Connection between SAP GUI and Office. But at the application server in background you doesn't have this OLE Connection.
In my opinion you have two possibilities:
1. Convert all files in the CSV format. This file format can be read with open dataset.
2. Upload the files from the presentation server in forground. There are some funktion modules in the standard which can read the xls format. But they have some limits regarding the length of cells content.
My recommendation is solution no. 1. If you know an VBA expert, he can write an Excel-macro which converts all Excel Files in the CSV-Fomat.
Regards
Dirk -
Download & upload of an excel file
Hi,
I have a requirement where the data needs to be downloaded into an excel file and user will upload the same excel file after making required changes in the data.
I have used 'GUI_DOWNLOAD' to download the data to excel file. I have tried to upload the same excel file using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'TEXT_CONVERT_XLS_TO_SAP' function modules. But it is giving exceptions if I upload the same downloaded file directly. If I copy the data in the downloaded file to another excel file and upload this file, it is working.
I have tried using 'GUI_UPLOAD' with field separator which was also specified in 'GUI_DOWNLOAD' but in this case the data is uploaded into the internal table like,.
###&jkj, 0000 .......
Please suggest any other alternative.
Thanks & Regards,
Vishnu PriyaHi,
You may like to give a try to this FM
RH_START_EXCEL_WITH_DATA.it will take care of your formatting problem.
go thru this program..
*& Report RHVERI_EXCEL_DOWNLOAD *
REPORT rhveri_excel_download.
DATA: g_excelpath TYPE string,
g_excelversion TYPE string,
g_codepage TYPE abap_encod, "XMK#754232
g_return_code TYPE i, "XMK#754232
BEGIN OF gt_data OCCURS 0,
f1 TYPE char20,
f2 TYPE char20,
f3 TYPE char20,
f4 TYPE char20,
END OF gt_data.
END-OF-SELECTION.
gt_data-f1 = 'C1'.
gt_data-f2 = 'C2'.
gt_data-f3 = 'C3'.
gt_data-f4 = 'C4'.
APPEND gt_data.
gt_data-f1 = '10'.
gt_data-f2 = '11'.
gt_data-f3 = '12'.
gt_data-f4 = '13'.
APPEND gt_data.
gt_data-f1 = '20'.
gt_data-f2 = '21'.
gt_data-f3 = '22'.
gt_data-f4 = '23'.
APPEND gt_data.
"XMK#754232
gt_data-f1 = 'AEIOU'. "#EC NOTEXT
gt_data-f2 = 'aeiou'. "#EC NOTEXT
gt_data-f3 = '*?#/&§$#'. "#EC *
gt_data-f4 = 'äöüÄÖÜßaé'. "#EC *
APPEND gt_data.
"XMK#754232
CALL FUNCTION 'RH_CHECK_EXCEL_SUPPORT'
IMPORTING
excel_exe_path = g_excelpath
excel_version = g_excelversion
EXCEPTIONS
no_batch = 1
internal_error = 2
excel_not_installed = 3
wrong_frontend_os = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE / 'Testaufruf von Excel endete mit Fehlercode:'(002).
WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
WRITE: / 'Pfad von Excel'(005), g_excelpath.
WRITE: / 'Version von Excel'(006), g_excelversion.
ENDIF.
"XMK#754232
IF cl_abap_char_utilities=>charsize <> 1.
WRITE / 'Unicode system'(007).
CALL METHOD cl_gui_frontend_services=>get_saplogon_encoding
CHANGING
file_encoding = g_codepage
rc = g_return_code
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
g_codepage = '4110'.
ENDIF.
WRITE: / 'Codepage is'(009), g_codepage.
ELSE.
WRITE / 'Non-Unicode system'(008).
ENDIF.
"XMK#754232
CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
EXPORTING
data_filename = 'TEST.DAT'
data_path_flag = 'W'
DATA_ENVIRONMENT =
wait = 'X'
data_table = gt_data[]
EXCEPTIONS
no_batch = 1
excel_not_installed = 2
internal_error = 3
cancelled = 4
download_error = 5
no_authority = 6
file_not_deleted = 7
OTHERS = 8.
IF sy-subrc <> 0.
WRITE / 'Aufruf von Excel endete mit Fehlercode:'(003).
WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
WRITE / 'Aufruf von Excel lieferte keinen Fehler.'(004).
ENDIF.
Regards,
Amit -
How to download an excel file in client place
How to download an excel file in client place?
Iam using sun apps server..
i need the code urgently..anyone help me pls,..just build a link to that file location on the server and send it back to the client
MeTitus -
Warning while downloading an Excel file from WD ABAP
Hi folks,
In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
We achieved this with Simple Transformations.
Now the question is while downloading the excel file, the framework/other is throwing an Warning like
" The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
Note: All the users of my client are using MS Office 2002 / 2003.
I am using the following code........!
*------ Call Transformation for Excel OUTPUT
CALL TRANSFORMATION ZEXCEL_OUTPUT
SOURCE
t_dates = t_dates
t_info = t_info
RESULT XML l_xml_string.
REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>' l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
**-- Call Function Module for converting string data to XSTRING
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = l_xml_string
mimetype = 'application/xml'
IMPORTING
buffer = l_xml_xstring
EXCEPTIONS
failed = 1
OTHERS = 2.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'info.xml'
i_content = l_xml_xstring
i_mime_type = 'application/vnd.ms-excel'.
With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
Can any one help me on this -
> How to avoid this warning?
Thanks and Regards,
Aneel Danda
Edited by: danda aneel on Jul 13, 2010 1:43 PMFirstly, Thanks for Your quick Response, Thomas.
Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
Kindly provide me an alternative on this XML doesn't seem like it would match the 'application/vnd.ms-excel'.
what is the supported format.?
Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
Edited by: danda aneel on Jul 14, 2010 7:52 AM -
I would like to create a workflow in Automator or a script in AppleScript (or a combination of the two), that opens Safari to a specified page and downloads an excel file from this page and saves the downloaded document to my desktop.
Is this something that be done? If so, how?
I have so far been able to build a workflow in Automator to open Safari and added an AppleScript that takes Safari to a specific page that has an Excel document.
I can't figure out where to go from here... Any help would be apprecitated.
Thanks!Would you have the web address the excel sheet is on?
Is there a simular web page you could point to if not?
Would there be a copy of the file on an FTP page. This would be easier.
curl
http://www.cyberciti.biz/faq/mac-os-x-terminal-download-file/
http://www.thegeekstuff.com/2012/04/curl-examples/
http://curl.haxx.se/docs/manpage.html
Macintosh-HD -> Applications -> Utilities -> Terminal
# Press return to run a command.
the curl is a terminal command ( Unix ). It allows you to read a file off of the web.
man curl
provides cryptic information on the commnad curl.
press the space bar to advance a page.
press letter to q to quit.
What you may have to is to read in the web page as a text file. Go "fishing" through the page to find the excel file you need. Once you find the file, you can use curl to read the file.
curl is a very full featured command. (read complex to figure out ).
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set desktopPath to (path to desktop) as string
log "desktopPath = " & desktopPath
set unixDesktopPath to POSIX path of desktopPath
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "ls -l " & quotedUnixDesktopPath
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run -
Change Value While Uploading data From Excel File
Dear Expert,
Please guide me is it Possible?, if yes then How?
We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
if it_f65data-newbs contains any Alphabet.
then user Should be able to change value on the same time while executing Program in table.
Please tell me how i can change value in running program
Regards'
Shelly MalikHi,
What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents. -
Upload data from excel file to mii without UDS and PCo
Hi Experts,
I am trying to upload data from excel file to mii db without using UDS and PCo. Is there any other ways that we can achieve it.
I am thinking one solution , writing stored procedure. any other solutions?
Thanks in advance,
Eswar.Hi,
Thanks for reply.
I tried to create OLEDB data server which will point to my excel file in D drive.Its created successfully and i tried to query the datasource using sql query, I am not getting any modes in sql query template.
can u provide some steps..how to access this file.
Thanks, Eswar -
Upload data from excel file to Oracle table
Dear All,
I have to upload data from excel file to Oracle table without using third party tools and without converting into CSV file.
Could you tell me please how can i do this using PLSQl or SQL Loader.
Thnaks in Advance..Dear All,
I have to upload data from excel file to
Oracle table without using third party tools and
without converting into CSV file.
Could you tell me please how can i do this
using PLSQl or SQL Loader.
Thnaks in Advance..As billy mentioned using ODBC interface ,the same HS service which is a layer over using traditional ODBC to access non oracle database.Here is link you can hit and trial and come out here if you have any problem.
http://www.oracle-base.com/articles/9i/HSGenericConnectivity9i.php[pre]
Khurram -
User is not able to download specific excel file in sharepoint
Hi,
Could you please help?
thanks
srabonHi Srabon,
According to your description, my understanding is that you cannot download the excel file from SharePoint.
I recommend to check if the Download a Copy buttons can be used in the Excel web app and in the ribbon of the library.
If both the two buttons cannot work, I recommend to check the permission of the user on the excel file and check if the Information Rights Management is enabled in the library.
When Information Rights Management is enabled in the library and the user has only read permission on the document, then the file cannot be downloaded.
http://office.microsoft.com/en-in/sharepoint-help/apply-information-rights-management-to-a-list-or-library-HA102891460.aspx
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Downloading into excel file , the is alignment is out
The reports when downloading into excel file is not what we usually getting. The alignment is out.
Hi Basavaraj,
When you are creating dynamic internal table(itab1) and fields of internal table, at the same time in the same way create one more internal table(itab2) resrict this up to 10 columns.
now
DATA : num type i,
FNAME(255) TYPE C
VALUE '/data/sapdata/filename'.
CONSTANTS : C_COMMA TYPE C VALUE ','.
DATA : BEGIN OF I_DISPLAY OCCURS 0,
REC(400),
END OF I_DISPLAY.
loop at itab1
num = num + 1.
if num le 100.
move-corresponding fields to itab2
else.
exit.
endif.
endloop.
Give column headings
itab2-col1 = 'name1'
itab2-col2 = 'name2'
itab2-col3 = 'name3'
itab2-col4 = 'name4'
itab2-col5 = 'name5'
itab2-col6 = 'name6'
itab2-col7 = 'name7'
itab2-col8 = 'name8'
itab2-col9 = 'name9'
itab2-col10 = 'name10'
INSERT itab2 INDEX 1.
CLEAR itab2.
loop itab2.
CONCATENATE
itab2-col1
itab2-col2
itab2-col3
itab2-col4
itab2-col5
itab2-col6
itab2-col7
itab2-col8
itab2-col9
itab2-col10
into I_DISPLAY-REC SEPARATED BY C_COMMA.
APPEND I_DISPLAY.
CLEAR I_DISPLAY.
ENDLOOP.
OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
LOOP AT I_DISPLAY.
TRANSFER I_DISPLAY TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
endloop. -
How to upload data in excel file to an internal table
hi,
how can we upload data in excel file on presentation server to an internal table..?
Any pointers on this would be helpful.
Regards,
Anil.hi
use the fm ALSM_EXCEL_TO_INTERNAL_TABLE
check this example
TYPES: BEGIN OF ty_mara,
matnr LIKE mara-matnr,
mbrsh LIKE mara-mbrsh,
mtart LIKE mara-mtart,
maktx LIKE makt-maktx,
meins LIKE mara-meins,
END OF ty_mara.
DATA: it_mara TYPE table of ty_mara WITH HEADER LINE.
parameters : p_file like RLGRAP-FILENAME.
data : itab type table of ALSMEX_TABLINE WITH HEADER LINE.
start-of-selection.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 5
i_end_row = 4
tables
intern = itab.
loop at itab.
CASE ITAB-COL.
WHEN '1'.
it_mara-matnr = ITAB-VALUE.
WHEN '2'.
it_mara-mbrsh = ITAB-VALUE.
WHEN '3'.
it_mara-mbrsh = ITAB-VALUE.
WHEN '4'.
it_mara-maktx = ITAB-VALUE.
WHEN '5'.
it_mara-meins = ITAB-VALUE.
ENDCASE.
AT END OF ROW.
APPEND it_mara.
CLEAR it_mara.
ENDAT.
endloop.
regards
prasanth -
Report data download to excel file
Hi experts,
My requirement is report data download to excel file and that file should be an attachment to send email to specified people.
first i want to to download data to excel file and that file should be an attachment.
Regards
V.VenuHi venu,
Before posting the question, just search for the related query, more number of post has been posted related to your query,
any ways check this below links, it will solve your problem.
<<linkfarm removed>>
Cheers
NZAB
Edited by: kishan P on Jan 10, 2012 4:51 PM -
Download an excel file in background mode
Hi All,
I need to download a file from a ABAP report to the local workstation in background mode. I tried GUI_DOWNLOAD but it is failing in the background.
Is there any way to download the excel file in the background. I am thinking of generating the spool.
Please let me know if anybody has worked on the same requirement. Any help would be highly appreciated.
Thanks a lot.
Regards,
PritiYou be able to use the function "WS_DONLOAD" ?
parameters: p_fnam like rlgrap-filename memory id fnam obligatory.
data: begin of t_registro occurs 0,
registro(1000),
end of t_registro.
describe table t_registro lines sy-tfill.
if sy-tfill gt 0.
l_tam = strlen( p_fnam ).
call function 'WS_DOWNLOAD'
exporting
filename = p_fnam
tables
data_tab = t_registro
exceptions
file_open_error
file_write_error
invalid_filesize
invalid_type
no_batch
unknown_error
invalid_table_width
gui_refuse_filetransfer
customer_error.
if sy-subrc <> 0.
open dataset p_fnam for output in text mode.
if sy-subrc = 0.
loop at t_registro.
transfer t_registro to p_fnam.
endloop.
close dataset p_fnam.
write:/ 'Se genero el archivo:', p_fnam(l_tam).
else.
write:/ 'No se pudo generar el archivo:', p_fnam(l_tam).
endif.
close dataset p_fnam.
else.
write:/ 'Se genero el archivo:', p_fnam(l_tam).
endif.
endif.
I hope this works for you.
See ya.
Ar@
Maybe you are looking for
-
How can I change the "From:" field in iOS Mail?
This is a weird one. I have a gmail work email account that has been set up for me. There's a primary email address assigned to it, and a secondary one (which is the one I want to use). No problem at all sending from the secondary account on my MacBo
-
How to update a single field in Word macro
Hello, I am trying to create an AutoOpen() macro that will update the file name and path when user opens in a Word document, but I can't seem to find anything explaining how to update a single field, specifically the {FILENAME \p} field. There are o
-
[SOLVED] libva-intel-driver 1.3.2-1 breaks hardware acceleration
Hello, I'm running Arch with XFCE on my Lenovo L540 (i5-4200M, HD4600) on the integrated full HD display and a second full HD screen attached with a mini-Displayport-DVI adaptor. Since yesterday's system update my laptop screen randomly shows visual
-
Moving to a frame in Movieclip timeline from the main timeline
I am in the learning process. Working with FlashCS5 and AS3. Please bear with me if the issue appears to be too simple for you. Placed a movieclip(mcassessJohn) on the main timeline and moved to the frame labelled "johnFeedback" in the movieclip time
-
I would like to change an existing endpoint that is tied to many agreements. I am able to update the endpoint with no problem but after updating the endpoint the files are still being picked up from the old location and not the new. i.e. \windows\fil