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

About Function Module

Former Member
0 Likes
1,347

Can any one Plz provide me with Function Module name

which sends my File to NT Server

Regards,

PAVAN..

15 REPLIES 15
Read only

Former Member
0 Likes
1,311

Hi Pavan,

You need to use ftp function module.

FTP_CONNECT (to connect ), FTP_COMMAND(mput/mget commands) to tranfer file to NT server.

regards

vijay

Read only

0 Likes
1,311

Hi Vijay,

I got one Function Module FTP_R3_TO_SERVER

but I really don't know how to use it.

Can U plz Explain the FM U have given in details with a Program as an Example

Regards,

PAVAN..

Read only

0 Likes
1,311

hi,

ftp_connect is used to connect the server.

ftp_command is used to execute the commands on ftp server.

mget , mput commands used to tranfer files.

regards

vijay

Read only

0 Likes
1,311

hi Vijay ,

If U can

Plz tell me which parameters to be maintained and how in those Function Modules.

Thanks in Advance,

Regards,

PAVAN..

Read only

0 Likes
1,311
REPORT ztest_ftp.
SELECTION-SCREEN BEGIN OF BLOCK FRM_FILES WITH FRAME TITLE TEXT-001.
PARAMETERS: HOST(64) TYPE C LOWER CASE OBLIGATORY,
            FTPCMD(10) TYPE C LOWER CASE OBLIGATORY,
            SOURCE(128) TYPE C LOWER CASE,
            TARGET(128) TYPE C LOWER CASE.
SELECTION-SCREEN ULINE.
PARAMETERS: USER(12) TYPE C LOWER CASE,
            PWD(20) TYPE C LOWER CASE.
SELECTION-SCREEN END OF BLOCK FRM_FILES.

DATA: COUNT    TYPE I VALUE 1,
      CMD1(266) TYPE C,
      DIRCHG(131) TYPE C,
*     user(12) TYPE c,
*      pwd(20) TYPE c,
*      cmd2(80) TYPE c,
      DEST LIKE RFCDES-RFCDEST VALUE 'ZSAPFTP'.

DATA: HDL TYPE I,
      INDX TYPE I,
      KEY TYPE I VALUE 26101957,
      DSTLEN TYPE I,
      TXT(80) TYPE C.

DATA: C1(4) TYPE C,
      C2(4) TYPE C,
      PERCENT TYPE I.

DATA: BEGIN OF RESULT OCCURS 0,
      LINE(100) TYPE C,
      END OF RESULT.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-NAME(3) = 'PWD'.
      MOVE '1' TO SCREEN-INVISIBLE.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

START-OF-SELECTION.

  CONCATENATE FTPCMD SOURCE TARGET INTO CMD1 SEPARATED BY SPACE.

  IF USER = SPACE.
    USER = 'ftpuser'.
    PWD = 'xfer2u'.
  ENDIF.

  DESCRIBE FIELD PWD LENGTH DSTLEN.

  CALL 'AB_RFC_X_SCRAMBLE_STRING'
    ID 'SOURCE'      FIELD PWD    ID 'KEY'         FIELD KEY
    ID 'SCR'         FIELD 'X'    ID 'DESTINATION' FIELD PWD
    ID 'DSTLEN'      FIELD DSTLEN.

  CALL FUNCTION 'FTP_CONNECT'
       EXPORTING
            USER            = USER
            PASSWORD        = PWD
            HOST            = HOST
            RFC_DESTINATION = DEST
       IMPORTING
            HANDLE          = HDL.
  CALL FUNCTION 'FTP_COMMAND'
       EXPORTING
            HANDLE  = HDL
            COMMAND = 'prompt'
       TABLES
            DATA    = RESULT.

  INDX = 0.
  WRITE AT / TEXT-001. WRITE INDX. INDX = INDX + 1.
  WRITE AT / CMD1.

  WRITE INDX TO C1. WRITE COUNT TO C2.
  CONCATENATE 'FTP: ' C1 ' from ' C2 INTO TXT.
  PERCENT = INDX * 100 / COUNT.

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
            PERCENTAGE = PERCENT
            TEXT       = TXT.


  CALL FUNCTION 'FTP_COMMAND'
       EXPORTING
            HANDLE        = HDL
            COMMAND       = CMD1
*            verify        = 'Y'
       TABLES
            DATA          = RESULT
       EXCEPTIONS
            TCPIP_ERROR   = 1
            COMMAND_ERROR = 2.

  LOOP AT RESULT.
    WRITE AT / RESULT-LINE.
  ENDLOOP.
  REFRESH RESULT.

  CALL FUNCTION 'FTP_DISCONNECT'
       EXPORTING
            HANDLE = HDL.
Read only

0 Likes
1,311

Thank Q

I'll just go thruu this

Regards,

PAVAN..

Read only

0 Likes
1,311

Hi Pavan,

Regarding usage of FM's, have a look at programs

RSFTP007

RSFTP008

Thanks

Lakshman

Read only

0 Likes
1,311

whether it is necessary to use ftp_connect and ftp_command before ftp_r3_to_server..

Regards,

PAVAN..

Read only

0 Likes
1,311

hi vijay,

i have used the function module that you suggested. ftp_connect and ftp_command.

in selection screen of the program that you gave i am giving the following inputs.

host : zsdevdv1 (our sap server)

ftpcmd : mput

source : our file (app server)

target : our target (network system)

user : username

pwd : pwd

but we are getting 'user has no access authorization for the computer zsdevdv1.

please explain is it because i dont have proper authorization or is it something else?

Read only

Former Member
0 Likes
1,311

Hi Pavan

See the function modules provided by SAP Data provider. Check out the link. Hope this helps.

http://help.sap.com/saphelp_nw2004s/helpdata/en/f1/b4a6bddf3911d18e080000e8a48612/frameset.htm

Regards,

Rakesh.

Read only

Former Member
0 Likes
1,311

Hi Pavan,

You have chosen right FM.

However we can use what SAp has provided.

Try using report RSFTP004, it will solve ur issue.

Thanks & Regards,

Ankur

Read only

Former Member
0 Likes
1,311

Hi pavan,

These are the list of functional modules in abap.

Take a look and choose the functional module according to your requirement.

http://www.geocities.com/victorav15/sapr3/abapfun.html

Hope it helps...

Regards,

Maheswaran.B

Read only

Former Member
0 Likes
1,311

Hi Pavan,

Try this fm FTP_R3_TO_SERVER...

Check this link...

This links gives you how to use the fm ftp_connect.

http://www.ecediltd.com/la/abap@yahoogroups.com/3311.html

A Example of how to use ftp_connect, ftp_command...

http://erp.ittoolbox.com/groups/technical-functional/sap-r3-dev/479762

Hope it helps.

Regards,

Maheswaran.B

Message was edited by: Maheswaran B

Read only

rajeshkumar_kaveti
Participant
0 Likes
1,311

Hi Pavan,

Can you share with me as to how you solved this issue.

I am also getting message ''user has no access authorization for the computer xxxxxxx".

Thanks,

Rajesh

Read only

0 Likes
1,311

pls provided the solution for " user as no access authorization for the computer'