This ABAP program will let you connect to a FTP host. This is done by using the function module FTP_CONNECT and you need to pass the user credentials in order to make the connection work correctly.
CALL FUNCTION 'FTP_CONNECT' DESTINATION
EXPORTING USER = USER PWD = PASSWORD ACCT =
ACCOUNT HOST = HOST
TRACE = FTP_TRACE GUSER = GATEWAY_USER
GPWD = GATEWAY_PASSWORD GHOST =
IMPORTING HANDLE = HANDLE ERROR = CERROR
EXCEPTIONS SYSTEM_FAILURE = 1
COMMUNICATION_FAILURE = 2.