on 06-01-2007 3:05 PM
Hi,
can any one tell me how I supply a file from the application server to the parameter "I_CONTENT" of method "attach_file_to_response" as type xstring.
Thanks in advance
C
Hi,
you can use the fm SCMS_BINARY_TO_XSTRING to convert your file content on AS from binary to xstring and pass the output of the above fm to the parameter i_content of the method attach_file_to_response.
Regards,
Shweta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Shweta,
this is my code and although the functionality of opening the file in Excel or saving the file as Excel works, when I open the file there is an initial column at the start that I can't get rid of.
In your example, are you reading the data in line by line, i.e. read dataset? If you are, surley the output of the file would be the same as my example with an initial column. Produced I think by the Concatenation.
CURRENT CODE
open dataset lv_dataset for input in text mode
encoding default.
do.
read dataset lv_dataset into wa.
if sy-subrc ne 0.
exit.
endif.
concatenate: lv_string_s
wa
cl_abap_char_utilities=>cr_lf into lv_string_s
separated by cl_abap_char_utilities=>horizontal_tab.
enddo.
close dataset lv_dataset.
cl_abap_conv_out_ce=>create( receiving conv = lr_conv ).
lr_conv->convert( exporting data = lv_string_s
importing buffer = lv_xfile ).
cl_wd_runtime_services=>attach_file_to_response(
exporting i_filename = i_filename
i_content = lv_xfile "<hex_container>
i_mime_type = 'application/vnd.ms-excel' ).
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.