2007 Apr 19 1:10 PM
Hi all
I need to create a file with Tab separation. I have a solution on a 4.7 system as shown below. But this does not work on a 4.6 system as the class does not exist.
How can I do this on a 4.6 system?
Thank you four your reply.
Herbert
CONSTANTS c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
LOOP AT t_material.
CONCATENATE
t_material-id
t_material-brand
t_material-desc
t_material-level
t_material-flag
INTO w_line
SEPARATED BY c_tab.
TRANSFER w_line TO w_file2.
ENDLOOP.
2007 Apr 19 1:16 PM
do this way...
Table to store final data
CONSTANTS: cns_09(2) TYPE n VALUE 09,
c_val1 TYPE c VALUE 'X'.
DATA: g_deli(1) TYPE c.
table to place delimiter
DATA: BEGIN OF it_hex,
tab TYPE x,
END OF it_hex.
ASSIGN g_deli TO <fs> TYPE c_val1.
it_hex-tab = cns_09.
<fs> = it_hex-tab.
LOOP AT t_material.
CONCATENATE
t_material-id
t_material-brand
t_material-desc
t_material-level
t_material-flag
INTO w_line
SEPARATED BY g_deli.
TRANSFER w_line TO w_file2.
ENDLOOP.
Hi all
I need to create a file with Tab separation. I have a solution on a 4.7 system as shown below. But this does not work on a 4.6 system as the class does not exist.
How can I do this on a 4.6 system?
Thank you four your reply.
Herbert
CONSTANTS c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
LOOP AT t_material.
CONCATENATE
t_material-id
t_material-brand
t_material-desc
t_material-level
t_material-flag
INTO w_line
SEPARATED BY c_tab.
TRANSFER w_line TO w_file2.
ENDLOOP.
2007 Apr 19 1:16 PM
do this way...
Table to store final data
CONSTANTS: cns_09(2) TYPE n VALUE 09,
c_val1 TYPE c VALUE 'X'.
DATA: g_deli(1) TYPE c.
table to place delimiter
DATA: BEGIN OF it_hex,
tab TYPE x,
END OF it_hex.
ASSIGN g_deli TO <fs> TYPE c_val1.
it_hex-tab = cns_09.
<fs> = it_hex-tab.
LOOP AT t_material.
CONCATENATE
t_material-id
t_material-brand
t_material-desc
t_material-level
t_material-flag
INTO w_line
SEPARATED BY g_deli.
TRANSFER w_line TO w_file2.
ENDLOOP.
2007 Apr 19 1:38 PM
2007 Apr 19 1:16 PM
hi,
Make use of ASCII value of TAB.
<b> constants : c_tab(2) type x value '09'.</b>
try to contatenate this constant instead of cl_abap_char_utilities=>horizontal_tab
Regarsd
Sailaja.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |