10-04-2008 12:32 PM
Hi Experts,
I need to add a 40 spaces end of each record in a downloaded text file.
But i'm not able to achieve these spaces end of each record.
Thanks.
Regards
Balaji
10-04-2008 12:37 PM
DATA : A(1).
DO 40 TIMES.
CONCATENATE A SPACE INTO A.
ENDDO.
Now Concatenate A in your last record.
Thanks
Piyush
10-04-2008 12:39 PM
try this:
data v_space type string,
data:
"Local variable for a single SPACE
l_v_char type string.
clear v_space.
" Calling this metode a space is assigned to L_V_CHAR
call method cl_abap_char_utilities=>get_simple_spaces_for_cur_cp
receiving
s_str = l_v_char.
" Populating the variable for spaces
do 40 times.
concatenate l_v_char+0(1) v_space into v_space.
enddo.
" now v_space will have 40 spaces
Edited by: Sourav Bhaduri on Oct 4, 2008 5:10 PM
10-04-2008 9:44 PM
Hi,
I have the same problem. But i dont have below below class in the 4.6c. Can you please advice how can we do in 4.6c. I tried with concatenate but it didn't work out. please advice.
Thanks in advance
10-05-2008 9:37 AM
Check out this code...hope this will work on 4.6C
PARAMETERS: p_file TYPE rlgrap-filename
default 'C:\Documents and Settings\Sourav\Desktop\test63.txt'.
DATA: BEGIN OF s_data,
data TYPE char10,
dummy(40) TYPE c,
cr_lf(2) TYPE x VALUE '09',
END OF s_data.
DATA: t_data LIKE TABLE OF s_data.
s_data-data = 'Test'.APPEND s_data TO t_data.
s_data-data = 'Test2'.APPEND s_data TO t_data.
s_data-data = 'Test3'.APPEND s_data TO t_data.
s_data-data = 'Test4'.APPEND s_data TO t_data.
* Download.
DATA: v_file TYPE string.
v_file = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file
TABLES
data_tab = t_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.
Edited by: Sourav Bhaduri on Oct 5, 2008 3:51 PM
10-06-2008 4:23 PM
Thanks for the reply sourav. But your code prints the value 0900. I dont want this value at the end of the line, i required blank spaces at the end of line while sending to the file on application server.
Regards
syed samdani
10-15-2008 10:42 AM
Hi All
We solved the the problem by
Declaring a varaible of type X with a value of '/OD' and concatenate at the end of each line.
Thanks for your support.
Balaji R