cancel
Showing results for 
Search instead for 
Did you mean: 

How to send files to a windows FTP server

former_member1244799
Participant
0 Kudos

Hi All,

Could you please help on the below questions

a)  In SAP CPS, how to send the spool file of an ABAP program (generated in SAP CPS by running SAP_ABAPRUN script) to a FTP Windows server(Platform agent is installed). It looks   the  FTP job do not have job  parameter which allows creating relationship with previous job order inorder to identify generated Output file and send it to the FTP server.Please advise on how to attach the output file to the FTP job and send it to the FTP Windows server or is there any alternate way for this.


b) Scenario 2:

I have the output file generated of an ABAP program in the below location on an SAP server

/Interface/BCD/Out

How to send this to a FTP Windows server(platform aget installed)

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

h_carpenter
Active Contributor
0 Kudos

Hi Ramana,

So, assuming you have a job chain. In the first step, called "Get Spool" you call an ABAP job (first job in step). In step two, called "FTP spool" you have a CMD job definition as follows:

jtool getfile -j -o stdout.new -s "Get Spool, Job 1:someSpool.txt"

jftp put -ascii myhostname myusername mypassword stdout.new /path/to/write/file/filename

Not a one-liner, but not too complex either. You would need the name of the spool file, but that should never change from job to job, I hope ;-). The spool you want is, usually,  step1_spool1.txt.

Regards,

HP

Answers (2)

Answers (2)

h_carpenter
Active Contributor
0 Kudos

Hi again,

My original response only covered scenario 1, for 2, it is similar, though:

jtool link /Interface/BCD/Out/myfile.txt stdout.new

jftp put -ascii myhostname myusername mypassword stdout.new /path/to/write/file/filename

Regards,

HP

former_member1244799
Participant
0 Kudos

Thank you so much Carpenter:-)

Regards,

Ram

asif_muhammad
Explorer
0 Kudos

Hi Raman

a) there might be some parameter like Custom_RELFunctions.getParentJobOutFileName(jobId)  through which you can get parent job output file, so you need to add this parameter like P_OUTFILE in FTP job, and run this script in paralel to ABAP program and get the output in parameter, then move it to where ever you want.

b) add one external command job after ABAP program to move files as { mv <source> <target directory> } provided you need to have corrcet network / firewall setting between the source and target servers.

KR

Muhammad Asif.