‎2007 Dec 28 4:20 PM
How can I insert a tab in a file that is created using OPEN DATASET / CLOSE DATASET.
I found some threads that talks about that but nothing work to me. I tried to concatenate all fields that i wanna display separeteb by a variable that I declared as a hexa with value 09 (TAB).
I appreciate all kind of help.
‎2007 Dec 28 4:24 PM
DATA : wa_file TYPE string,
IF NOT p_ufile IS INITIAL.
OPEN DATASET p_ufile FOR OUTPUT IN TEXT MODE.
IF sy-subrc <> 0.
EXIT.
ENDIF.
LOOP AT p_output INTO wa_file.
concanate ur hexa varaible here <<<<<<<<
TRANSFER wa_file TO p_ufile.
CLEAR wa_file.
ENDLOOP.
CLOSE DATASET p_ufile.
‎2007 Dec 28 4:33 PM
I did that. Plz see my code:
DATA: vl_file(1000) type c,
vl_tab type x value '09'.
LOOP AT t_lista into wa_export
CLEAR: vl_file.
CONCATENATE wa_export-fiel1 wa_export-fiel2
.... wa_export-fiel8
INTO vl_file SEPARATED BY vl_tab.
vl_tamanho = STRLEN( vl_file ).
TRANSFER vl_file TO p_arq LENGTH vl_tamanho.
ENDLOOP.
Am i doing something wrong ?
Appears a message saying that I can concatenate variables only type C, N , D, T or STRING.
‎2007 Dec 28 4:39 PM
ur code looks good .. but to fix ur issue I would prefer to go with the use of field -s ymbols.
field-symobls : <fs_export> type wa_export.
LOOP AT t_lista assigning <fs_export>
CLEAR: vl_file.
CONCATENATE <fs_export>-fiel1 <fs_export>-fiel2
.... <fs_export>-fiel8
INTO vl_file SEPARATED BY vl_tab.
when ever u have this type of type conflict better use field symbols.
‎2007 Dec 28 4:44 PM
But the problem is not that. The variable vl_tab is type HEX and I CAN'T concatenate an HEX variable type.
‎2007 Dec 28 4:48 PM
co_line_feed TYPE x VALUE '0D'. <<<<<<<line feed the hex value..
CONCATENATE lf_line co_line_feed INTO lf_line.
APPEND lf_line TO p_output_file.
CLEAR lf_line.
‎2007 Dec 28 4:57 PM
Sry but the problem continues. Same message:
co_line_feed must be a character-type data object ( data type C, N, D, T or STRING ). field string.
I use 4.6 C version. Can be my version the motive because is not working ??
‎2007 Dec 28 6:35 PM