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: 

Pull compressed file (.gz format) via FTP and place on Application server

Former Member
0 Kudos

Hello!

Greetings.

We have a requirement where a compressed file in the format *.gz is to be pulled via FTP and saved to the application server after extracting.

I searched the forums and found options to pull text or XL files, but nothing about pulling a compressed file. I wished to know if there is any process for the same. After pulling the file, it is to be saved to Application server after extracting. My doubts are as below:

1. How to pull a *.gz file via FTP (Need batch processing)

2. Can I extract and rename th file before saving it to applciation server? Or I need a temporary location to place the file before extraction?

Any inputs are appreciated.

Thanks,

Shishir.

7 REPLIES 7

brad_bohn
Active Contributor
0 Kudos

The format of the file is irrelevant. Use the FTP functions which have been discussed many times here to move the file. You will need to move the file before you extract the contents.

Sandra_Rossi
Active Contributor
0 Kudos

Hi Shishir,

I think you make a confusion when you say "pull" : do you really say that FTP will pull and uncompress the file? That's incorrect, FTP will only read the GZ file, then you'll have to uncompress it separately -> see CL_ABAP_ZIP class, many examples in the forum.

BR

Sandra

Former Member
0 Kudos

Thanks for the replies.

That means I can get the Zip file through FTP. Then I need to save it to a temporary location, extract and then save to the final location. Do tell me if my understanding is incorrect.

Thanks again. Points given.

Regards,

Shishir.

0 Kudos

Hi Shishir,

1) I can get the Zip file through FTP

2) Then I need to save it to a temporary location

3) extract

4) and then save to the final location

You're correct, except that the 2nd point is not required, as CL_ABAP_ZIP works on the ZIP content in memory

BR

Sandra

0 Kudos

Hi Sandra.

Thanks for the confirmation.

There is a change is the requirement. We need to Poll the FTP server for the file for the duration of one week every month.

When the file is found, we are to take the *.gz file, extract and put on the application server.

My question is how do we poll the application FTP server? I searched the forums and found a few threads that say that an FTP adapter is to be setup for polling the FTP server and then we can schedule it using u201CAvailability Time Planningu201D.

/people/shabarish.vijayakumar/blog/2006/11/26/adapter-scheduling--hail-sp-19-

I wished to know if that is the only way to approach this requirement.

Any help is appreciated.

Thanks and Regards,

Shishir.

Edited by: Shishir Kinkar on Apr 26, 2011 11:07 AM

0 Kudos

<Posted Twice - Removed>

Edited by: Shishir Kinkar on Apr 26, 2011 11:09 AM

0 Kudos

Hi Shishir,

don't try to make things too much complex!

Your blog is about PI/XI, do you have it? If so, I can't answer, and you should better ask a new question in the PI/XI forum.

To run an FTP command from ABAP, you must use FTP_CONNECT, FTP_COMMAND and so on (search forum).

When to trigger the FTP command : either the system which puts the file is able to launch the ABAP program, either the Operating system or an EAI (PI/XI for example) is able to detect a new file arriving and launch the ABAP program, either you schedule your ABAP program every 10 minutes for example. The latter is very easy.

BR

Sandra