‎2008 Apr 05 7:30 AM
Hi Gurus,
I facing a problem with ALV. When an ALV report is exported to Spreadsheet file (Exce file) two columns are giving follwing proble.
1. First column doesnot display left side zeros of dcoument no when exprted to excel. for example- 0000245487 to 245487.
2 in Another column right two digit are trucated when exported to excel. for examples 0000245487 to 2454.
What may be the prblem.
\[removed by moderator\]
Regards
Rajesh
Edited by: Jan Stallkamp on Jul 21, 2008 2:35 PM
‎2008 Apr 05 7:33 AM
first problem is because MS EXCEL doesnot allow u to have leading zeros.
try typing 000123456 and press enter.. the leading zeros will vanish.
second prob mite be because the col width in excel is not sufficient enuf. i guess so.
pk
‎2008 Apr 05 7:58 AM
I too faced this problem. It is problem with excel.
This method by putting filetype as DBF in FM GUI_DOWNLOAD will defnetly help you, but this is obselete form of writing.
ofname is the file destinataion.
it_data is the internal table.
Syntax.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = ofname
filetype = 'DBF'
write_field_separator = 'X'
TABLES
data_tab = it_data.
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
\[removed by moderator\]
Thanks,
Imran.
Edited by: Jan Stallkamp on Jul 21, 2008 2:35 PM
‎2008 Apr 05 8:47 AM
‎2008 Apr 07 7:41 AM
HEY have you passed NO_ZERO parameters when define fieldcatlog
‎2008 Apr 18 4:48 AM
Hello.
Look into SAP Note 213427. It corrects this problem.
😃
‎2008 Apr 18 5:21 AM
Hi Rajesh,
May be the following FM will be useful, to download the data from ALV to Excel in the same format as ALV.
1. GUI_Download:
In this FM in the parameter Filetype give the value as DBF i.e.
Filetype = DBF.
THe data gets downloaded perfectly.
2. SAP_CONVERT_TO_XLS_FORMAT
This FM also downloads the data to excel in the same format as ALV.
\[removed by moderator\]
Thanks,
Edited by: Jan Stallkamp on Jul 21, 2008 2:35 PM