09-12-2008 8:50 AM
Hi,
I am getting a problem while writing data to a flat file.
Suppose I am writing two strings continuously
Str1: "SAP.#"
STR2 : "Germany"
It should write as SAP#Germany.
But Germany is been shifted to the next line i.s I am getting a line break.
ie. "SAP#"
"Germany"
Regards,
Sumeet
09-12-2008 9:00 AM
hiii
if you are using GUI_DOWNLOAD then try using TRUNC_TRAILING_BLANKS_EOL = SPACE parameters.
regards
twinkal
09-12-2008 9:05 AM
Hi...
Please see the test code..
REPORT z_subha_test3.
TYPES : BEGIN OF x_data,
f1 TYPE char70,
END OF x_data.
data: i_data TYPE STANDARD TABLE OF x_data,
wa_data TYPE x_data,
l_file_path TYPE string.
CONCATENATE 'SAP.#' 'Germany' INTO wa_data-f1.
append wa_data to i_data.
l_file_path = 'C:\Documents and Settings\Administrator\Desktop\abc.txt'.
Download souce code into into a file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_file_path
filetype = 'ASC'
TABLES
data_tab = i_data[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc = 0.
ENDIF.
09-12-2008 9:07 AM
Hi,
The strings are coming from READ_TEXT function module and then written to the file.
Regards,
Sumeet
09-12-2008 9:37 AM
Hi Sumeet,
All the special characters that are taken from external source are saved in the form of '#' in SAP . However, this value is different from teh normal hash symbol. So I believe teh value you are getting in the string1 is nothing but the new line character which represents that the next character followed by this string will come in next line.
Hope this will help.
Regards,
Swarna Munukoti.