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: 

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

Former Member
0 Kudos

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.

3 REPLIES 3

former_member303542
Participant
0 Kudos

hello,

I think you can remove the legacy option while writing the file to application server.

Try this optuion once.

0 Kudos

Hi Naveen,

thanks for your reply,

i already tried and the result still the same. any idea?

Best Regard,

Akbar.

Former Member
0 Kudos

you can try this

OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT

WITH SMART LINEFEED.