Problem in uploading excel file
HI ,
i need to upload a excel file, I am able to get records form excel to internal table, using ws_upload FM.
But i m getting a # in between every fields.
I have used split at '#' into field1 field2... but it is not working. Can anybody help me onthis.. plz..
Kumar
Hi I have encountered this problem too. After trying different solutions, I guess that FM 'GUI_UPLOAD' is
not supposed to upload an excel file. So please try FM 'TEXT_CONVERT_XLS_TO_SAP' as below. It works.
*: Description :
*: This is a simple example program to get data from an excel :
*: file and store it in an internal table. :
*: Author : www.sapdev.co.uk, based on code from Jayanta :
*: SAP Version : 4.7 :
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename. "To retrieve the upload file name
TYPES: BEGIN OF t_datatab,
col1(10) TYPE c,
col2(10) TYPE c,
col3(10) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of 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.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR = 'X'
i_line_header = 'X' "To ignore the header line(the first line) if it is '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.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
Similar Messages
-
Problem in Uploading excel file using WebDynpro for Java
Hi All
I have followed for Uploading excel file using WebDynpro for Java added by Tulasi Palnati
I done all, but I'm getting 500 Exception please contact u r system admin meag at run time also Jxl/Workbook class not found msag but i downloaded Jxl.jar file and there is no error signals in coding part. How can I solve the Problem.
Thanks
PolakaPlease ask the people in the Web Dynpro Java forum for a solution.
-
I have problem of uploading excel file to my internal table
Hi,
I trying to upload data from excel file to my internal table and when i tried to debug the program and check the data in internal table and iam gettin # in all the fields and the data in not populated in internal table , as we are using 4.0b version and we are using UPLOAD FUNCTION.
BUKRS(4) TYPE C,
PONO(8) TYPE C,
GRNNO(8) TYPE C,
DELNOTE(16) TYPE C,
RECPTDT(10) TYPE C,
SUPPCODE(20) TYPE C,
RECPT(12) TYPE C,
GLACCT(10) TYPE C,
CCTR(6) TYPE C,
CALL FUNCTION 'UPLOAD'
TABLES DATA_TAB = STRU.
IF SY-SUBRC NE 0.
WRITE: /'Data file error'.
ENDIF.
i am using the same sequeuence in the above structure in excel.Hi KODAMANCHILI,
Refer following link :
http://help.sap.com/saphelp_40b/helpdata/en/fc/eb3d9d358411d1829f0000e829fbfe/frameset.htm
This will surely solve your problem.
Regards,
Vivek -
Problem while uploading excel file to server
Hello,
I have created an excel file using OLE and saved it to local desktop. Then I use GUI_UPLOAD to upload the excel into SAP and attach it to mail. but while using Function GUI_UPLOAD I am getting dump for CNTL_ERROR.
If I skip the process of excel creation by OLE and passes the excel file created earlier then it gives no dump and is executed successfully.
Kindly help on this.Hi Suchendar,
Try using the FM - F4_FILENAME to get the valid file name and use TEXT_CONVERT_XLS_TO_SAP FM to upload into SAP based on the required format.
Regards,
Suresh -
SharePoint 2013 Foundation error when uploading Excel files
Hello
I have a specific problem. I have an xlsx file that I cannot upload in SharePoint. Normally our SharePoint can upload Excel files and other file formats normally but this one has data with nearly 5000 rows. The size of the file is less then 500 KB. The error
message is: "The URL is invalid. Perhaps it refers to a nonexistent file or folder, or it refers to a valid file or folder in the current Web." When I am uploading this file I am getting the same error message in every library. When I save
the file as a 97-2003 compatible xls then it works. Sometimes even Excel files with Macros won't upload.
Kind regards
ivicapro1987Hi,
This issue occurs when the Version column is configured as an Indexed Column.
To work around this issue, remove the Version column from the list of Indexed Columns for the list that has this issue. To do this, follow these steps:
Browse to the list where the issue exists.
In the ribbon, click the Library tab, and then click
Library Settings.
In the fields list, click Indexed Columns.
In the Indexed Columns list, click Version.
Click Delete, and then click OK.
Upload any files that you previously experienced the issue with.
Reference:
https://support.microsoft.com/kb/2796640?wa=wsignin1.0
Best Regards,
Eric
Eric Tao
TechNet Community Support -
How to upload excel file in Webdynpro application using ABAP
Hi Experts,
Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.
get single attribute
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.
Bind With table Element.
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_data = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_data->bind_table( T_TABLE1 ).
Thanks,
SubathraDear Exports
Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.
Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem.
Regards
Rashmita -
Error message while upload excel file (with macro) to sap (iw28)
While upload excel file to sap through iw28, i get error message (vb)
u2022 i have to say that the excel file contain macro , with out the macro , work fine .
u2022 The error display just in refresh command.
the error message :
Public Sub ALV_CUS_Exit()
Dim objs As ChartObjects
Dim obj As ChartObject
Dim sheet As Worksheet
Dim r As Range
For Each sheet In Sheets
Set objs = sheet.ChartObjects
For Each obj In objs
Set r = Sheets("RawData").UsedRange
obj.Chart.SetSourceData Source:=r
Next obj
Next sheet
End Subhi,
This is releated to the ABAP coding...There might be some ouput problem in the Abap list viewer...Pls check it with the ABAP consultant...
Regards
Priyanka.P -
Upload excel file in SAP BI-7.0
Hi ,
i need to upload an excel file in SAP BI 7.0 where the standard r/3 fm are not available.
Currently we uploading a file in CSV format but now we want to upload using XLS also.
ia way to upload excel file in SAP BI 7.0
Best Regards,
Sharad
Edited by: sharad narayan on Jan 7, 2011 10:58 AM
while searching the forum i found the fm MS_EXCEL_OLE_STANDARD_DAT .
but while using this FM i am getting the exception file not exist.
Kindlu suggest what to do
i even tried the FM TMP_GUI_GET_FILE_EXIST' to check the existence of the file.
even then same problem.
Please suggest
Edited by: sharad narayan on Jan 10, 2011 2:51 PMHi,
Scheduled jobs are the jobs for which we have scheduled for a time, may be daily so that each day the scheduled jobs will trigger at the time given.So that every time u need not to trigger the job manully urself as the schedule time will hit the job will trigger itself.
Released job means the job which is in between Sheduled state and active state.say For eg: 10 jobs are Scheduled in a queue Job no 1 is released from the queue that means any moment it will be in active state.So it is the state between Schedule and Active state of a job.
Thanks
Varun -
Uploading Excel file using 'ALSM_EXCEL_TO_INTERNAL_TABLE'
Hi,
I am uploading excel file into an internal table using 'ALSM_EXCEL_TO_INTERNAL_TABLE' FM.
but I'm getting a popup with the message
'There is a large amount of the information on the clipboard. Do you want to be able to paste this information into another programme later.' and there are three buttons in the popup 'YES', 'CANCEL' and 'NO'. but for any choice there is no data in the internal table.
the progrsm is working in other systems but giving problem in customer laptop, can you please tell me is there any settings need to set for EXCEL or SAP.
system details are as below
OS: windows 7
MS-Office - 2007
SAP : ECC06Looks like there was an intention to clear the clipboard in the code, but this does not seem to work.
I copied the function module to my own version and added the following code, which seems to work :
* clear clipboard
refresh excel_tab.
call method cl_gui_frontend_services=>clipboard_export
importing
data = excel_tab
changing
rc = ld_rc
exceptions
cntl_error = 1
* ERROR_NO_GUI = 2
* NOT_SUPPORTED_BY_GUI = 3
others = 4
* Copy only one cell to prevent the clipboard data message.
call method of worksheet 'Cells' = h_cell
exporting #1 = 1 #2 = 1.
m_message.
call method of worksheet 'Cells' = h_cell1
exporting #1 = 1 #2 = 1.
m_message.
call method of worksheet 'RANGE' = range
exporting #1 = h_cell #2 = h_cell1.
m_message.
call method of range 'SELECT'.
m_message.
* copy marked area (whole spread sheet) into Clippboard
call method of range 'COPY'.
m_message.
* quit Excel and free ABAP Object - unfortunately, this does not kill
* the Excel process
call method of application 'QUIT'.
m_message. -
Hi... maybe someone of you have been reading about how to upload excel files to an internal table using function module ALSM_EXCEL_TO_INTERNAL_TABLE.
The problem that I found with this technique is that it is not possible to use this FM with the SAP WAS because it gives a runtime dump (it only works if the file is on the client machine and if the function module is called from SAPGUI.
Then I have found the topic
Re: BSP and Excel
And one guy puts something interesting like this:
1. In the application use file upload to upload the file.
2. caputure the content and length
DATA: data TYPE REF TO CL_HTMLB_FILEUPLOAD.
data ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'fileUpload'
id = 'xx').
name = data->file_name.
content = data->file_content.
length = data->file_length.
content_type = data->file_content_type.
3. Then read the data using the class
DATA: conv TYPE REF TO CL_ABAP_CONV_IN_CE.
conv = CL_ABAP_CONV_IN_CE=>CREATE( input = CONTENT ).
conv->READ( importing data = Variable len = length ).
Now... has anyone continued with this sample? has anyone put the contents into an internal table (with the READ method)...
If someone did it please show me how to..
Thanks
ArielHi Craig,
Ok, I was reading the Thomas's Blog and the thread about excel. The blog talks about encoding and the thread is about how to "download" the table. I want to upload the excel to an internal table.
So, I am almost finishing the code.. But I have a problem (named DUMP) when I create the "conv" object (check the code) the problem is because I dont know how to call the create method indicating 'UFT-16' as encoding.
I show you my "OnInputProcessing" code:
IF button_event->id = 'btnUpload'.
fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(
request = request
id = 'txtFile'
name = 'fileUpload' ).
IF ( fileUpload->file_name NE '' ) AND
( fileUpload->file_length GT 0 ).
IF fileUpload->file_content_type
= 'application/vnd.ms-excel'.
DATA: content TYPE ZMTVEMAT,
conv TYPE REF TO CL_ABAP_CONV_IN_CE,
viewoff TYPE REF TO CL_ABAP_VIEW_OFFLEN,
it_off TYPE ABAPOFFLENTAB,
wa_off TYPE ABAPOFFLEN,
dd_fields TYPE DDFIELDS,
wa_fields TYPE DFIES,
len TYPE I.
conv = CL_ABAP_CONV_IN_CE=>CREATE(
encoding = 'UTF-16'
endian = 'L'
input = fileUpload->file_content ).
CALL FUNCTION 'TR_NAMETAB_GET'
EXPORTING
IV_TABNAME = 'ZMTVMAT'
IV_GET_LENGTHS_IN_CHARMODE = 'X'
IV_GET_TEXTS = ' '
IMPORTING
ET_DFIES = dd_fields.
LOOP AT dd_fields INTO wa_fields.
MOVE wa_fields-offset TO wa_off-ioff.
MOVE wa_fields-intlen TO wa_off-ilen.
APPEND wa_off TO it_off.
ENDLOOP.
viewoff = CL_ABAP_VIEW_OFFLEN=>CREATE( tab = it_off ).
conv->READ(
exporting
view = viewoff
importing
data = content
len = len ).
This is the DUMP
Runtime Errors CONVT_CODEPAGE_INIT
Exception CX_SY_CODEPAGE_CONVERTER_INIT
Occurred on 30.11.2004 at 13:20:47
The conversion of some code pages is not supported.
What happened?
The conversion of texts in code page 'UTF-' to code page '1100' is not
supported.
Thanks
Ariel -
Uploading excel files into Web UI
We are following the blog http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUI-UploadingdatafromExcelfiles
to upload excel files into Web UI.
The problem which we are facing is that the values are not getting populated in the text are and in the
event handler EH_ONSERVEREVENT, no values are being populated in lt_items table.
It would be great if someone could help us with this.Hi Nidhi,
I have tried the blog but due to some reason, could not get it worked out.
But, If U are ok to use CSV input files, instead of excel, U can use the standard component "GS_FILE_UPLOAD" as a popup and upload the files into the required assignment blocks. -
Can 'GUI_UPLOAD' to be used to upload excel file lonely?
Hi experts,
I wonder that can 'GUI_UPLOAD' to be used to upload excel file lonely. I tried and use 'asc' as the L_FILETYPE, but the data uploaded contain many '###yyy'. But if I save the excel file as a txt file,
the data can be uploaded by 'GUI_UPLOAD' correctly. So what is the problem?Excel files be can't uploaded using "GUI_UPLOAD".
Use the FM "ALSM_EXCEL_TO_INTERNAL_TABLE"
Try this code:
* Upload data direct from excel.xls file to SAP
REPORT ZEXCELUPLOAD.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
begcol TYPE i DEFAULT 1 NO-DISPLAY,
begrow TYPE i DEFAULT 1 NO-DISPLAY,
endcol TYPE i DEFAULT 100 NO-DISPLAY,
endrow TYPE i DEFAULT 32000 NO-DISPLAY.
* Tick don't append header
PARAMETERS: kzheader AS CHECKBOX.
DATA: BEGIN OF intern OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern.
DATA: BEGIN OF intern1 OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern1.
DATA: BEGIN OF t_col OCCURS 0,
col LIKE alsmex_tabline-col,
size TYPE i.
DATA: END OF t_col.
DATA: zwlen TYPE i,
zwlines TYPE i.
DATA: BEGIN OF fieldnames OCCURS 3,
title(60),
table(6),
field(10),
kz(1),
END OF fieldnames.
* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
value_0001(50),
value_0002(50),
value_0003(50),
value_0004(50),
value_0005(50),
value_0006(50),
value_0007(50),
value_0008(50),
value_0009(50),
value_0010(50),
value_0011(50),
value_0012(50),
value_0013(50),
value_0014(50),
value_0015(50),
value_0016(50),
value_0017(50),
value_0018(50),
value_0019(50),
value_0020(50),
value_0021(50),
value_0022(50),
value_0023(50),
value_0024(50),
value_0025(50),
value_0026(50),
value_0027(50),
value_0028(50),
value_0029(50),
value_0030(50),
value_0031(50),
value_0032(50),
value_0033(50),
value_0034(50),
value_0035(50),
value_0036(50),
value_0037(50),
value_0038(50),
value_0039(50),
value_0040(50),
value_0041(50),
value_0042(50),
value_0043(50),
value_0044(50),
value_0045(50),
value_0046(50),
value_0047(50),
value_0048(50),
value_0049(50),
value_0050(50),
value_0051(50),
value_0052(50),
value_0053(50),
value_0054(50),
value_0055(50),
value_0056(50),
value_0057(50),
value_0058(50),
value_0059(50),
value_0060(50),
value_0061(50),
value_0062(50),
value_0063(50),
value_0064(50),
value_0065(50),
value_0066(50),
value_0067(50),
value_0068(50),
value_0069(50),
value_0070(50),
value_0071(50),
value_0072(50),
value_0073(50),
value_0074(50),
value_0075(50),
value_0076(50),
value_0077(50),
value_0078(50),
value_0079(50),
value_0080(50),
value_0081(50),
value_0082(50),
value_0083(50),
value_0084(50),
value_0085(50),
value_0086(50),
value_0087(50),
value_0088(50),
value_0089(50),
value_0090(50),
value_0091(50),
value_0092(50),
value_0093(50),
value_0094(50),
value_0095(50),
value_0096(50),
value_0097(50),
value_0098(50),
value_0099(50),
value_0100(50).
DATA: END OF data_tab.
DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: <fs1>.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = '*.xls'
static = 'X'
CHANGING
file_name = filename.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Upload Error ', SY-SUBRC.
ENDIF.
END-OF-SELECTION.
LOOP AT intern.
intern1 = intern.
CLEAR intern1-row.
APPEND intern1.
ENDLOOP.
SORT intern1 BY col.
LOOP AT intern1.
AT NEW col.
t_col-col = intern1-col.
APPEND t_col.
ENDAT.
zwlen = strlen( intern1-value ).
READ TABLE t_col WITH KEY col = intern1-col.
IF sy-subrc EQ 0.
IF zwlen > t_col-size.
t_col-size = zwlen.
* Internal Table, Current Row Index
MODIFY t_col INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE t_col LINES zwlines.
SORT intern BY row col.
IF kzheader = 'X'.
LOOP AT intern.
fieldnames-title = intern-value.
APPEND fieldnames.
AT END OF row.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
DO zwlines TIMES.
WRITE sy-index TO fieldnames-title.
APPEND fieldnames.
ENDDO.
ENDIF.
SORT intern BY row col.
LOOP AT intern.
IF kzheader = 'X'
AND intern-row = 1.
CONTINUE.
ENDIF.
tind = intern-col.
CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
ASSIGN (zwfeld) TO <fs1>.
<fs1> = intern-value.
AT END OF row.
APPEND data_tab.
CLEAR data_tab.
ENDAT.
ENDLOOP.
CALL FUNCTION 'DISPLAY_BASIC_LIST'
EXPORTING
file_name = filename
TABLES
data_tab = data_tab
fieldname_tab = fieldnames.
*-- End of Program -
We developed a web site,There are file upload function.
Web site running on the NetWeaver
Can upload .rar .pdf .bin files. But when upload Excel file ,It Often failed,Occasionally, the success of.
I have imp notes for update sevletinputstreamreadtimeout parameter, now it is 180000.
Pls help meHi,
I have had issues with sporadic document upload problems. There are several SAP notes. Primarily there is an issue with Internet Explorer and keepalive timouts. Try each/all of these three options.
1) Examine the keepalivetimeout settings (see SAP note 900804)
2) Examine MaxRequestContentLenght setting (see SAP note 898637)
3) Ensure that your Temporary directories for the J2EE server are set correctly use the Config Tool to add new parameters
-Djava.io.tmpdir=[a suitable temp directory ([SID]ADM user needs read write acces)]
-Dcm.tmpdir=e:\EP_TEMP (example) (see SAP Note 898637)
Hope this helps
Regards
Alex -
hi all.
i am using forms 11g R2 and windows 7 64bit over laptop.
i want to upload excel file to oracle form 11g r2.
i got an error on time field here is the error.
FRM-50022:Time must be entered in format like FXFMHH24:MI:SSdatatype is time and i used this format as a format mask in form for time field.
fxfmhh24:mi:ss
plz suggest me how to resolve this error?yup
i am using client_ole2 and i have.
cell_value :=Client_OLE2.get_char_property(cell, 'Value');texts and numbers are working fine but problem is in time column.Might be excel time format and forms format are not matching.
i searched through error code on google, i did not find anything related that error. -
How to upload Excel file in BI using function module in abap program
How to upload Excel file in BI using function module in abap program?
Hi Anuj,
To upload the file , you can try a standard program "RSEPSFTP" .
while you execute the program , a selection screen appears in which the inputs should be give as
RFC destination - The target server name
FTP command- PUT
local file - your file name
local directory - path of your local file
remote file - your target file name
remote directory - where it has to be stored
Hope this is useful for you
Thanks & regards
Anju
Maybe you are looking for
-
Opening stock will be the closing stock of previous date
Hi All, Good day. I am developing an ALV report that will show opening stock(LABST) as well as closing stock(Calculated) for a range of date and materials. Problem here is that from MARD table I am getting only the last opening stock, because it has
-
Problem creating Techincal system as my R/3 system on different LAN
Hello friends Our r/3 system with host name [ps0784] is on different LAN hence accessible only by IP or if we give its complete name like ps0784.persistent.co.in But here the problem is, when we try to create a Technical system in SLD for ps0784 usin
-
Why is InDesign is using fake small caps instead of the real ones included in the font?
I was trying to use the small caps in Hoefler Text, which I did by hitting the small caps button. Instead of using real small caps (which should be in proportion to the capitals), InDesign created fake small caps by scaling down the capitals (which i
-
FAGLB03 has 2 same column name called 'Transaction Currency' when drilled
Hi Experts, I'm in ECC5 , Tcode FAGLB03 When I drill down into each line item,the coming screen has 2 columns with same name ,called 'Transaction Currency' Sometime amount from both column are same but sometime they aren't. Please advise , How differ
-
Hi All, When i enter in KE30 report , i can only see two coloum report & description . to view other coloumns like User Nmae, Date Creatd, Form etc, i have to expand the view screen manually. Here my reuirement is that when i enter in KE30 report,