cancel
Showing results for 
Search instead for 
Did you mean: 

Change file extension while archiving files on FTP

former_member184789
Active Contributor
0 Kudos

Hi,

I have a File to IDoc scenario with FCC & FTPS on sender side. I need to archive the files but the file which I receive has extension .txt while I need to archive them with a different extension say .dat. How could I change the extension while archiving the files.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if the above thing does not work...

Create one more receiver with file adapter as receiver and place the file in the archiving directory with the extension you needed...

HTH

Rajesh

former_member184789
Active Contributor
0 Kudos

Hi,

If I go with the option of having another config and have a receiver channel with archive dir, then I must be having the dynamic config so that I can have the same file name. I have the Java mapping code for dynamic config, but I am not sure as to how to configure for this requirement. If I create another operation mapping with the same sender Interface, I am getting error as Interface determination did not yield any actual interface. The Java mapping is correct, but the scenario is not working..Could you help out..

Former Member
0 Kudos

Hi,

Create Message Mapping with the same source and target structures and ensure UDF for retrieving the file name gets executed...

Create two receivers in receiver determination and create interface determination and receiver agreements in case you are using dual stack PI server...

HTH

Rajesh

former_member184789
Active Contributor
0 Kudos

Thanks to you and also to everyone. I have almost achieved my requirement. I am facing some mapping issues because of the hierarchy for which I have raised a separate thread. Thanks everyone.

Answers (5)

Answers (5)

gagandeep_batra
Active Contributor
0 Kudos

Hi Adarsh,

If you are using NFS protocol and archive on local network as kancham suggest  you can do this using RunOS command after message processing ,

you have to create dummy folder for archive where your message is archived and then use  move command/or copy command to copy/move file to your original archive folder with ur require extention

eg.

copy c:\dummy\file.txt c:\orignal\file.bak

copy c:\dummy\*.txt c:\orignal\*.bak

Regards

Gagan

former_member184789
Active Contributor
0 Kudos

We have FTP. Is there any other way apart from having additional file channel and Run OS command. Also if I go with Run OS command, what exactly do I need to give in there  for the format mentioned above i.e FileName_Timestamp.bak

Former Member
0 Kudos

Hi Adarsh,

you have to create one more service interface in Repository and then create a new File communication channel with reuired file extension and a integrated configuration (Rec.agg/Int.det/Rec.det.)

Regards,

Prasanth

former_member184789
Active Contributor
0 Kudos

Actually my requirement is to have in archive as Original Filename (without ext) + CurrentTimestamp + “.bak”. Since as such the time stamp is added as TimeStamp_FileName.extension etc. Note how the position of timestamp is also different in my case. I dont want to have another bypass scenario. I want to archive as .bak while I get the files as .txt or .dat

venkatagiri_gongadi
Participant
0 Kudos

Hi,

plase check below URL ,it may help you,

http://scn.sap.com/thread/1609007

Regards,

Girii

venkatagiri_gongadi
Participant
0 Kudos

Hi,

I thnik it would be handled by Bypass scenario(file to file ) with receiver file communication channel with required extension,you need to create dummy objects in IR and ID and receiver file comm channel.

Regards,

Girii

former_member201264
Active Contributor
0 Kudos

Hi,

I am not sure but you can try with RUN OS COMMANDS AFTER MESSAGE Processing.

Regards,

Sree.