on 10-09-2007 11:06 AM
Hi Peers,
I have a requirement where in I have to upload all the data from an Internal table to an Dataset.For this I m using:
OPEN DATASET p_ofile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT t_excel.
TRANSFER t_excel TO p_ofile.
ENDLOOP.
CLOSE DATASET p_ofile.
p_ofile is an .XLS file , t_excel is an Internal Table.
When the data is update in the p_ofile the Format of the data is not proper everything is on the first column of .xls file.
Could you please guide me in this regard.
Thanks,
Criag
Hi Daniel
You need to take other internal table with 2000 charecter length, then concatinate all the field to this Internla table with a Charecter return, so it will be displayed in teh excel sheet
Here is the sample program
LOOP AT it_headings_gro_plc. " Your INternal table
* Add tabs as the field separator, so that the file will be
* downloaded to the excel format
CONCATENATE
it_headings_gro_plc-prod " Product code
it_headings_gro_plc-type " Pre-format Type
it_headings_gro_plc-group " Pre-format Group Code
it_headings_gro_plc-code " Pre-format Code
it_headings_gro_plc-party " Party Name
it_headings_gro_plc-acct " Debit Acct No
it_headings_gro_plc-name " Chinese Name
it_headings_gro_plc-addr1 " Address 1
it_headings_gro_plc-addr2 " Address 2
it_headings_gro_plc-addr3 " Address 3
it_headings_gro_plc-method " Delivery method
it_headings_gro_plc-trans " Transaction cod e
it_headings_gro_plc-banka " Benficiary bank name
it_headings_gro_plc-bankn " Benficiary Count number
INTO it_report_out_tab SEPARATED BY g_separator. " G-Separator is the separator for the line feed,
" Beforre this one g_separator = cl_abap_char_utilities=>horizontal_tab.
APPEND it_report_out_tab. "New 2000 charecter Internal table
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
enable has field seperator in gui_upload function module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
First you load the Excel data into internal table outside the DATASET using available standard FMs.
Later use the OPEN DATASET, TRANSFER and CLOSE DATASET keywords inside a loop for each record of the first internal table and move the records one by one to a new internal table inside the DATASET loop and from there move to the Application server.
Hope this resolves your query.
Regards
Nagaraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.