Run program RSFTP001 and check if it reports any problems. If it doesn't then your SAPFTP RFC is fine.
The second possible reason why your program fails could be because you are using SAPFTP as RFC destination when running the program in background. For background programs you must use SAPFTPA. If you don't find SAPFTPA in SM59 transaction, run the report RSFTP005 to generate it.