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: 

Excel Download

Former Member
0 Kudos

I need to download an Internal table into excel sheet. While down loading, if the sum of any one of the columns in the internal table is 'Zero', that column should not be displayed in the excel sheet. Can any body tell me the solution for this ASAP.

5 REPLIES 5

Former Member
0 Kudos

Hi ,

Use the function " WS_EXCEL " for download the data in to an

excel sheet.

****do reward if usefull

Vijay

Former Member
0 Kudos

hi check this..

REPORT ZTESTPROG003.

TYPES:

BEGIN OF ty_upload,

matnr like mara-matnr,

meins like mara-meins,

mtart like mara-mtart,

mbrsh like mara-mbrsh,

END OF ty_upload.

DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.

DATA wa_upload TYPE ty_upload.

DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'

i_begin_col = 1

i_begin_row = 1

i_end_col = 4

i_end_row = 65535

TABLES

intern = itab.

if not itab[] is initial.

loop at itab .

case itab-col.

when '0001'.

it_upload-matnr = itab-value.

when '0002'.

it_upload-meins = itab-value.

when '0003'.

it_upload-mtart = itab-value.

when '0004'.

it_upload-mbrsh = itab-value.

append it_upload.

clear it_upload.

clear itab.

endcase.

regards,

venakt.

Former Member
0 Kudos

hii

you can use the function module XXL_FULL_API. The Excel sheet which is generated by this function module contains the column headings and the key columns are highlighted with a different color. Other options that are available with this function module are we can swap two columns or supress a field from displaying on the Excel sheet.

CALL FUNCTION 'XXL_FULL_API'

EXPORTING

  • DATA_ENDING_AT = 54

  • DATA_STARTING_AT = 5

filename = 'TESTFILE'

header_1 = header1

header_2 = header2

no_dialog = 'X'

no_start = ' '

n_att_cols = 6

n_hrz_keys = 1

n_vrt_keys = 4

sema_type = 'X'

  • SO_TITLE = ' '

TABLES

data = t_sflight

hkey = t_hkey

online_text = t_online

print_text = t_print

sema = t_sema

vkey = t_vkey

EXCEPTIONS

cancelled_by_user = 1

data_too_big = 2

dim_mismatch_data = 3

dim_mismatch_sema = 4

dim_mismatch_vkey = 5

error_in_hkey = 6

error_in_sema = 7

file_open_error = 8

file_write_error = 9

inv_data_range = 10

inv_winsys = 11

inv_xxl = 12

OTHERS = 13

reward points if useful.

Former Member
0 Kudos

hi Priyanka,

use FAA_FILE_UPLOAD_EXCEL function module

depending up on the value passing

do reward points if useful.

Regards

Amit

Former Member
0 Kudos

Hi,

try to create an internal table that contains only the records to be outputted, then use gui_download to save an excel based on this table.

rgs