cancel
Showing results for 
Search instead for 
Did you mean: 

FTP - prevent processingby receiver during PUT

Former Member
0 Kudos

Hi,

We have FTP interfaces (own scripting) where we put a file and then rename it (filename.tmp to filename). This prevents a polling mechanism on the other side to take a file that is still in 'transit'.

Now we want to use XI and the FTP of the File adapter to transfer text files. However I don't see an option to rename the file after the put.

Anyone with tips of hints on how I can put a file AND prevent the other side to process the file while we are still putting it there ?

Regards

Sammy

Accepted Solutions (0)

Answers (4)

Answers (4)

STALANKI
Active Contributor
0 Kudos

Sammy,

Do you really need to set it?We didnot set it and it works fine.

STALANKI
Active Contributor
0 Kudos

Hi Sammy,

We worked on the file communication channel and we observed that when we use temporary file then the XI creates the file internally in a temp folder and then writes into the directory specified in XI file channel.

This avoids adapter reading half written files.

I hope this info suffices.

Former Member
0 Kudos

Hi Sammy,

Pls check this link out...

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm

there is a feature in the file adapter under processing parameters , "Put File"...

If the file is to be created on the server immediately, select "Directly".

If the content is to be gathered in a temporary file first before the final file is put on the server, choose "Use Temporary File".

Thanks,

Renjith.

Pls ignore my reply....it does not have any thing in addition to what SSG has told...

Message was edited by: Renjith Andrews

Former Member
0 Kudos

Sammy, did you try using the temporary file option in 'Put file' Parameter? With this option, you can specify your final file name in the Target directory/File name scheme and then specify 'Temporary files'.

<b>Put File

If the file is to be created on the server immediately, select Directly.

If the content is to be gathered in a temporary file

first before the final file is put on the server,

choose Use Temporary File.</b>

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm

If that doesn't work, did you try renaming the file in OS command of the FILE Adapter (Receiver).

cmd.exe /C "ren %F c:\output.txt" (windows)

Former Member
0 Kudos

Thank you for the feedback.

The OS command is not really an option as it works on the XI-server and not on the remote server where we put the file.

I am now looking at the usage of a temporary file it is not yet clear to me how it works.

Reading the online help I have the impression that the file is created locally (local data gathering) before the actual FTP is done. Locally being the XI-server so again we are not doing any renaming on the remote server.

Anyone haveing experience with the temporary file option for FTP receivers ?

Anyone experience with the Temporary File Name Scheme ?

The online help is not very clear to me on that point either.

Best Regards

Sammy

Former Member
0 Kudos

Hi Sammy,

It is just a curious question that i am asking....

The FTP interface scripts that you have does 2 things ...right....put the file with a temporary name and rename it.

Can you run this script in OS command line in the communication channel ?(of course the "put" part of it has to be removed, which is done by XI with a temp name )...

Thanks,

Renjith.

Former Member
0 Kudos

Sammy, my gut feeling is that temporary file is gathered at the FTP server. But I may be wrong. When I have time, I will put the trace on and look at the log files.

I was under the impression that OS commands were executed on the receiver or sender end.. Thanks for clarifying that.

Former Member
0 Kudos

Sammy, From the log this is what seem to be happening..

1) FTP STOR command with the temporary file scheme (that we provide in the file adapter)

2) FTP RNFR with the same temporary file scheme

3) FTP RNTO with the final file name..

I am not very familiar with FTP commands (Store, Rename From and Rename TO), but from the log it appears like the temporary file gets renamed to final file. Which i presume is your requirement.

Please award points, if you find this useful.

Former Member
0 Kudos

Hello,

Reply to Renjith.

Yes it would be possible to run a script via the OS cmd.

As this script would be running on the XI server the script itself would have to do a FTP-session and rename the remote file.

However this would mean putting a part of the processing outside XI and outside of it's monitoring. In addition you would have extra FTP-sessions, one for XI and a second one for every script execution. Some security settings may prevent having multiple connections from the same source (user/server).

You could take it a step further and use the file adapter to write the file locally and trigger a script to do the FTP for you. But again you put some of the processing outside XI. I would consider it if we had a high number of FTP interfaces with multiple connections.

However for our current scenario it would be a bit of an overkill.

The solution with the temporary file seems to be sufficient for our needs.

Regards Sammy

Former Member
0 Kudos

Hello,

It did a test with the setting for the temporary file and that seems to be the solution.

For info : I processed a message while on the receiving server there was a small script looping and constantly writing the directory contents to a file. And yes you first see the temp file being written and then renamed to the final name.

But I still have some questions.

1. SSG the log you refer to.

Is this one of the XI logs ?

If yes where could I find it.

2. Can anyone explain me how I can set the Temporary File Name Scheme ?

There is a mentioning in the online help but it is not really clear to me.

For those who hadn't guessed it yet - I'm rather new to the XI environment.

Regards

Sammy

Former Member
0 Kudos

Hi Sammy,

>>>

>>>2. Can anyone explain me how I can set the Temporary >>>File Name Scheme ?

>>>There is a mentioning in the online help but it is not >>>really clear to me.

For example if you give "abcd.xyz" in the temporary file name scheme....the intermediate file name would be

"abcd<timestamp at which file is temporarily created>.xyz"

if nothing is given as Sravya mentioned the temp file name would be the <timestamp at which file is temp created>....

It is better to have some application specific name in the temp naming scheme...

Thanks,

Renjith

Former Member
0 Kudos

Yes, Sammy you need to set the trace on file adapter. And then you can use the log viewer to look at the actual logs. I don't have the system access now, so can't give the exact steps to log.. But others should be able to give you exact steps

Former Member
0 Kudos

Hello,

I understand the temporary file name scheme but where and how do I set it ?

Is it something I have to forsee in the message definition (design level) or can I set it in the communication channel (configuration) ?

The online help has a part about Adapter-specific message attributes which refers to a number of indicators but I don't seems to find it back in our XI-system.

Does anyone know of an example somewhere that I can look at ?

Or give some pointers on how to set these extra parameters and variables.

Regards

Sammy

Former Member
0 Kudos

For those who are interested :

You can search all you want in XI 3.0 SP13 but you will not find the 'Temporary Name Schema'.

However I did receive a screenshot from a SP15 situation which shows the field bright and clear.

So we will do as advised and jump from SP13 to SP15.

Best Regards

Sammy