2010 Feb 25 9:55 AM
hello
I have a report that produce a alv and when I convert it to excel file using menu(list-save-file-excel spredsheet) I see some
field data is absent .really a field is include next fields data.
but ı can convert it properly using right click on alv and excel spredsheet (mhtml)
have you goy any ideas?
regards
2010 Feb 25 10:24 AM
check -ALV/ColoredOutput/Program.htm from saptechnical
regards,
Amruta
Edited by: amruta1 on Feb 25, 2010 11:25 AM
Edited by: amruta1 on Feb 25, 2010 11:26 AM
2010 Feb 25 11:04 AM
thanks for your reply but ı have already a alv output on screen but ı can not convert it properly to a excel spread sheet using alv menus.(list-save-file)
2010 Feb 25 11:14 AM
HI,
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
it_fieldcat = gt_fieldcat[]
i_save = gc_a
tables
t_outtab = ist_final[].
form set_pf_status using rt_extab type slis_t_extab. "#EC CALLED
set pf-status 'ZPP_NCO_STATUS_PTEI' excluding rt_extab.
endform.
form user_command using p_ucomm type sy-ucomm "#EC CALLED
wa_selfield type slis_selfield . "#EC CALLED
case p_ucomm.
* When user clicks on the Download button
when '&DOWNLOAD'.
call function 'F4_FILENAME'
importing
file_name = path1.
* rlgrap-filetype = 'DAT'.
refresh ist_fc_download.
loop at gt_fieldcat into wa_fieldcat.
wa_fc_download-fieldname = wa_fieldcat-seltext_l.
append wa_fc_download to ist_fc_download.
clear: wa_fc_download,wa_fieldcat.
endloop.
path = path1.
call function 'GUI_DOWNLOAD'
exporting
filename = path
filetype = 'ASC'
write_field_separator = 'X'
tables
data_tab = ist_final
fieldnames = ist_fc_download
exceptions
others = 22.
if sy-subrc <> 0.
message text-104 type gc_i.
endif.
describe table ist_final lines lv_lines.
concatenate lv_lines text-102 into lv_text separated by space.
* " 'Records Displayed'
message lv_text type gc_s.
wa_selfield-refresh = gc_x.
wa_selfield-row_stable = gc_x.
when 'OTHERS'.
clear p_ucomm.
endcase.
endform. "USER_COMMAND
Br
Ram
2010 Feb 25 11:32 AM
hi
can ı do it using menu items(list-save-file) ?
really tranfer is ok but not corretly
2010 Feb 25 12:02 PM
2010 Feb 25 11:45 AM
Hi,
Check your field catalog during debug. May be there some values are missing. Also check Value of your Layout
Edited by: Mukund Kansara on Feb 25, 2010 12:46 PM
2010 Feb 25 12:11 PM
2010 Feb 25 12:13 PM
2010 Feb 25 12:21 PM
not yet but ı think problem is about alv cataloq
there are 2 cataloq merged on screen
second alv cataloq is begining at x column on screen
ı think problem is begining point of 2 cataloq
thank you
2010 Feb 25 12:38 PM
Hi,
You can also try to take - 'Local file' option from application toolbar. (Func. code - %PC, ICON_EXPORT)
One more thing, Once I face the same problem (two fields data were merged when export in spread sheet).
At that time one of the field (material desc.) in few cases has only one inverted comma. (Like - "Service material for System )
Can you check is it the case? In such cases, for ALV to excel sheet - data merge or overwrite in next column.