Skip to Content
0
Former Member
Dec 14, 2009 at 01:48 AM

Create Excel file in application server but the field value is incorrect

46 Views

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.