Uploading exported Excel file to Google Docs
I exported a spreadsheet as an Excel .xls file, but Google won't let me upload it giving me an error:
We're sorry, but we were unable to upload this document.
If you have the desktop word processor installed on this computer, there are two other easy ways to bring the file into Google Docs:
Using the Clipboard
Open the document in the desktop word processor.
Type ⌘-A to select the contents of the entire document.
Type ⌘-C to copy it to the clipboard.
In Google Docs, create a new document.
When the Edit window appears, type ⌘-V to paste it in.
Save as HTML
Open the document in the desktop word processor.
Choose File > Save As...
In the dialog that appears, select Web Page (*.htm; *.html) for the "Save as type."
Save the file, and make a note of the file name and folder, as you'll need it next.
In Google Docs, choose Upload again from the main page.
This time, specify the html file you just made in the desktop word processor.
Using either of these approaches, you should now have the document open in Google Docs.
Anyone else have this problem?
It seems Google doesn't like the Excel version that Numbers exports. The file will open fine in Excel and if I re-save it from Excel it will upload no problem to Google Docs.
Similar Messages
-
I am using Firefox 4.0 Beta 4 and think there is a problem with the "Upload file" functionality in google docs combined with the latest beta4 release of FF. It worked up until beta v3. I have also installed v3.6.8 and seems to be a problem on all such evironments. I use Windows XP. I tried to disable adblock plus but same problem persists and I have to use say Opera.
Google docs provides an excellent gateway to publish stuff to my blog and to publish plain office and pictures. I have tried to disable "Popup blocker" but no difference.
Any help most welcome.
Screenshot - using trace: Tools->Inspect:
https://docs.google.com/leaf?id=0BxYmgdfTki9SODU1ODk2NTAtMGYwMi00OGI4LWFkM2QtMDAyYmZmODlkZjE5&hl=en&browserok=true as well as
http://www.google.no/search?as_q=%22Select+files+to+upload%22+firefox+beta+problem&hl=no&num=100&btnG=Google-s%C3%B8k&as_epq=google+docs&as_oq=&as_eq=&lr=&cr=&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&as_sitesearch=&as_rights=&safe=imagesThere is a problem with uploading files to Google docs in Firefox 3.6x versions and later.
http://www.google.com/support/forum/p/Google+Docs/thread?tid=4f0369bdcf6fd7ff&hl=en "Select files to upload" not working in Firefox - Google Docs Help (Thanks to Joolsa for the link) -
Right-clicking on the link doesn't offer options to open anywhere (new tab, etc.)
There is a problem with uploading files to Google docs in Firefox 3.6x versions.
http://www.google.com/support/forum/p/Google+Docs/thread?tid=4f0369bdcf6fd7ff&hl=en "Select files to upload" not working in Firefox - Google Docs Help (Thanks to Joolsa for the link) -
Problem in uploading an excel file in wd abap
I am trying to upload an excel file in wd abap but on uploading it shows me the data in the form of some codes but when i try to do the same thing using text file it works well.Plese refer the code .
METHOD onactionon_upload .
TYPES : BEGIN OF itab_str1,
name(10) TYPE c,
age(10) TYPE c,
END OF itab_str1.
DATA : t_table1 TYPE STANDARD TABLE OF itab_str1,
i_data TYPE STANDARD TABLE OF string,
lo_nd_sflight TYPE REF TO if_wd_context_node,
lo_el_sflight TYPE REF TO if_wd_context_element,
l_string TYPE string,
fs_table TYPE itab_str1,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string.
DATA : t_table TYPE if_main=>elements_data_tab,
data_table TYPE if_main=>elements_data_tab.
wd_context->get_attribute(
EXPORTING
name = 'DATASOURCE'
IMPORTING
value = l_xstring
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field index 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field index 2.
fs_table-age = lv_field.
APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB').
lo_nd_sflight->bind_table( t_table1 ).
ENDMETHOD.Problem is not with the file format nor Upload element.
problem is with conversion function module, still now for conversion of xcel data to string format we dont have perfect function module.
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
That's a bug with xcel conversion As of now I dont find any fm which converts xcel data to string without any problem.
Regards
Srinvivas
Edited by: sanasrinivas on Dec 23, 2011 7:02 AM -
Uploading an excel file in an internal table.
hi experts,
I m trying to upload a excel file comprising of 16,000 records using the function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' as follws
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_input
i_begin_col = 1
i_begin_row = 1
i_end_col = 30
i_end_row = 65000
TABLES
intern = g_t_excel
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.
ENDIF.
My problem is I am unable to upload record number 10001 else all the records are uploaded successfully
can anyone help me in solving this problemFORM upload_itab .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = p_file
FILETYPE = 'ASC'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Need help in uploading an excel file into SAP
Hi All,
I got a requirement to upload an excel file to SAP.
But When i tried with the FM "ALSM_EXCEL_TO_INTERNAL_TABLE" , file not getting uploaded to internal table.
Getting expection 2, UPLOAD_OLE...
I think the problem is with the file... the following the sample text of the file...
Technical IdentNo. Line No. Text Location
BS-PZ-180 1 035-05 EXZENTER-SCHNECKENPUMPE 0026
BS-PZ-180 2 LIEFERANT : SOCSIL-INTER SA ECUBLENS 0026
BS-PZ-180 3 HERSTELLER : MONO PUMPS LIMITED MANCH 0026
BS-PZ-180 4 MODELL/TYP : SH 60 0026
But when I tried with only one Column..its getting successfully uploaded...
Pls suggest me how to upload the file? ( May be with sample code)
Also pls let me know hw to handle the file..which contains 5 differnt sheets of texts.. ( May be with sample code)
Your suggestion will be highly appreciated...
Thanks,
PriyaHi,
Use the FM: TEXT_CONVERT_XLS_TO_SAP. It will work perfectly. I used this function module and uploaded data from xls to sap. check the following code:
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
PROP_NAME like SDOKPROP-PROP_NAME,
PROP_CHECK like SDOKPROP-PROP_CHECK,
TABNAME like SDOKPROP-TABNAME,
FIELDNAME like SDOKPROP-FIELDNAME,
DESCRIPT(30) type c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
itab TYPE STANDARD TABLE OF t_datatab,
wa_itab TYPE t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
SELECT * FROM sdokprop INTO CORRESPONDING FIELDS OF TABLE itab
WHERE PROP_NAME LIKE 'DMS%'.
WRITE / 'Before Modification'.
LOOP AT itab INTO wa_itab.
WRITE:/1 wa_itab-PROP_NAME, 27 wa_itab-PROP_CHECK, 31 wa_itab-TABNAME, 65 wa_itab-FIELDNAME, 96 wa_itab-DESCRIPT.
CLEAR wa_itab.
ENDLOOP.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
WRITE / 'After Modification'.
MODIFY sdokprop FROM TABLE it_datatab.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/1 wa_datatab-PROP_NAME, 27 wa_datatab-PROP_CHECK, 31 wa_datatab-TABNAME, 65 wa_datatab-FIELDNAME, 96 wa_datatab-DESCRIPT.
CLEAR wa_datatab.
ENDLOOP.
IF sy-subrc = 0.
MESSAGE 'successfull' TYPE 'S'.
ELSE.
MESSAGE 'failed' TYPE 'E'.
ENDIF.
Regards,
Bhaskar -
How to upload an excel file using ABAP.
Hi,
Can anyone please help me in understanding how to upload an excel file using ABAP.
Thanks!!http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
check the link
TYPES: Begin of t_record,
name1 like itab-value,
name2 like itab-value,
age like itab-value,
End of t_record.
DATA: it_record type standard table of t_record initial size 0,
wa_record type t_record.
DATA: gd_currentrow type i.
*Selection Screen Declaration
PARAMETER p_infile like rlgrap-filename.
*START OF SELECTION
call function ALSM_EXCEL_TO_INTERNAL_TABLE
exporting
filename = p_infile
i_begin_col = 1′
i_begin_row = 2′ Do not require headings
i_end_col = 14′
i_end_row = 31′
tables
intern = itab
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
message e010(zz) with text-001. Problem uploading Excel Spreadsheet
endif.
Sort table by rows and colums
sort itab by row col.
Get first row retrieved
read table itab index 1.
Set first row retrieved to current row
gd_currentrow = itab-row.
loop at itab.
Reset values for next row
if itab-row ne gd_currentrow.
append wa_record to it_record.
clear wa_record.
gd_currentrow = itab-row.
endif.
case itab-col.
when 0001′. First name
wa_record-name1 = itab-value.
when 0002′. Surname
wa_record-name2 = itab-value.
when 0003′. Age
wa_record-age = itab-value.
endcase.
endloop.
append wa_record to it_record.
*!! Excel data is now contained within the internal table IT_RECORD
Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop. -
Upload of excel file in to purchase order
hi guys,
i want to upload a excel file to the internal table and then to create the purchase order.
i know the name of function module and bapi.
but how to make use of them in implementation!!!
fun module : ALSM_EXCEL_TO_INTERNAL_TABLE
bapi : BAPI_PO_CREATE1.
arun and vishnu from
infotech solutions*CREATION OF A TEMPORARY STRUCTURE FOR INSERTING FIELDS OF EXCEL TO INTERNAL TABLE.
TYPES : BEGIN OF STR_FINAL,
COMP_CODE TYPE BAPIMEPOHEADER-COMP_CODE, " STRUCTURE : BAPIMEPOHEADER
ITEM_INTVL TYPE BAPIMEPOHEADER-ITEM_INTVL,
VENDOR TYPE BAPIMEPOHEADER-VENDOR,
PMNTTRMS TYPE BAPIMEPOHEADER-PMNTTRMS,
PURCH_ORG TYPE BAPIMEPOHEADER-PURCH_ORG,
PUR_GROUP TYPE BAPIMEPOHEADER-PUR_GROUP,
CURRENCY TYPE BAPIMEPOHEADER-CURRENCY,
PO_ITEM TYPE BAPIMEPOITEM-PO_ITEM, " STRUCTURE : BAPIMEPOITEM
MATERIAL TYPE BAPIMEPOITEM-MATERIAL,
PLANT TYPE BAPIMEPOITEM-PLANT,
STGE_LOC TYPE BAPIMEPOITEM-STGE_LOC,
QUANTITY TYPE BAPIMEPOITEM-QUANTITY,
TAX_CODE TYPE BAPIMEPOITEM-TAX_CODE,
ITEM_CAT TYPE BAPIMEPOITEM-ITEM_CAT,
ACCTASSCAT TYPE BAPIMEPOITEM-ACCTASSCAT,
SCHED_LINE TYPE BAPIMEPOSCHEDULE-SCHED_LINE, " STRUCTURE : BAPIMEPOSCHEDULE
DELIVERY_DATE TYPE BAPIMEPOSCHEDULE-DELIVERY_DATE,
SERIAL_NO TYPE BAPIMEPOACCOUNT-SERIAL_NO, " STRUCTURE : BAPIMEPOACCOUNT
GL_ACCOUNT TYPE BAPIMEPOACCOUNT-GL_ACCOUNT,
COSTCENTER TYPE BAPIMEPOACCOUNT-COSTCENTER,
CO_AREA TYPE BAPIMEPOACCOUNT-CO_AREA,
END OF STR_FINAL.
DATA : IT_FINAL TYPE TABLE OF STR_FINAL,
WA_FINAL TYPE STR_FINAL.
DATA: ST_BAPIMEPOHEADER TYPE BAPIMEPOHEADER,
ST_BAPIMEPOHEADERX TYPE BAPIMEPOHEADERX.
*it is for item data
DATA: WA_POITEM TYPE BAPIMEPOITEM,
IT_POITEM TYPE TABLE OF BAPIMEPOITEM,
WA_POITEMX TYPE BAPIMEPOITEMX,
IT_POITEMX TYPE TABLE OF BAPIMEPOITEMX,
WA_POSCHEDULE TYPE BAPIMEPOSCHEDULE,
IT_POSCHEDULE TYPE TABLE OF BAPIMEPOSCHEDULE,
WA_POSCHEDULEX TYPE BAPIMEPOSCHEDULX,
IT_POSCHEDULEX TYPE TABLE OF BAPIMEPOSCHEDULX,
WA_POACCOUNT TYPE BAPIMEPOACCOUNT,
IT_POACCOUNT TYPE TABLE OF BAPIMEPOACCOUNT,
WA_POACCOUNTX TYPE BAPIMEPOACCOUNTX,
IT_POACCOUNTX TYPE TABLE OF BAPIMEPOACCOUNTX,
WA_RETURN TYPE BAPIRET2,
IT_RETURN TYPE TABLE OF BAPIRET2.
selection-screen skip 1.
parameters: p_file type localfile default 'D:\VISHNU\DEMO.XLS'.
*selection-screen skip 1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
clear IT_FINAL.
refresh IT_FINAL.
perform upload_data.
loop at IT_FINAL INTO WA_FINAL.
write:/ WA_FINAL-COMP_CODE,
/ WA_FINAL-ITEM_INTVL,
/ WA_FINAL-VENDOR,
/ WA_FINAL-PMNTTRMS,
/ WA_FINAL-PURCH_ORG,
/ WA_FINAL-PUR_GROUP,
/ WA_FINAL-CURRENCY,
/ WA_FINAL-PO_ITEM,
/ WA_FINAL-MATERIAL,
/ WA_FINAL-PLANT,
/ WA_FINAL-STGE_LOC,
/ WA_FINAL-QUANTITY,
/ WA_FINAL-TAX_CODE,
/ WA_FINAL-ITEM_CAT,
/ WA_FINAL-ACCTASSCAT,
/ WA_FINAL-SCHED_LINE,
/ WA_FINAL-DELIVERY_DATE,
/ WA_FINAL-SERIAL_NO,
/ WA_FINAL-GL_ACCOUNT,
/ WA_FINAL-COSTCENTER,
/ WA_FINAL-CO_AREA.
endloop.
LOOP AT IT_FINAL INTO WA_FINAL.
ST_BAPIMEPOHEADER-COMP_CODE = WA_FINAL-COMP_CODE.
ST_BAPIMEPOHEADER-DOC_TYPE = 'NB'.
ST_BAPIMEPOHEADER-ITEM_INTVL = WA_FINAL-ITEM_INTVL.
ST_BAPIMEPOHEADER-VENDOR = WA_FINAL-VENDOR.
ST_BAPIMEPOHEADER-LANGU = SY-LANGU.
ST_BAPIMEPOHEADER-PMNTTRMS = WA_FINAL-PMNTTRMS.
ST_BAPIMEPOHEADER-PURCH_ORG = WA_FINAL-PURCH_ORG.
ST_BAPIMEPOHEADER-PUR_GROUP = WA_FINAL-PUR_GROUP.
ST_BAPIMEPOHEADER-CURRENCY = WA_FINAL-CURRENCY.
*insert ST_BAPIMEPOHEADERX values
ST_BAPIMEPOHEADERX-COMP_CODE = 'X'.
ST_BAPIMEPOHEADERX-DOC_TYPE = 'X'.
ST_BAPIMEPOHEADERX-ITEM_INTVL = 'X'.
ST_BAPIMEPOHEADERX-VENDOR = 'X'.
ST_BAPIMEPOHEADERX-LANGU = 'X'.
ST_BAPIMEPOHEADERX-PMNTTRMS = 'X'.
ST_BAPIMEPOHEADERX-PURCH_ORG = 'X'.
ST_BAPIMEPOHEADERX-PUR_GROUP = 'X'.
ST_BAPIMEPOHEADERX-CURRENCY = 'X'.
*insert IT_POITEM values
WA_POITEM-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POITEM-MATERIAL = WA_FINAL-MATERIAL.
WA_POITEM-PLANT = WA_FINAL-PLANT.
WA_POITEM-STGE_LOC = WA_FINAL-STGE_LOC.
WA_POITEM-QUANTITY = WA_FINAL-QUANTITY.
WA_POITEM-TAX_CODE = WA_FINAL-TAX_CODE.
WA_POITEM-ITEM_CAT = WA_FINAL-ITEM_CAT.
WA_POITEM-ACCTASSCAT = WA_FINAL-ACCTASSCAT.
APPEND WA_POITEM TO IT_POITEM.
CLEAR WA_POITEM.
*insert IT_POITEMX values
WA_POITEMX-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POITEMX-PO_ITEMX = 'X'.
WA_POITEMX-MATERIAL = 'X'.
WA_POITEMX-PLANT = 'X'.
WA_POITEMX-STGE_LOC = 'X'.
WA_POITEMX-QUANTITY = 'X'.
WA_POITEMX-TAX_CODE = 'X'.
WA_POITEMX-ITEM_CAT = 'X'.
WA_POITEMX-ACCTASSCAT = 'X'.
APPEND WA_POITEMX TO IT_POITEMX.
CLEAR WA_POITEMX.
*insert IT_POSCHEDULE values
WA_POSCHEDULE-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POSCHEDULE-SCHED_LINE = WA_FINAL-SCHED_LINE.
WA_POSCHEDULE-DELIVERY_DATE = WA_FINAL-DELIVERY_DATE .
WA_POSCHEDULE-QUANTITY = WA_FINAL-QUANTITY.
APPEND WA_POSCHEDULE TO IT_POSCHEDULE.
CLEAR WA_POSCHEDULE.
*insert IT_POSCHEDULEX values
WA_POSCHEDULEX-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POSCHEDULEX-SCHED_LINE = WA_FINAL-SCHED_LINE.
WA_POSCHEDULEX-PO_ITEMX = 'X' .
WA_POSCHEDULEX-SCHED_LINEX = 'X' .
WA_POSCHEDULEX-DELIVERY_DATE = 'X' .
WA_POSCHEDULEX-QUANTITY = 'X' .
WA_POSCHEDULEX-PO_ITEM = WA_FINAL-PO_ITEM .
WA_POSCHEDULEX-SCHED_LINE = WA_FINAL-SCHED_LINE.
WA_POSCHEDULEX-PO_ITEMX = 'X'.
WA_POSCHEDULEX-SCHED_LINEX = 'X' .
WA_POSCHEDULEX-DELIVERY_DATE = 'X' .
WA_POSCHEDULEX-QUANTITY = 'X'.
WA_POSCHEDULEX-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POSCHEDULEX-SCHED_LINE = WA_FINAL-SCHED_LINE.
WA_POSCHEDULEX-PO_ITEMX = 'X'.
WA_POSCHEDULEX-SCHED_LINEX = 'X'.
WA_POSCHEDULEX-DELIVERY_DATE = 'X' .
WA_POSCHEDULEX-QUANTITY = 'X'.
APPEND WA_POSCHEDULEX TO IT_POSCHEDULEX.
CLEAR WA_POSCHEDULEX.
*insert IT_POACCOUNT values
WA_POACCOUNT-PO_ITEM = WA_FINAL-PO_ITEM.
WA_POACCOUNT-SERIAL_NO = WA_FINAL-SERIAL_NO.
WA_POACCOUNT-QUANTITY = WA_FINAL-QUANTITY .
WA_POACCOUNT-GL_ACCOUNT = WA_FINAL-GL_ACCOUNT.
WA_POACCOUNT-COSTCENTER = WA_FINAL-COSTCENTER.
WA_POACCOUNT-CO_AREA = WA_FINAL-CO_AREA.
APPEND WA_POACCOUNT TO IT_POACCOUNT.
CLEAR WA_POACCOUNT.
*insert IT_POACCOUNTX values
WA_POACCOUNTX-PO_ITEM = 00001.
WA_POACCOUNTX-SERIAL_NO = 01.
WA_POACCOUNTX-QUANTITY = 'X'.
WA_POACCOUNTX-GL_ACCOUNT = 'X'.
WA_POACCOUNTX-COSTCENTER = 'X' .
WA_POACCOUNTX-CO_AREA = 'X'.
APPEND WA_POACCOUNTX TO IT_POACCOUNTX.
CLEAR WA_POACCOUNTX.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = ST_BAPIMEPOHEADER
POHEADERX = ST_BAPIMEPOHEADERX
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
IMPORTING
EXPPURCHASEORDER =
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN = IT_RETURN
POITEM = IT_POITEM
POITEMX = IT_POITEMX
POADDRDELIVERY =
POSCHEDULE = IT_POSCHEDULE
POSCHEDULEX = IT_POSCHEDULEX
POACCOUNT = IT_POACCOUNT
POACCOUNTPROFITSEGMENT =
POACCOUNTX = IT_POACCOUNTX
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
*this is for save the porder number
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*dispaly the results
LOOP AT IT_RETURN INTO WA_RETURN.
WRITE:/ WA_RETURN-MESSAGE,
ST_BAPIMEPOHEADER-PO_NUMBER.
ENDLOOP.
form upload_data.
data: file type rlgrap-filename.
data: IT_XCEL type table of alsmex_tabline,
WA_XCEL TYPE ALSMEX_TABLINE.
file = p_file.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '21'
i_end_row = '1'
tables
intern = IT_xcel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
loop at IT_xcel INTO WA_XCEL.
case
WA_XCEL-COL.
when '0001'.
WA_FINAL-COMP_CODE = WA_xcel-value.
WHEN '0002'.
WA_FINAL-ITEM_INTVL = WA_XCEL-VALUE.
WHEN '0003'.
WA_FINAL-VENDOR = WA_XCEL-VALUE.
WHEN '0004'.
WA_FINAL-PMNTTRMS = WA_XCEL-VALUE.
WHEN '0005'.
WA_FINAL-PURCH_ORG = WA_XCEL-VALUE.
WHEN '0006'.
WA_FINAL-PUR_GROUP = WA_XCEL-VALUE.
WHEN '0007'.
WA_FINAL-CURRENCY = WA_XCEL-VALUE.
WHEN '0008'.
WA_FINAL-PO_ITEM = WA_XCEL-VALUE.
WHEN '0009'.
WA_FINAL-MATERIAL = WA_XCEL-VALUE.
WHEN '00010'.
WA_FINAL-PLANT = WA_XCEL-VALUE.
WHEN '00011'.
WA_FINAL-STGE_LOC = WA_XCEL-VALUE.
WHEN '00012'.
WA_FINAL-QUANTITY = WA_XCEL-VALUE.
WHEN '00013'.
WA_FINAL-TAX_CODE = WA_XCEL-VALUE.
WHEN '00014'.
WA_FINAL-ITEM_CAT = WA_XCEL-VALUE.
WHEN '00015'.
WA_FINAL-ACCTASSCAT = WA_XCEL-VALUE.
WHEN '00016'.
WA_FINAL-SCHED_LINE = WA_XCEL-VALUE.
WHEN '00017'.
WA_FINAL-DELIVERY_DATE = WA_XCEL-VALUE.
WHEN '00018'.
WA_FINAL-SERIAL_NO = WA_XCEL-VALUE.
WHEN '00019'.
WA_FINAL-GL_ACCOUNT = WA_XCEL-VALUE.
WHEN '00020'.
WA_FINAL-COSTCENTER = WA_XCEL-VALUE.
WHEN '00021'.
WA_FINAL-CO_AREA = WA_XCEL-VALUE.
ENDCASE.
at end of row.
append WA_FINAL TO IT_FINAL.
clear WA_FINAL.
endat.
ENDLOOP.
ENDFORM. -
How to upload a excel file in webdynpro? Please help!
Hi Experts,
I have a requirement where I need to upload a excel file in my webdynpro for ABAP report.
I have used the fileupload UI element in my view and a upload button.
However when I test the application I found that it is getting file data as some junk value like below:
###ࡱ#################>########################################################################################################################################################################################################################################
Why is that so?
Is there any limitation with fileuplaod reading excel file?
Do i have to use any encoding option?
What is the alternative option to read excel file in ABAP webdynpro?
Thanks
GopalHi,
Check this.. Write this code in Upload button 's method
********** Reading data from flat file ****************
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_datasource type xstring.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `DATASOURCE`
IMPORTING
value = lv_datasource ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
* FROM_CODEPAGE = '8500'
IN_XSTRING = LV_DATASOURCE
* OUT_LEN = '1'
IMPORTING
OUT_STRING = LV_STRING.
SPLIT LV_STRING AT CL_ABAP_CHAR_UTILITIES=>NEWLINE INTO TABLE IT_STR.
LOOP AT IT_STR INTO LV_STRING.
SPLIT LV_STRING AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO TABLE FIELDS.
READ TABLE FIELDS INTO LV_FIELD INDEX 1. " Reading 1st field
ls_header-STATU = LV_FIELD.
clear LV_FIELD.
READ TABLE FIELDS INTO LV_FIELD INDEX 2. " Reading 2st field
ls_header-LIFNR = LV_FIELD.
clear LV_FIELD.
READ TABLE FIELDS INTO LV_FIELD INDEX 3.
ls_header-BSART = LV_FIELD.
clear LV_FIELD.
READ TABLE FIELDS INTO LV_FIELD INDEX 4.
ls_header-EKORG = LV_FIELD.
clear LV_FIELD.
READ TABLE FIELDS INTO LV_FIELD INDEX 5.
ls_header-EKGRP = LV_FIELD.
clear LV_FIELD.
READ TABLE FIELDS INTO LV_FIELD INDEX 6.
ls_header-BUKRS = LV_FIELD.
clear LV_FIELD.
APPEND wa to it.
append ls_header to lt_header.
clear: ls_header,wa.
endloop.
lo_nd_header->BIND_TABLE( lt_header ).
Thanks,
Ramesh
Edited by: Rameshkumar Raamasamy on Dec 20, 2010 11:16 AM -
Urgent : Uploading an excel file to an internal table
Hi All
M problem is simple ..i have to upload an excel file from my PC which is containing 2 cols to an internal table which is having two fields .. I am using GUI_UPLOAD function module for this and using FILELD_SEPARATOR as 'X" .. But i am not able to upload anything .it gives some junk content to my internal tble .
please help me out
Regards
rohanHi Rohan,
Use the following code.
DATA: IT_MAIN LIKE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'c:\test.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 4
tables
intern = IT_MAIN
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.
ENDIF.
LOOP AT IT_MAIN.
WRITE:/ IT_MAIN-ROW, ' ',
IT_MAIN-COL, ' ',
IT_MAIN-VALUE, ' '.
ENDLOOP.
The field VALUE of internal table IT_MAIN will contain the data. The first row will contain data from the first column, second for the second column and so on... In your case, the third row will contain 2nd row data from the first column of your excel sheet and so on.
Hopw this helps,
Cheers,
Madhur -
FM to upload the Excel file to internal table
Hi
Is any FM available to upload the Excel file to internal table.
Thanks
AnbuHi
se this code
EXCEL to INTERNAL TABLE and then to APPLICATION SERVER
*& Report ZSD_EXCEL_INT_APP
REPORT ZSD_EXCEL_INT_APP.
parameter: file_nm type localfile.
types : begin of it_tab1,
f1(20),
f2(40),
f3(20),
end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
wa_tab2 type it_tab1,
w_message(100) TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = 'X'
MASK = ' '
CHANGING
file_name = file_nm
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '10'
i_end_row = '35'
tables
intern = it_tab
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.
ENDIF.
loop at it_tab.
case it_tab-col.
when '002'.
wa_tab2-f1 = it_tab-value.
when '004'.
wa_tab2-f2 = it_tab-value.
when '008'.
wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
append wa_tab2 to it_tab2.
clear wa_tab2.
endat.
endloop.
data : p_file TYPE rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
IF sy-subrc NE 0.
MESSAGE e001(zsd_mes).
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT it_tab2 INTO wa_tab2.
TRANSFER wa_tab2 TO p_file.
ENDLOOP.
ENDIF.
*--Close the Application server file (Mandatory).
CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop. -
CRM ABAP How to upload an Excel file into an internal table?
How to upload an Excel file using GUI_UPLOAD?? what should be the values of the parameters? The function modules ALSM_EXCEL_TO_INTERNAL_TABLE and KCD_EXCEL_OLE_TO_INT are not present in CRM. Please suggest me a way out!
Hi saurabh,
you can try the folowing sample..
and make modifications according to your requirement..
TYPE-POOLS: truxs.
DATA: i_text_data TYPE truxs_t_text_data,
v_filename_string TYPE string.
DATA: BEGIN OF itab OCCURS 0,
Name(30),
Phone(15),
Fax(500).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename.
START-OF-SELECTION.
v_filename_string = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename_string
filetype = 'ASC'
has_field_separator = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
dat_mode = ''
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = i_text_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
* I_LINE_HEADER =
i_tab_raw_data = i_text_data
i_filename = p_file
TABLES
i_tab_converted_data = itab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
this is a sample code that uploads a excel file using GUI_UPLOAD, but uses another function module to convert that uploaded data into an internal table..
regards
satesh -
Upload an Excel file into an Internal Table
Hi,
I want to upload an Excel file into an internal table but it doesn't work. I'd appreciate if someone could tell me what is wrong.
My excel file has the following format:
Col1 Col2
Row1 1 2
Row2 2 3
Row3 3 4
And the report code is the following one:
REPORT ZFI_PROKON_PROCESOS.
DATA: BEGIN OF itab OCCURS 0,
num1(1),
num2(1).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename obligatory.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = p_file.
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 = 2
I_END_ROW = 5
TABLES
INTERN = itab
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.
ENDIF.
LOOP AT itab.
WRITE: / itab-num1, 10 itab-num2.
ENDLOOP.
Thanks in advance,
GerardTry function module
ALSM_EXCEL_TO_INTERNAL_TABLE
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_path
i_begin_col = 1
i_begin_row = 2
i_end_col = 70
i_end_row = 10000
tables
intern = i_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
P_PATH is file name with path.
I_EXCEL is internal table to store data.
declaration is "i_excel like structure alsmex_tabline"
then loop at i_Excel and populate your table
for eg
loop at i_excel.
case i_excel-col.
when '0001'.
i_data-compcode = i_excel-value.
when '0002'.
i_data-rcpttyp = i_excel-value.
when '0003'.
i_data-pocimpro = i_excel-value.
when '0004'.
i_data-tranno = i_excel-value.
when '0005'.
i_data-msrpo = i_excel-value.
when '0006'.
i_data-mporel = i_excel-value.
endcase.
at end of row.
append i_data.
clear i_data.
endat.
endloop. -
How to upload normal excell file to ztable
Hi All there,
Can anybody tell me how to upload normal excell file to ztable directly.
pl provide detail coding
Regards
SagarHi Sagar,
first upload the excel data into your internal table using a FM than upload the data to your ZTABLE using BDC.
parameters:
p_file type rlgrap-filename " File name
data:
lw_file type string. " File Path
data:
t_bdcdata type
standard table
of bdcdata,
fs_bdcdata type bdcdata. " Work area for bdcdata
* Messages of call transaction
data:
t_messtab type
standard table
of bdcmsgcoll,
fs_messtab type bdcmsgcoll. " Work area for messtab
at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
importing
file_name = p_file.
lw_file = p_file.
call function 'GUI_UPLOAD'
exporting
filename = lw_file
filetype = 'ASC'
has_field_separator = 'X'
dat_mode = 'X'
tables
data_tab = t_final_data
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif. " IF SY-SUBRC <> 0
if t_final_data is initial.
message 'File not found'(003) type 'E'.
endif. " IF T_FINAL_DATA IS INITIAL
end-of-selection.
perform upload_0585_data_using_bdc. " populate the bdcdata table using tcode SHDB
call transaction 'PA30' using t_bdcdata
mode 'A'
messages into t_messtab.
form upload_0585_data_using_bdc.
loop at t_final_data into fs_final_data.
perform bdc_field using 'Q0585-ACNTR(07)'
w_curr.
perform bdc_field using 'Q0585-ACOPC'
lw_flag.
perform bdc_field using 'BDC_OKCODE'
'=UPD'.
perform bdc_dynpro using 'MP058500' '2000'.
perform bdc_field using 'BDC_OKCODE'
'/EBCK'.
perform bdc_dynpro using 'SAPMP50A' '1000'.
endloop.
* Start new screen *
form bdc_dynpro using program dynpro.
clear fs_bdcdata.
fs_bdcdata-program = program.
fs_bdcdata-dynpro = dynpro.
fs_bdcdata-dynbegin = 'X'.
append fs_bdcdata to t_bdcdata.
endform. " Form bdc_dynpro using program...
* Insert field *
form bdc_field using fnam fval.
clear fs_bdcdata.
fs_bdcdata-fnam = fnam.
fs_bdcdata-fval = fval.
append fs_bdcdata to t_bdcdata.
endform. " Form bdc_field using fnam fval
With luck,
Pritam. -
Can not upload an excel file if it is opening.
I found I can not upload an excel file if it is opening(using) at same time. My questions are:
(1)How can I still upload an excel file even it is opening at same time? Or
(2)How to check the file which is opening(using) or not and give a pop-up message?
ThanksHi Michael,
(1) NO you can't.
(2) Yes you can check testing sy-subrc of "OPEN DATASET" or "GUI_UPLOAD"
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = x_file
has_field_separator = '#'
filetype = l_filetype
TABLES
data_tab = file_y
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
Hope this helps,
Erwan
Maybe you are looking for
-
Warning message in BW Report through Portal
Friends, I really need your help to remove the waring message. For the purpose of changing the description on the Selection screen from Cost Cetnters (Authorised Values) to Funds Centers I had changed the ZCCTRATI variable description to Funds Ce
-
I own CS6 and am happy with it. I have been a PS user since the second version so I have extensive experience with updates and the value I seek. I am an advanced amateur so this is a hobby, not a profit source and Adobe needs to consider us. No one w
-
Unable to install Os server - 2008 r2 (it stops on 20% - error about driver)
Hi guys. We have a server where we have sucessfully installed 2012 r2 std. We wanted to put TMG on it and we found information it supported only on 2008 r2 OS. We have tried reinstalling the OS on this server but we are having some issue in setup pha
-
Changing number of columns on master page, does not affect pages?
I create a master page. say three columns per spread. I go to actual pages, flow my type in with the loaded cursor and holding the shift key... it works like a charm... text flows in the three colums, adding pages until the end of the manuscript... N
-
I have just bought the Apple Component A V Cable for my Ipod Touch, using this cable to connect the Touch to my T V, I can display my photo library, video and You Tube, but will not let me display the internet, or my album covers on the TV screen. Wh