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

Function Module to transfer text file from local machine to remote server

Former Member
0 Likes
1,151

Hi Everybody,

is there any function module available to transfer a text file from local machine to remote server.

Thanks in advance.

Regards,

Amit Ranjan

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
724

Hello,

U can use the RFC FM 'RFC_WRITE_FILE' to transfer the file contents to remote server.


      CALL FUNCTION 'RFC_WRITE_FILE'
        DESTINATION v_rfcdest --> RFC Destination
        EXPORTING
          file                       = wa_filename
          format                  = 'ASC'                "Can be ASC/BIN
*          size                     = v_size
          language              = sy-langu
        IMPORTING
          size                  = v_size
        TABLES
          filedata              = it_file                   "Internal table whose contents need to be transferred
        EXCEPTIONS
          system_failure        = 1  MESSAGE wa_message
          communication_failure = 2  MESSAGE wa_message
          illegalname           = 3
          OTHERS                = 6.

Hope this is useful.

BR,

Suhas

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
725

Hello,

U can use the RFC FM 'RFC_WRITE_FILE' to transfer the file contents to remote server.


      CALL FUNCTION 'RFC_WRITE_FILE'
        DESTINATION v_rfcdest --> RFC Destination
        EXPORTING
          file                       = wa_filename
          format                  = 'ASC'                "Can be ASC/BIN
*          size                     = v_size
          language              = sy-langu
        IMPORTING
          size                  = v_size
        TABLES
          filedata              = it_file                   "Internal table whose contents need to be transferred
        EXCEPTIONS
          system_failure        = 1  MESSAGE wa_message
          communication_failure = 2  MESSAGE wa_message
          illegalname           = 3
          OTHERS                = 6.

Hope this is useful.

BR,

Suhas

Read only

Former Member
0 Likes
724

Hi Amit

Check the link nd find out your required FM from below threads,

http://abap4.tripod.com/SAP_Functions.html

http://www.sapdev.co.uk/fmodules/fmssap.htm

Regards,

Syfulla

Read only

Former Member
0 Likes
724

Hi Suhas,

I am working on SAP CRM 4.0 system. FM RFC_WRITE_FILE is not available in my system. can u please tell me the name of some other FM to achieve the same?

Best Regards,

Amit

Read only

0 Likes
724

Check this blog , implement the same you are done.