12-14-2009 1:48 AM
Hi Experts,
i am facing a problem when create excel file in application server using OPEN DATASET command.
the internal table have 4 field and one of those field contains 19 digit number --> ICCID.
the code running well, successfully create EXCELfile in application server but the problem is SAP only copy exactly first 15 digit numeric only and the rest became zero 0
Example :
the field value in internal table is 8962118800000447654 but when i opened in the excel file the value became 8962118800000440000.
and if i add alphabet like a8962118800000447654 then it is correct.
is there is anything wrong with my code?
here is my code
CONSTANTS: c_tab TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab. "Tab Char
Data : begin of lt_zdsdmmdt00005 occurs 0,
SERNR (18) type c,
MSISDNl(20) type c,
BOX1 (20) type c,
ICCID(30) type c,
end of lt_zdsdmmdt00005.
data : ld_temp(100) type c.
i_file = '/usr/sap/DM/test_excel.xls'.
open dataset i_file for output in legacy text mode.
loop at lt_zdsdmmdt00005.
move lt_zdsdmmdt00005-ICCID to ld_iccid .
concatenate lt_zdsdmmdt00005-sernr lt_zdsdmmdt00005-MSISDN lt_zdsdmmdt00005-BOX1 ld_iccid
into ld_temp separated by c_tab.
transfer ld_temp to i_file.
endloop.
close dataset i_file.
Best Regard,
Akbar.
12-14-2009 10:08 AM
hello,
I think you can remove the legacy option while writing the file to application server.
Try this optuion once.
12-14-2009 12:57 PM
Hi Naveen,
thanks for your reply,
i already tried and the result still the same. any idea?
Best Regard,
Akbar.
12-14-2009 2:59 PM
you can try this
OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
WITH SMART LINEFEED.