‎2008 Jun 12 3:48 PM
Hi all,
i am using this function module for uplaod CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
which is working fine if i upload the data from text file like notepad but if i am trying to upload it from exel or spreadsheet it is not uploading the excat data is loading some junk data. please give me the reply i am running behind the schedule.
‎2008 Jun 13 4:58 AM
hi there....
to upload data into sap system, use gui_upload function module. or lsmw wil be helpful too...
regards'
Prem Sharma
‎2008 Jun 12 4:00 PM
‎2008 Jun 12 4:58 PM
Hi,
Upload data from spread sheet can be done with FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'
‎2008 Jun 13 4:43 AM
Hi,
For Excel you have to use the function module ,
'ALSM_EXCEL_TO_INTERNAL_TABLE'
Pass all these parameters according to your recording....
exporting
FILENAME = P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 4
I_END_COL = 21
I_END_ROW = 9999
tables
INTERN = IT_EXCEL
Thanks.
Swati.
‎2008 Jun 26 8:48 PM
Hi Guru,
i have tried putting the module what you have recomended still it is not working from portal, it is working fine when i upload from GUI. i really apprecite the answers i have got from all of the respected fellows.
‎2008 Jun 13 4:58 AM
hi there....
to upload data into sap system, use gui_upload function module. or lsmw wil be helpful too...
regards'
Prem Sharma
‎2008 Jun 13 9:47 AM
GUI_UPLOAD always collects converted data in the internal table.
You need to convert the data using FM ALSM_EXCEL_TO_INTERNAL_TABLE.
Regards
Megha
Edited by: Eclectic on Jun 13, 2008 2:19 PM
‎2008 Jun 13 6:30 PM
Hi,
Try with function module: 'TEXT_CONVERT_XLS_TO_SAP'.
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.
Regards,
Bhaskar
‎2008 Jun 15 12:12 PM
Hi,
U can try the following code :
report zdemo_program .
types: begin of t_excel,
fld1(20) type c,
fld2(20) type c,
fld3(20) type c,
end of t_excel.
data: it001 type table of t001.
data: xt001 type t001.
data: iexcel type table of t_excel.
data: xexcel type t_excel.
select * into table it001 from t001.
xexcel-fld1 = 'Field 1'.
xexcel-fld2 = 'Field 2'.
xexcel-fld3 = 'Field 3'.
append xexcel to iexcel.
loop at it001 into xt001.
xexcel-fld1 = xt001-bukrs.
xexcel-fld2 = xt001-butxt.
xexcel-fld3 = xt001-ort01.
append xexcel to iexcel.
endloop.
call method cl_gui_frontend_services=>gui_download
exporting
filename = 'C:/test.xls'
write_field_separator = 'X'
changing
data_tab = iexcel.
Regards,
Biswanath
‎2008 Jun 16 8:05 AM
hi.....
when you are using gui_upload function...chect the file type which you have given....
For text file the fil type is DAT and for excel file the file type is ASC....
filename = file
filetype = 'ASC'
MAYBE THATS THE REASON....
just check an let me know.....
‎2008 Jun 17 8:10 AM
Use ALSM_EXCEL_TO_INTERNAL_TABLE -
> To upload excel data.
GUI_UPLOAD -
>To upload flat file data.
Rewards points...........
Edited by: Murali Krishna Makineni on Jun 17, 2008 9:11 AM
‎2008 Jun 27 5:58 AM
for excel files there are some other FM like
ALSM_excel_to_internal_table and many other like to upload different sheet of a excel file for details go to the link below...
http://www.sap-img.com/abap/uploading-multiple-multitab-excel-sheets-or-ranges.htm
with luck,
pritam.
‎2008 Jun 27 6:29 AM
Hi,
Use the Function Module TEXT_CONVERT_XLS_TO_SAP.
I hope this will help you.
Help children of U.N World Food Program by rewarding points and encourage others to answer your queries.