cancel
Showing results for 
Search instead for 
Did you mean: 

FTP - File getting upload with 0 bytes without raising any error

Former Member
0 Kudos

Hello Experts,

I am facing a strange issue with FTP.

I have a backgroung program which uploads two file (one ld and one log)

onto FTP server.

But there are some scenarios in which the log file is uploaded blank with 0 bytes.

though the file on application server contains the data.

I debugged the job using JDBG, still it was uploadig the file sometime and many a times

not.

I could not judge anything from this unusual behaviour.

Please help me with your comments.

Thanks in Advance,

Sumit Mittal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amit,

We have faced some same situation earlier. In our case the directory space was full where we were trying to place the files. We remove the files from directory and after that the files were placed properly.

Please empty your target directory and check if this works.

Thanks

Ajay

Former Member
0 Kudos

Hello Ajay,

As i told you that the file is behaving abnormally,it sometimes is uploaded fully

and sometimes empty,being of 167 bytes.

Also there is another .ld file which is in MB's and that is getting transferres fully always.

The issue is only with the log file.

The directory is also not full,as I can upload those files manually ithout a problem.

Anyways thanks for your reply and my name is Sumit not Amit ;-).

waiting for your reply.

Sumit

Edited by: Sumit Mittal on Jun 6, 2009 10:25 AM

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sumit,

I concur with Netweaver Expert's opinion. If the problem is intermittent put a network sniffer on to identify any possible network downtimes. Also, do the files that you are trying to FTP have an end-of-file marker of some sorts? You haven't explained where the files on the App Server are originating. It could be that the file is still in the process of being written out & the background program picks up the file too early. In that case, if there is an end-of-file marker in the files, you can add a check in the background program to first check if the end-of-file marker exists before attempting to FTP it.

This could also explain why when later you look at the file on the app server it's there in all it glory but when the background program picked it up it was too quick on the draw.

Regards, Trevor

Edited by: Trevor Naidoo on Jun 8, 2009 11:28 AM

Former Member
0 Kudos

Hi Trevor,

You are right in saying that but in my code the files are being transferred from the

internal table.I am also attaching the piece of code for you to see and alalyse.

OPEN DATASET lv_full_file_name_lg FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT gi_log_files INTO gw_log_files.

TRANSFER gw_log_files TO lv_full_file_name_lg NO END OF LINE.

TRANSFER cl_abap_char_utilities=>cr_lf TO lv_full_file_name_lg NO END OF LINE.

ENDLOOP.

CLOSE DATASET lv_file_name_lg.

Also to let you know the function modules I am using for FTP are;

HTTP_SCRAMBLE

FTP_CONNECT

FTP_COMMAND_LIST

FTP_DISCONNECT

RFC_CONNECTION_CLOSE

Please mail if you want to view anything else.

Thanks,

Sumit

ravi_raman2
Active Contributor
0 Kudos

Please post the question in the ABAP forum..as you are not using XI to solve the problem..you might get a better solution.

Regards

Ravi Raman

Former Member
0 Kudos

ok I am marking this question as answered to move it across the forums.

Former Member
0 Kudos

Hi Sumeet,

Check the SP level your XI box.

In later version not sure about which release.

http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/frameset.htm

There is an option provided for File adapter to handle empty files.

u25CF      Handling of Empty Files

Specify how empty files (length 0 bytes) are to be handled.

u25CB       Do Not Create Message

No XI messages are created from empty files. 

The files are processed according to the selected processing mode. 

For example, if the processing mode is Delete, empty files are deleted in the source directory.

u25CB       Process Empty Files

XI messages are created with an empty main payload.

The files are processed according to the selected processing mode. 

u25CB       Skip Empty Files

No XI messages are created from empty files. 

Empty files are skipped and remain in the source directory.

Hope this will help you...

Regards,

Sunil.

Former Member
0 Kudos

are you just transfering the file or doing some process before put it on target ?

Former Member
0 Kudos

No I am not doing any kind of process.

After creating the file, it is being uploaded to application server

and then to the FTP destination

former_member200962
Active Contributor
0 Kudos
No I am not doing any kind of process

So i assume that you have not configured any IR object for this scenario and just the ID objects are transferrring the file for you..... in that case XI/PI is not supposed to give any error ...as it is not concerned with what data is there (or data is absent) in the file....

Former Member
0 Kudos

Hi Abhishek,

Can I know how do we configure the IR objects..

Also just to let you know I am doing all these operations in ABAP

and not in XI/PI.

If you require, I could send you the piece of code even..

Thanks,

Sumit

former_member200962
Active Contributor
0 Kudos
Also just to let you know I am doing all these operations in ABAP and not in XI/PI.

ok...just one Q...are you currently using XI/PI for this scenario?...atleast the ID part...

Can I know how do we configure the IR objects..

In IR you will need:

1) DataType at the Sender ---> XI side ...i.e. for the log file...this structure should be identical to the structure in the log file....if your log file is a CSV file (not in a XML format)then you need to configure File Content Conversion in the sender File Channel

2) Create a Message Type...this will include the DT that you created above..

3) Create an OutBound Asynchronous Message Interface (service interface in PI)

4) Create a DataType at the XI ---> Receiver...i.e. the folder where you need to post the log file...If you want that the log file should the same format as in the Sender Folder (CSV/ Flat) then you need to have a File Content Cpnversion in the Receiver File Channel.

5) A mapping program seems to be optional in your case...not required...

This completes your IR part....

In ID...

1) There is an object called Receiver Determination....in this you can configure a condition to check if your message has a node or not....you can use this condition editor to check if your file has the root node or not....if not then it means that the file is blank...i.e no log data....in such a case a you can get an error in XI (in transaction SXMB_MONI)...

Though i tried to explain what objects you need...i recommend you also have a look at these blogs to get a pictorial view:

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

Regards,

Abhishek.

Former Member
0 Kudos

does it means you are using pure ABAP FM and not PI/XI at all ??

okay , in that case you just put some network sniffers and check where the file got changed.