2008 Jan 23 2:27 PM
I want to write an internal table to an EXCEL file on application server. The problem is that all columns in the internal table are merged and written to 1st column in excel sheet. I want it in seperate columns.
I am using following code.
OPEN DATASET y_lv_filename FOR OUTPUT IN LEGACY TEXT MODE.
IF sy-subrc EQ 0.
LOOP AT p_y_i_file INTO y_wa_ymdcoseph.
TRANSFER y_wa_ymdcoseph TO y_lv_filename.
ENDLOOP.
IF sy-subrc EQ 0.
Close File On Application server
PERFORM y_f_close_file_0700 IN PROGRAM yti_utility_routines
USING y_lv_filename
CHANGING y_v_subrc.
ENDIF.
2008 Jan 23 2:58 PM
Hi,
For this you need to create a tab delimited file and upload the same.
If you are using 4.6C or below, declare the tab variable as Hexadecimal else you can use class ABAP_CHAR_UTILITIES>>Horizontal Tab.
Just check the right name of the class in system.
Hope this would be helpful.
Regards,
Lalit Kabra
Hi,
For this you need to create a tab delimited file and upload the same.
If you are using 4.6C or below, declare the tab variable as Hexadecimal else you can use class ABAP_CHAR_UTILITIES>>Horizontal Tab.
Just check the right name of the class in system.
Hope this would be helpful.
Regards,
Lalit Kabra
2008 Jan 23 2:55 PM
see below sample program from application server to presentation server for view data...
data : fp_v_filepath type string.
fp_v_filepath = 'C:\BDC.prn'. * PRN (file extension
used notepad)
data : begin of it_data occurs 0,
age(4),
name(15),
end of it_data.
data : begin of wa_data,
age(4),
name(15),
end of wa_data.
*Open the file and transfer the data into the internal table
open dataset fp_v_filepath " give the file path
for
input in text mode encoding default.
if sy-subrc = 0.
do.
read dataset
fp_v_filepath "again file path
into wa_data .
if sy-subrc = 0.
append wa_data to it_data. "it_data the same structure as of your flat file + workarea same structure
clear wa_data.
else.
exit.
endif.
enddo.
endif.
loop at it_data into wa_data.
write : / wa_data-age , wa_data-name.
endloop.
<REMOVED BY MODERATOR>
s.suresh.
Edited by: Alvaro Tejada Galindo on Jan 23, 2008 12:13 PM
2008 Jan 23 2:58 PM
Hi,
For this you need to create a tab delimited file and upload the same.
If you are using 4.6C or below, declare the tab variable as Hexadecimal else you can use class ABAP_CHAR_UTILITIES>>Horizontal Tab.
Just check the right name of the class in system.
Hope this would be helpful.
Regards,
Lalit Kabra
2009 Oct 21 9:26 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |