06-24-2009 12:54 PM
Hi Friends,
I have a requirement to place a .TXT file on the FTP server. I am able to do that successfully using the function modules HTTP_SCRAMBLE, FTP_CONNECT, FTP_R3_TO_SERVER, FTP_DISCONNECT. But the problem is I want to make this file as "Tab delimited". As of now, when I copy this text file back to my desktop and open with notepad, it is not in the Tab delimited format. Also It should be done as a Back Ground Job!!
Please suggest.
Thanks,
Vidya Sagar.
06-25-2009 6:20 AM
Hi,
The internal table used by the FM to create the file should contain tab de-limited records. While building this internal table itself add the "tab ASCII" as Gary has suggested using the attribute of the global class.
regards
Nitesh
06-24-2009 1:04 PM
you can make use of 'SAPFTPA' for FTP'ing by a background job.
'SAPFTP' will work in foreground.
Regarding tab-delimited, while preparing your file you can make use of CL_ABAP_CHAR_UTILITES to insert a 'tab' (i forgot the ASCII equivalent).
So you will have to create a file where evry feiled is followed by a 'TAB'.
Also, Please have a look at RSFTP0** pgms
Hope this helps.
06-24-2009 3:38 PM
Hi Grey,
Thanks for your reply.
FTP_R3_To_Server Creates and Transfers the file by importing the Internal table.
So there will be no scope to change the file.
Can we edit the file in the FTP server as tab delimited by using FTP_COMMAND?
Thanks,
Vidya Sagar.
06-25-2009 6:08 AM
Hi,
You may do it the following way:-
Loop at your internal table. Concatenate all your fields seperated by tab into a string which is another internal table & use this new tables for FTP.
{
This is the table to be used for FTP
DATA : BEGIN OF e_file OCCURS 10,
data(3000),
END OF e_file.
DATA: w_tab TYPE x VALUE '09',
w_string(5000).
*
Loop at your_internal_table.
let us assume your internal table has got 3 feilds A,B,C
Concatenate your_internal_table-A your_internal_table-B your_internal_table-C
into w_string separated by w_tab.
e_file-data = w_string.
APPEND e_file.
CLEAR e_file.
Endloop.
*
Now use e_file for FTP.
I hope this helps,
Regards
Raju Chitale
}
06-25-2009 12:44 PM
Hi Gary,
I tried using CL_ABAP_CHAR_UTILITES and it really works.
Thank you very much. And now 'SAPFTPA' for background job is not working!!
It is unable to connect the FTP server. In fore ground itz working fine with SAPFTP.
Any clues?
Thanks n Regards,
Sagar.
Edited by: VIdya Sagar on Jun 25, 2009 5:15 PM
06-25-2009 12:54 PM
Please check the credentials under SM59-> TCP/IP for SAPFTPA.
Please test the connection from there and let me know
06-25-2009 3:42 PM
Yes it is fine in SM59.
Connection test result:
Logon 25 msec
Transfer of 0 KB 0 msec
Transfer of 10 KB 1 msec
Transfer of 20 KB 1 msec
Transfer of 30 KB 1 msec
06-25-2009 6:20 AM
Hi,
The internal table used by the FM to create the file should contain tab de-limited records. While building this internal table itself add the "tab ASCII" as Gary has suggested using the attribute of the global class.
regards
Nitesh