Skip to Content
0
Former Member
Dec 22, 2009 at 08:54 PM

Minus sign at the end of the value, Need to get Preceeding minus sign.

76 Views

Hello gurus,

I am using following code in web dynpro to get data from a FM and downloading it to excel.

for the numeric values I am getting minus sign at the end of the value in excel. but If I display the value in alv, it is coming fine. Please let me know where I am going wrong.

ex: 4568-

CALL FUNCTION 'Z_EXTRACT'

EXPORTING

extract = z_extract

TABLES

it_data = tab_et.

DESCRIBE TABLE tab_et.

IF sy-tfill GT 0.

CLEAR: text, xtext.

DATA : v_fore9ldepl(17) TYPE n.

LOOP AT tab_et INTO rec_et.

  • MOVE:

WRITE: rec_et-fore9ldepl TO v_fore9ldepl DECIMALS 3.

CONCATENATE text '1'

rec_et-z0g_cwwter

v_fore9ldepl

  • cl_abap_char_utilities=>newline INTO text SEPARATED BY ','.

cl_abap_char_utilities=>newline INTO text SEPARATED BY

cl_abap_char_utilities=>horizontal_tab.

ENDLOOP.

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = text

IMPORTING

buffer = xtext.

CLEAR: filename, wa_files.

CONCATENATE 'EXTRACT' '.XLS' INTO filename.

wa_files-content = xtext.

wa_files-filename = filename.

APPEND wa_files TO files.

DATA izip TYPE REF TO cl_abap_zip.

DATA output_file TYPE xstring.

CREATE OBJECT izip.

LOOP AT files INTO wa_files.

izip->add( name = wa_files-filename

content = wa_files-content ).

ENDLOOP.

output_file = izip->save( ).

CALL METHOD cl_wd_runtime_services=>attach_file_to_response(

EXPORTING

i_filename = 'TEST.ZIP'

i_content = output_file

i_mime_type = 'ZIP/APPLICATION'

  • i_in_new_window = abap_false

i_in_new_window = abap_true

i_inplace = abap_false ).