Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to write a file to shared path?

Former Member
0 Likes
734

Hi,

I need to write a file to shared path, can anyone provide me the code for that?

Thanks in advance.

Hi,

I need to write a file to shared path, can anyone provide me the code for that?

Thanks in advance.

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
688

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.

Read only

Former Member
0 Likes
688

Shared path - presentation or application server?

Rob

Read only

0 Likes
688

application server..

where we wll store all metrics related to program.

Read only

0 Likes
688

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