Skip to Content
author's profile photo Former Member
Former Member

Naming convention

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2011 at 06:05 AM

    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-e418b59ab36a?QuickLink=index&overridelayout=true

    regards,

    ganesh.

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Raja Sekhar Reddy

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2011 at 06:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 15, 2011 at 06:12 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 15, 2011 at 06:12 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.