2009 Jun 30 2:46 PM
Hi friends,
I am using the following code to connect FTP. It is working fine in fore ground. but it fails in background.
In Job log, it is saying "Attempt to set up connection to xxx failed "!! Please suggest what is to be modify?
I ran RSFTP002 and it also fails for SAPFTPA!!
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = v_pwd
sourcelen = v_pwd_len
key = cs_key
IMPORTING
destination = v_pwd.
Establish the FTP Connection
IF SY-BATCH EQ 'X '.
v_rfc_dest = 'SAPFTPA'. " background
else.
v_rfc_dest = 'SAPFTP'. " foreground
ENDIF.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = v_usr
password = v_pwd
host = v_host
rfc_destination = v_rfc_dest
IMPORTING
handle = v_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Thanks,
Sagar.
2009 Jun 30 3:00 PM
Hi
Try to check SAPFTPA and SAPFTP by trx SM59:
- SAPFTP is for Presentation server, so it can't work in background
- SAPFTPA is for Application server, so it should work in forground and background
Max
Hi friends,
I am using the following code to connect FTP. It is working fine in fore ground. but it fails in background.
In Job log, it is saying "Attempt to set up connection to xxx failed "!! Please suggest what is to be modify?
I ran RSFTP002 and it also fails for SAPFTPA!!
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = v_pwd
sourcelen = v_pwd_len
key = cs_key
IMPORTING
destination = v_pwd.
Establish the FTP Connection
IF SY-BATCH EQ 'X '.
v_rfc_dest = 'SAPFTPA'. " background
else.
v_rfc_dest = 'SAPFTP'. " foreground
ENDIF.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = v_usr
password = v_pwd
host = v_host
rfc_destination = v_rfc_dest
IMPORTING
handle = v_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Thanks,
Sagar.
2009 Jun 30 3:00 PM
Hi
Try to check SAPFTPA and SAPFTP by trx SM59:
- SAPFTP is for Presentation server, so it can't work in background
- SAPFTPA is for Application server, so it should work in forground and background
Max