on 12-22-2009 8:54 PM
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 ).
Hi,
In the Context attribute tyr to use the properties of formatting where you can have the MINUS sign in the front of the value..
If this is working fine then when you use any standard export of ALV the same (AS iS) is shown in Excel right...
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.