Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

uploading data from spread sheet

Former Member
0 Likes
1,219

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,129

hi there....

to upload data into sap system, use gui_upload function module. or lsmw wil be helpful too...

regards'

Prem Sharma

12 REPLIES 12
Read only

Former Member
0 Likes
1,129

Hi,

Try fn, module GUI_UPLOAD

Read only

Former Member
0 Likes
1,129

Hi,

Upload data from spread sheet can be done with FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'

Read only

Former Member
0 Likes
1,129

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.

Read only

0 Likes
1,129

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.

Read only

Former Member
0 Likes
1,130

hi there....

to upload data into sap system, use gui_upload function module. or lsmw wil be helpful too...

regards'

Prem Sharma

Read only

0 Likes
1,129

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

Read only

Former Member
0 Likes
1,129

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

Read only

Former Member
0 Likes
1,129

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

Read only

Former Member
0 Likes
1,129

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.....

Read only

Former Member
0 Likes
1,129

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

Read only

Former Member
0 Likes
1,129

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.

Read only

Former Member
0 Likes
1,129

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.