Skip to Content
avatar image
Former Member

using dyanamic configuration create outputfilename

Hi all,

I have to create a file at targetside.But file name contains the timestampAAflowno+.gft like.

i am using below code but i get get the file name with the timestampAAflowno+.gft .

public String GetFileName(String CONST,String TID,String TIMESTAMP,String Filename,Container container){

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

String MyFileName = "";

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

if(Filename == "F1")

MyFileName = TID + CONST+ "_""_"TIMESTAMP+ ".GFT";

if(Filename == "F2")

MyFileName = TID + CONST+ "_""_"TIMESTAMP+ ".GFT";

if(MyFileName !="")

conf.put(key, MyFileName);

key= null;

return MyFileName;

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 25, 2011 at 12:34 PM

    Hi,

    I am giving the very basic UDF that you need to write for creating the output filename dynamically:

    public String CreateFileName(String CONST,String TID,String TIMESTAMP,Container container)
    {
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //conf.removeAll();
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename=TID+CONST+ TIMESTAMP+".gft";//if you want "flowno" and "AA", you can concatenate them in filename here 
    conf.put(key, fileName);
    key= null;
    return fileName;
    }
    

    HOPE IT HELPS YOU BUDDY!!!!!

    THANKS

    BISWAJIT

    Edited by: 007biswa on Feb 25, 2011 6:10 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 25, 2011 at 01:51 PM

    hi the function looks right, you probably need to play with the input parameters a big more.

    Add comment
    10|10000 characters needed characters exceeded