cancel
Showing results for 
Search instead for 
Did you mean: 

Bypass scenario with a specific file naming schema

Former Member
0 Kudos

Hi,

I am working on a bypass scenario where I pick a file from FTP location with naming conventions SCOS2UVMS_.TXT and place the file at other location with the name USED_Car.TXT.

Now I have to place this file with the Date and Time Stamp as DYYMMDD.THHMMSS.

How can I achieve this?

Thanks & Regards,

Sachi

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Sachi,

Do like this:

1. In receiver FileAdapter give filenameschema as

USED_Car.TXT

2. In the use OS Commands after message processing give like this


cmd /C "REN %F USED_Car.D%date:~12,2%%date:~4,2%%date:~7,2%.T%time:~0,2%%time:~3,2%%time:~6,2%.TXT"

PS: If required add quotes at the start and end of the OS commands

Regards

Suraj

Answers (6)

Answers (6)

Former Member
0 Kudos

Thanks Suraj

It worked...

former_member206760
Active Contributor
0 Kudos

Hi Sachi ,

For generating the filename the way you require...you will have to use IR. In the Graphical mapping u have to create a UDF and play with the filename using dynamic configuration. also click the filename checkbox in the adapter specific message attribiute on the sender and reciver adapter

e.g.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

int i;

StringBuffer str1 = new StringBuffer("");

for(i=ourSourceFileName.length()-6;i<ourSourceFileName.length();i++)

{str1.append(ourSourceFileName.charAt(i));

}

String ourTargetFileName = "XYZ" + str1;

conf.put(key, ourTargetFileName);

return ourTargetFileName;

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

you can use add time stamp option in Receiver communication channel,if you want time stamp format t your desire format then you have to write UDF,but the problrm here is ,if no IR means its not possible to add UDF,for that you have to develop dummy mapping in IR.

SO ITS NOT A RIGHT IDEA,better to Time stamp option in Receiver CC,development of this interface very easy,you can refer above replies.

Regards,

Raj

Former Member
0 Kudos

Hi,

U can bypass the Integration repository steps and pass a file from 1 locatio to other.

U need to configure only the Integration Directory. In all the objects (sender agreement,Receiver determination,Interface determination,Receiver agreement) just give the interface name as dummy and name space also dummy.

Means u just give a arbitary interface name and namespace,which doesn't exist.

Then run the sender communication channel and check in target directory.

This will work fine....

But i think its nt a good idea to use SAP PI, for the just sake of transferring the files from 1 location to other.

U can schedule a batch file,and move the files b/w two locations.

I hope this will solve ur problem..

Babu

Former Member
0 Kudos

Hi,

If I understood your problem correctly then this Thread might help you:

[;

Regards

Rahul

jyothi_anagani
Active Contributor
0 Kudos

Hi,

Refer This WIKI

http://wiki.sdn.sap.com/wiki/display/XI/File%20to%20file%20without%20using%20with%20Integration%20Re...

This is File to file without using with Integration Repository .

The same way you can do.

Thanks.

Former Member
0 Kudos

hi jyothi

this is anjiram file to file scenario 1,2 variable skip how to pick the 3rd variable plz give me reply