cancel
Showing results for 
Search instead for 
Did you mean: 

Naming convention

Former Member
0 Kudos

Hello every one,

I have just built a file to file interface and tested it its fine but i have got a small isuue with my file naming convention, here is the requirement

For the naming convention of the source file, we will use AckDelPre_CCYYMMDD-HHMMSS.csv

For the naming convention of the target file, we will use AckDel_CCYYMMDDHHMMSS.xml, what my doubt is how do i name the file, i mean the target file is autometically saving like this AckDel_CCYYMMDD-HH-MM-SS.xml, what should i do

My question might be dumb, but please pardon me i am really new to PI

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

naming convention of the source file, we will use AckDelPre_CCYYMMDD-HHMMSS.csv

PI does not accept Special characters like /,,:,*,?,",<,>,|,;,,,=,&,%,[,],#.

Please go through below blog how to use naming conventions in PI,

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40a66d0e-fe5e-2c10-8a85-e418b59ab...

regards,

ganesh.

Edited by: ganesh.nijampudi on Dec 15, 2011 7:11 AM

rajasekhar_reddy14
Active Contributor
0 Kudos

@Ganesh:

is your reply is relevant to the thread, i think not

Former Member
0 Kudos

Hi,

Sorry for pervious post.

by using ASMA properties you can acheive this,

try {

String filename = "";

String timestamp = "";

DynamicConfiguration conf1 = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");

filename = conf1.get(key1);

timestamp = conf1.get(key2);

filename = filename.replaceAll( ".txt" ,"_" );

filename = filenametimestamp".xml";

conf1.put(key1,filename);

return filename;

}

catch(Exception e)

{

String exception = e.toString();

return exception;

}

regards,

ganesh.

Answers (3)

Answers (3)

rajasekhar_reddy14
Active Contributor
0 Kudos

you need to go for dynamic configuration UDF in mapping level to assign your target file name as per your requirement.

search in sdn. you will find code.

Former Member
0 Kudos

Use Dyanmic configuration UDF for the file name

AckDel_CC is the constant

YYMMDDHHMMSS can be achevied by currentdate fn(if its system date) or if its a payload value use the specific field and use date trans fn.

Dont forget to tick Adapter Specific message attributes-- File Name in Receiverc omm Channel.

Former Member
0 Kudos

hi,

we will use AckDel_CCYYMMDDHHMMSS.xml, what my doubt is how do i name the file, i mean the target file is autometically saving like this AckDel_CCYYMMDD-HH-MM-SS.xml, what should i do

you ned to follow below steps

ESr:

IN Mapping level :

constant(AckDel_CC) + current date(YYMMDDHHMMSS) of date function group -> Concat-> Constant(.xml) -> concat-> Dynamic config(udf)->target.

dynamic config:

String DynamicConfiguration(String a, Container container) throws StreamTransformationException{

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

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

conf.put(key,a);

return "";

}

ID:

in receiver communication channel we need to enable ASMA and file name

thabnks,

Edited by: bhavanisankar.solasu on Dec 15, 2011 7:18 AM