Application Development 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: 

ALSM_EXCEL_TO_INTERNAL_TABLE

Former Member
0 Kudos

hai i am using to upload data from excel sheet to internal table using the ALSM_EXCEL_TO_INTERNAL_TABLE functin module it is working fine, but if i do it in background it is giving error that it is only for foreground is there any function module to run code in back ground

regards

afzal

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

hi Afzal,

ALSM_EXCEL_TO_INTERNAL_TABLE works only in foreground (because it reads he file from presentation server). In background you can only read data from application server (this means GUI_DONWLOAD and GUI_UPLOAD won't work neither).

ec

PS.: Don't reward if not helpful!

7 REPLIES 7

Former Member
0 Kudos

Hi,

USE FM gui_download.

Check this,

/people/harry.dietz/blog/2005/11/11/yet-another-from-database-or-internal-table-to-excel

Tou can use this FM also,

CALL FUNCTION 'WS_EXCEL'

EXPORTING

FILENAME = 'C:/RAMU.XLS'

  • SYNCHRON = ' '

TABLES

DATA = LT_EXCEL " internal table u want to download to excel

  • EXCEPTIONS

  • UNKNOWN_ERROR = 1

  • OTHERS = 2

UPLOAD / Download Programs to PC

http://abap4.tripod.com/Upload_and_Download_ABAP_Source_Code.html

http://www.sapgenie.com/abap/code/abap13.htm

http://sap.ittoolbox.com/code/archives.asp?d=3333&a=s&i=10

http://www.sap-img.com/abap/download-and-upload-your-abap-program.htm

http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html

Thanks,

JozsefSzikszai
Active Contributor
0 Kudos

hi Afzal,

ALSM_EXCEL_TO_INTERNAL_TABLE works only in foreground (because it reads he file from presentation server). In background you can only read data from application server (this means GUI_DONWLOAD and GUI_UPLOAD won't work neither).

ec

PS.: Don't reward if not helpful!

abdulazeez12
Active Contributor
0 Kudos

Hi

USe GUI_UPLOAD if you want to upload the excel data to internal table..Just declare the internal table with the fields u r uploading using the excel sheet and call the function module GUI_UPLOAD.

Reward if helpful..

Former Member
0 Kudos

Hi Mohammad,

See the link below: -

http://www.sapdevelopment.co.uk/file/file_upexcel.htm

Reward points for helpful answers.

Regards,

Hk

Former Member
0 Kudos

Hi

Function module EXCEL_OLE_STANDARD_DAT can be used to start Excel with a new sheet and transfer data from an internal table to the sheet

Former Member
0 Kudos

ok

Former Member
0 Kudos

Hi,

try with the bewlo code.It may help you.

parameters: pc_file like rfpdo-rfbifile obligatory.

data : begcol type i value 1,

begrow type i value 2,

endcol type i value 20,

endrow type i value 1000.

data: begin of tbl_intern occurs 0.

include structure alsmex_tabline.

data: end of tbl_intern.

-


form upload_excel.

refresh: tbl_excel_data, tbl_intern.

call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'

exporting

filename = pc_file

i_begin_col = begcol

i_begin_row = begrow

i_end_col = endcol

i_end_row = endrow

tables

intern = tbl_intern

exceptions

inconsistent_parameters = 1

upload_ole = 2

others = 3.

if sy-subrc <> 0.

write:/ 'Upload Error ', sy-subrc.

endif.

sort tbl_intern by row col.

  • Populate the Internal table with File data.

loop at tbl_intern.

case tbl_intern-col.

when 1.

tbl_excel_case_convert_data-index = tbl_intern-value .

tbl_field1-index = tbl_intern-value.

tbl_field2-index = tbl_intern-value.

tbl_field3-index = tbl_intern-value.

tbl_field4-index = tbl_intern-value.

tbl_field5-index = tbl_intern-value.

tbl_field6-index = tbl_intern-value.

tbl_field7-index = tbl_intern-value.

tbl_field8-index = tbl_intern-value.

tbl_field9-index = tbl_intern-value.

tbl_field10-index = tbl_intern-value.

tbl_field11-index = tbl_intern-value.

when 2.

tbl_excel_case_convert_data-rg = tbl_intern-value.

when 3.

tbl_excel_case_convert_data-st = tbl_intern-value.

when 4.

tbl_excel_case_convert_data-desc = tbl_intern-value.

when 5.

tbl_excel_case_convert_data-rcodes = tbl_intern-value.

endcase.

at end of row.

append tbl_excel_case_convert_data.

append tbl_field1.

append tbl_field2.

append tbl_field3.

append tbl_field4.

append tbl_field5.

append tbl_fieldusd5.

append tbl_field6.

append tbl_field7.

append tbl_field8.

append tbl_field9.

append tbl_field10.

append tbl_field11.

append tbl_field12.

clear tbl_field1.

clear tbl_field2.

clear tbl_field3.

clear tbl_field4.

clear tbl_field5.

clear tbl_fieldusd5.

clear tbl_field6.

clear tbl_field7.

clear tbl_field8.

clear tbl_field9.

clear tbl_field10.

clear tbl_field11.

clear tbl_field12.

clear tbl_excel_case_convert_data.

endat.

endloop.

endform. " Upload_Excel

-


Regds

Sivaparvathi

Please reward points if helpful