cancel
Showing results for 
Search instead for 
Did you mean: 

Rename temporary File

Former Member
0 Kudos

HI,

I am doing a RFC to File scenario , at the Receiver Communication channel I am using the Use Temporary file with the " Put File " option , Now my requirement is to rename this temporary file Else file ca nt be picked by AS400 system.

So My question is can we rename this temporary file ?

If yes then how .

Thanks and Regards,

KLK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This is absolutely possible. As far as i know, XI uses its own name for temporary file and once the file is final, it takes the filename specified in channel. If you need to give the filename dynamically you can use a User defined function.

In that UDF you need to use DynamicConfiguration class.

Go thro the following thread:

Especially the post by vijaya kumari. Then all the other posts for dynamic configuration of filename.

Regards,

P.Venkat

Former Member
0 Kudos

Venkataramana,

I tried variable substitution and command line arguments as well but all of them are changing my target file name not the temporary file .

SAP puts timestamp as the name of the temporary file which is more than 10 char hence this file can not be posted to AS400.

Renaming to Target file name occurs after posting the temporary file to the Receiver system in my case AS400

Thanks and regards,

KLK

Former Member
0 Kudos

Hi,

The temporary file name is used by the adapter to make sure that the file is completely written before it is placed in the target directory with the actual file name.

If AS400 is going to pick up temporary files, there can be a possibility that the file was not completely written by the adapter before it was picked up by AS400.

Is this the functionality that you want to configure anyway?

Regards,

Smitha.

Former Member
0 Kudos

Hi,

I doubt if there is any way to change or modify temporary filename. It is totally in control of the integration server adapter engine(i suppose). We have control to change the name of the final file only.

You can try a work around like this.

Put the final temp file in a directory, rename it there, then post it to AS400 is going to pick it. You can do it using OS commands as said by Dheeraj.

Regrads,

P.Venkat

Former Member
0 Kudos

Hi all,

First of all a big thanks for ur responses.

Smitha - as u know in the Put option we have 2 options either Directly or Use temporary file

we dont want to do a direct drop on As/400 'coz of archiving and other requirements now when I use " use Temporary file " option I am getting an exception in the Communication channel that temporary file name is too long and file is not getting transferred ... It mean that Xi would transfer the temp file on to AS400 and after transfer renames it ( My Analysis ..)

Venkataramanan /Dheeraj --

Are u suggesting posting to AS400 using OS command and scripts with telnet option to AS 400 system ??

In that case it look like XI is not Orchestrating the whole process ??

waiting for ur reply

KLK

Former Member
0 Kudos

Hi,

<i>First of all a big thanks for ur responses.

Smitha - as u know in the Put option we have 2 options either Directly or Use temporary file

we dont want to do a direct drop on As/400 'coz of archiving and other requirements now when I use " use Temporary file " option I am getting an exception in the Communication channel that temporary file name is too long and file is not getting transferred ... It mean that Xi would transfer the temp file on to AS400 and after transfer renames it ( My Analysis ..)</i>

The temp file option writes the file with it's own temp name. You cannot decide what this temp name is. ( why would u want to also??)

Once the file is written completely the file is givent he name that you have specified in the file name option.

If you are getting an error. It might be because of the network connection stability of the speed of the network.

Regards

Vijaya

Former Member
0 Kudos

Vijaya,

It is not a n/w issue 'coz the exception i got is only when I do with " Use temporary file " option to put and also exception clearly said the file name is too long .

Let me rephrase my question :

As renaming temp file is not possible .. If I directly drop my Temp final file on As400 as Venkataramanan was saying and rename it to the required target file name . I am supposed to run a remote command on As400 from XI to do that

using Shell ..

If my assumption is correct can u help me with AS400 remote script ..

if not please let me know how to go ahead.

Regards,

KLK

Former Member
0 Kudos

Hi,

What i was trying to say is you drop the file in XI server directory. Here the temporary file will be dropped and it will get renamed to the one given in communication channel.

Then give a OS command that will post that file to AS400.

Hope i am clear.

Regards,

P.Venkat

Former Member
0 Kudos

Hi,

<i>As renaming temp file is not possible .. If I directly drop my Temp final file on As400 as Venkataramanan was saying and rename it to the required target file name . I am supposed to run a remote command on As400 from XI to do that

using Shell ..</i>

When you choose the option temp file then the file adapter transfers the data of the file by writing the file in the specified directory by a temporary name ( You don't have to choose the temp file name. the system creates the name on its own)

Once the file is fully written the file is renamed with the name that you specified in the FileName paramter of the Adapter.

1. So you don't have to write the shell script.

2. the file adapter generates it's own temp name

3. the file adpater renames it once the file is fully written. you don't have to rename it.

Hope this helps

Regards

Vijaya

Former Member
0 Kudos

Hi,

I am not sure of the temporary file name scheme you have specified.

Try giving a smaller naming scheme.

You could do without this temporary naming scheme too. In case, a temporary file name is not specified, the adapter would provide the name by itself.

Regards,

Smitha.

Answers (2)

Answers (2)

Former Member
0 Kudos

there is a easier way, you can call OS commands after the writing of the file, which can rename your file to the required file name. you can build in all the intelligence in the scrips (shell or NT) which could take parameters as well for renaming files.

Former Member
0 Kudos

Hi,

from sap documentation (<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm">Configuring the Receiver File/FTP Adapter</a>):

<i>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.

</i>

This means that once the file is completely written in the target system it is renamed from the temporary file name to specified file name (final file name).

Hope it helps,

Regards,

Sergio