2007 Dec 12 7:55 PM
Hi,
I need to write a file to shared path, can anyone provide me the code for that?
Thanks in advance.
2007 Dec 12 8:00 PM
u need to have the remote name and some of the server related data to FTP ur file..
in se37 search for FTP u should be finding a bunch of FM..
CALL FUNCTION 'ZINT_SAPFTP'
EXPORTING
filenm = gv_filenm
ftpcommand = gv_ftpcommand
host = gv_host
localdir = gv_localdir
remotedir = gv_remotedir
EXCEPTIONS
communication_failure = 1
ftp_host_lookup_failure = 2
ftp_login_failure = 3
ftp_no_filenm = 4
ftp_no_remotedir = 5
host_not_in_netrc = 6
no_filenm = 7
no_localdir = 8
remote_system_privs = 9
system_failure = 10
three_strikes_ftp_connect = 11
unknown_error = 12
unsupported_ftpcommand = 13
OTHERS = 14.
IF sy-subrc <> 0.
WRITE: / 'FTP COMMUNICATION VIA ZINT_SAPFTP FAILED TO SEND',
gv_filenm.
CASE sy-subrc.
WHEN 1. WRITE: / 'COMMUNICATION_FAILURE'.
WHEN 2. WRITE: / 'FTP_HOST_LOOKUP_FAILURE'.
WHEN 3. WRITE: / 'FTP_LOGIN_FAILURE'.
WHEN 4. WRITE: / 'FTP_NO_FILENM'.
WHEN 5. WRITE: / 'FTP_NO_REMOTEDIR'.
WHEN 6. WRITE: / 'HOST_NOT_IN_NETRC'.
WHEN 7. WRITE: / 'NO_FILENM'.
WHEN 8. WRITE: / 'NO_LOCALDIR'.
WHEN 9. WRITE: / 'REMOTE_SYSTEM_PRIVS'.
WHEN 10. WRITE: / 'SYSTEM_FAILURE'.
WHEN 11. WRITE: / 'THREE_STRIKES_FTP_CONNECT'.
WHEN 12. WRITE: / 'UNKNOWN_ERROR'.
WHEN 13. WRITE: / 'UNSUPPORTED_FTPCOMMAND'.
WHEN OTHERS. WRITE: / 'ERROR 13'.
ENDCASE.
2007 Dec 12 8:22 PM
2007 Dec 12 10:50 PM
application server..
where we wll store all metrics related to program.
2007 Dec 13 12:05 AM
Hi,
First get the data to an internal table then use datasets to load the data to Application server by specifying the directory name.
OPEN DATASET <DSNAME> FOR OUTPUT IN TEXT MODE.
LOOP AT ITAB INTO WA.
TRANSFER WA to FILE.
ENDLOOP.
CLOSE DATASET.
Regards,
Satish