2007 Nov 10 2:09 AM
Hi SAP Gurus,
I am using statment
TRANSFER g_str TO p_unixf LENGTH 512.
to write the <i>g_str</i> to UNIX file <i>p_unixf</i>
I have some <b>BLANK</b> spaces at the end of each record which I want to retain in the UNIX FILE.
But TRANSFER statment writes only character ignoring the BLANK spaces at the end.
All the record length should be of 512 in UNIX FILE irrespective of what data contains in the record.
Help is much appreciated!
Thanks
Shital
I m not in front of system..but it is not that hard just give your self a try and if any issue comes let me know.
2007 Nov 10 2:15 AM
Hi Shital,
TRANSFER will write blank also. Just do one thing add "end of line"(EOL) character as the last character in each line of your file.
Cl_ABAP_CHAR_UTILITIES=>CR_LF is the EOL character (Carriage return+line feed)
Regards,
Atish
Message was edited by:
Atish Sarda
2007 Nov 10 2:19 AM
2007 Nov 10 2:21 AM
I m not in front of system..but it is not that hard just give your self a try and if any issue comes let me know.
2007 Nov 10 2:47 AM
2007 Nov 10 4:19 AM
Hi Shital,
Can you paste your code. How are you looking at file?
Regards,
Atish
2009 May 10 6:24 PM
2009 Sep 08 6:48 PM
Try use a field type X at end of structure of internal table will be transfered to file.
For each line of internal table, place at type X field the value "0D" (CR).
DATA: BEGIN OF ti_file OCCURS 0,
tipo(3),
space1(1),
seq(4),
cnpj(14),
ano(1),
retif(1),
stcd1(6),
valor(14),
cnae(7),
space10(10),
cr TYPE vv_crlf VALUE '0D', "Use this field to line wrap with spaces
END OF ti_file.
For each line of ti_file:
LOOP AT ti_file.
" Fill the fields
ti_file-cr = '0D'.
APPEND ti_file.
CLEAR ti_file.
Regards,
Leonardo Valente
Edited by: Leonardo Valente on Sep 8, 2009 2:48 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |