Application Development 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: 

FTPing file to AS/400 and executing AS/400 program from SAP dialog program

Former Member
0 Kudos

Hi,

The task is as follows. I need to FTP a file to AS/400 server (remote) and execute a program (on AS/400) from SAP program (dialog program).

Can you please let me know if there are any functions available in SAP for ftping a file to AS/400 and executing the program on AS/400. Can you please give some suggestions on implementing this task. Can you please let me know the command(s) for executing the program on AS/400.

Thanks in advance. I appreciate your help.

-Vidya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

there is a good redbook from IBM at

<b>http://www.redbooks.ibm.com/redbooks/pdfs/sg244672.pdf</b>that describes in <b>chapter 12.5</b> how to execute a OS/400 command from ABAP. You could use this to call to a CL-program that execute the FTP-commands.

An example "Batch FTP - Examples" exists in the IBM support-database:

<b>http://www-1.ibm.com/support/docview.wss?uid=nas12377b510c791422b862565c2007ce312&rs=110</b>

Good luck,

Stefan

3 REPLIES 3

Former Member
0 Kudos

Hi,

there is a good redbook from IBM at

<b>http://www.redbooks.ibm.com/redbooks/pdfs/sg244672.pdf</b>that describes in <b>chapter 12.5</b> how to execute a OS/400 command from ABAP. You could use this to call to a CL-program that execute the FTP-commands.

An example "Batch FTP - Examples" exists in the IBM support-database:

<b>http://www-1.ibm.com/support/docview.wss?uid=nas12377b510c791422b862565c2007ce312&rs=110</b>

Good luck,

Stefan

0 Kudos

Hi Mr. Stefan,

Thank you very much for letting me know a solution for the problem.

I am not good in developing a CL-program and hence I could not try this solution.

I appreciate your help. Thank you for sharing your ideas.

With Best Regards,

Vidya

Former Member
0 Kudos

Part 1.

FTP part ,Pls look into this fun modules .

CALL FUNCTION 'FTP_CONNECT' followed by

CALL FUNCTION 'FTP_R3_TO_SERVER'

CALL FUNCTION 'FTP_DISCONNECT'.

part 2.

running AS/400 program

make a command string ( AS/400 command -in RPG/CL )

by concatinating .something like this .

concatenate 'call ' AS400OBJLIB into CmdStr separated by space.

concatenate CmdStr '/sap0yy0 parm('''

DIV ''' '''

AS400DTALIB ''' '''

AS400OBJLIB ''' '''

FileParm ')'

into CmdStr.

  • CmdStr is the command string to run in AS/400 .

  • AS400OBJLIB - object lib

  • sap0yy0 - AS/400 program

  • others params to te as/400 program.

and run it through system calls .

CALL cfunc or RFC

or /search for fun modules for the above purpose

Hope u will find out after a little research .

Cheers.