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: 

internal table - excel file

Former Member
0 Kudos
129

how to move the contents of internal table to excel file with tab delimited. the excel file should be created dynamically with preloaded header information.the naming of the excel file also should change dynamically.

5 REPLIES 5

former_member189629
Active Contributor
0 Kudos
100

Rishi,

During debuggin right click and choose option save as excel or if you want to do it thru program you can use gui_download to do the job.

OR

Use the FM "RH_START_EXCEL_WITH_DATA" if your system has it.

OR u can use OLE concepts...

also

Check this out

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

http://www.sapdevelopment.co.uk/programs/custom/zdownempdata.htm

Reward if helpful,

Karthik

Former Member
0 Kudos
100

Hi,

Use the below function module

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

  • I_FIELD_SEPERATOR =

  • I_LINE_HEADER =

i_filename = p_fname "'D:\file1.xls'

  • I_APPL_KEEP = ' '

tables

i_tab_sap_data = input_rec "your internal table

  • CHANGING

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

Former Member
0 Kudos
100

The best way is to do by i_oi_spreadsheet.

It has several features , which makes the task easy. take a look at pkg SOFFICEINTEGRATION which has several examples on how to integrate Excel and ABAP.

Former Member
0 Kudos
100

Hi Rishi,

You can use GUI_download.

Former Member
0 Kudos
100

hi,

U can use the FM

Hi,

Use the below function module

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT',