Dynamic Filename Error

Hi all,
I have the requirement of getting same file name with timestamp on the receiver side (EX.Filename_timestamp) by modifying the Adapterspecific messageattributes refering the following blog
Re: Regarding Target File name
and wrote the code as specifeid in the blog as follows mapped to some
dummy variable on the target side
//write your code here
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");
FileName = conf1.get(key1);
TimeStamp  = container.getTransformationParameters().get
(StreamTransformationConstants.TIME_SENT).toString();
FileName = FileName.replaceAll( ".txt" ,"_" );
FileName = FileName;
conf1.put(key1,FileName);
return  FileName; 
but iam getting an error as follows in the receiver side communication channel moniroting.
Message processing failed. Cause:com.sap.aii.af.ra.ms.api.RecoverableException: Rename failed.:
com.sap.aii.adapter.file.ftp.FTPEx: 550 Rename failed.
An error occurred while connecting to the FTP server '10.6.161.65:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 Rename failed.'. For details, contact your FTP server vendor.
Can anybody give me an idea of how to reslove the error.
Thanks,
Ram.

I dont think it is a permission issue...it seems to be due to the way the UDF is defined....are you successful in giving the fileName (without TImeStamp)....
also can you change the String FileName = ""; to String fileName = ""; .....may be it is conflicting with the
DynamicConfigurationKey key1 = DynamicConfigurationKey.create            ("http://sap.com/xi/XI/System/File","FileName");
Also when you do Dynamic Configuration the return statement is not needed....the value gets populated into the ASMA attribute directly....
Edited by: abhishek salvi on Jun 12, 2009 12:59 PM

Similar Messages

  • File receiver: Dynamic Filenames error

    Hi
    I get an error in my File receiver adapter..
    Receiver Adapter v1730 for Party '', Service 'SenderSystem':
    Configured at 19:32:43 2005-08-01
    Last message processing started 19:33:26 2005-08-01, Error: Message processing failed with java.text.ParseException: Variable 'test' not found in variable substitution table
    We are currently on XI Sp12 patch level3.I have enabled the Variable substitution option and have defined a variable "test" used in defining the file name scheme.The reference points to a node value in the payload.
    I have checked the config xml for the channel which does contain this value test in the variable table..Am I missing anything???
    the config xml is as below:
    [code]2005-08-01 19:32:43 : ToFile
    Raw configuration data ***
    Transport protocol: File, version
    Message protocol: File, version 3.0.0527
    ftp.user|anonymous
    file.varSubstitution|true
    file.adapterStatus|active
    file.addParameterParams|*** TABLE , 0 ROWS DEFINED ***
    file.execute|
    file.targetFileName|%test%.xml
    ftp.overwrite|false
    file.counterMode|immediately
    file.encoding|
    file.overwrite|true
    ftp.transferMode|bin
    ftp.anonymous|false
    ftp.port|21
    file.advanced|false
    file.varSubstitutionDisableSecurity|true
    ftp.targetDir|null
    ftp.host|null
    file.counterSeparator|
    file.counterFormat|00000
    file.varSubstitutionParams|*** TABLE , 1 ROWS DEFINED ***
    file.varSubstitutionParams|file.varSubstitutionParams$0$file.varSubstitutionParamName$test
    file.varSubstitutionParams|file.varSubstitutionParams$0$file.varSubstitutionParamValue$payload:input,1,filenode,1,filename,1
    file.type|bin
    file.targetDir|//10.201.103.253/download
    ftp.password|***
    ftp.putSafe|YES
    file.writeMode|addTimeStamp
    ftp.writeMode|addTimeStamp
    file.recordsetStructure|null
    file.conversionParameters|*** TABLE , 0 ROWS DEFINED ***
    ftp.connection|permanently
    file.counterStep|1
    Used configuration data ***
    'MessageProtocol': 'File'
    'TransportProtocol': 'File'
    'file.adapterStatus': 'active'
    'file.advanced': 'false'
    'file.encoding': ''
    'file.execute': ''
    'file.overwrite': 'true'
    'file.targetDir': '//10.201.103.253/download'
    'file.targetFileName': '%test%.xml'
    'file.type': 'bin'
    'file.varSubstitution': 'true'
    'file.varSubstitutionDisableSecurity': 'true'
    'file.waitForExecute': '0'
    'file.writeMode': 'addTimeStamp'
    OK - initialized
    [/code]

    Sri,
    You have specified payload:input,1..... in ur variable substitution configuration. Is "input" the name of ur Message Type object in repository. If not, specify the name of the Message Type referred to in ur inbound interface.
    We tried this option and generated an additional field in the XML data given as input to the file receiver adapter, to be used for substitution purpose only. We avoided specifying this field in our content conversion , however it still gets written to the file!! if u able to crack it let us know
    -Saravana

  • Dynamic Filename in Fileadapter

    Hi all,
    I like to use the new feature (SP15) of the "Adapter Specific Message Properties" but with out success. I have read Michaels Blog "XI: The same filename from a sender to a receiver file adapter - SP14" but it give me not a clue how to use these properties during the normal receiver configuration and also the manual is not very clear about it. I have set a Variable with "FileName    message:FileName" (I have tried also "message:File_Name") Than I have used this filename Variable in the field "Filename Schema" like %FileName%. But I allways got this error: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Unknown message header category 'FileName' for variable 'FileName'.
    What have I missed out here?
    Thankx
    Manfred Schmidt-Voigt

    Hi Manfred,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • Dynamic Filename

    Hi
    i am using the variable substitution method in file adapter for dynamic filenam.e But the adapter is throwing error saying
    "Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1"
    am using the variable %var1%.dat in the filename.
    Any idea why happens. Am in SP14.
    And if use Adpter specific message properties, it is saying FileName missing. Even if i give this as variable it is not taking.
    Regards
    Andy

    Anandan
    Check the help..If its part of message Payload you need to prefix with  <b>payload:</b>
    %% isused incase of attributes of the message header
    Chk the help@
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>

  • Dynamic filename in XI

    Hi,
    In XI SP12 is possible to use dynamic filename? I need to generate a filename in Adapter using the content of an element in message, how I do it?
    thanks.

    Hi Elton,
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Regards,
    Bhavesh

  • Dynamic filename in receiver AS2 adapter in B2B Add-on

    Hello Experts,
    Can you please let me know how we can put dynamic filename in the receiver AS2 adapter for B2B Addon on SAP 7.4.
    Thanks
    Saurabh

    Hi Ryan / Experts,
    Let me explain you in more detail.
    In the receiver AS2 Communication channel, if I keep the Filename field as blank as shown below, then in the Mendelson inbox folder, a file is generated with the name "ASJAVA_DX5" which is my business component name.
    If I fill the filname field for example with "CONTRL", then in the Mendelson inbox folder, a file is generated with the name "CONTRL".
    This is my requirement because, suppose i trigger this interface "first time", a file with static name (ASJAVA_DX5/CONTRL ) would be generated in the inbox folder. If I trigger this interface "second time", since the file already exists with same name, it is not overwritten and I cannot check the output of 2nd trigger . Contents are not overwritten.
    To solve this problem + as a general requirement, I wish to have this name to be dynamic, atleast with date+timestamp.
    Can you please help.

  • Dynamic Filename in BPM process (SOAP with attachm. and PayloadSwapBean)

    Hello together
    I have the following BPM process:
    1. IDoc=>WebServiceRequest
    2. WebServiceResponse (payload) => IDoc
    3. WebServiceResponse (attachment) => File
    XI receivs an IDoc an map it to an WebService. The Webservice is called by XI and we receive the WebServiceResponse including a PDF attachment.
    The challenge is to store the PDF attachment with a dynamic filename from the payload of WebServiceResponse.
    We use the PayloadSwapBean to change the payload to the PDF attachment. But then we are not able to access the required information on the original WebService-XML-Response via variable substitution.
    Is there a solution in the standard or have we to use a custom adapter module?
    Thx
    manuku

    Hi Jayasimha,
    We can do this by "Adapter Specific Message Properties" of ur comunication channels.
    1.If u want to keep the output filename same as input filename, no need to use the UDF. only the 'adapter specific parameters' in both sender n receiver file adapter will do that.
    In case if u want to get the filename inside our mapping we have to create a user defined function
    which will return the filename and map it to one of our XML tags. 2nd point gives solution 4 that:
    2. If u want to generate an output file taking some input from the payload,then u hav to use the UDF.There u hav to populate the name.
    Pretty much.... if you set an attribute from the sender side, for example, you can use a UDF and access the particular attribute sent and use it in the mapping. In another example, where no attributes are sent from the sender, you can still actually set a particular attribute, say a filename derived from the payload, using a UDF, and enable the receiver attribute to use it. That's where the UDFs come in - either to get or set particular adapter specific message attributes.
    This will be a very helpful blog which solves ur query:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Vinod.

  • FTP how to pass dynamic filename/directory location - reading a file in 11g

    Hi All,
    We r using FTP adapter(SOA 11g) for getting files in remote server, May i know how to pass dynamic filename and directory where the file exists for reading in server.
    Thanks,
    Rak

    Hey according to my understanding, the Dynamic partner links are set only for the Outbound invocations only. Is my understanding right? if so, how do we create the dynamic partnerlinks for the ftp get kind of stuff...??
    Thanks in advance

  • Dynamic filename configuration via custom EJB

    Hi Experts,
                        We are doing a poc on whether we can do the dynamic filename configuration,i.e. set the file name dynamically in a custom EJB deployed on the server and called in the sender comm. channel of any J2EE based adapter.
    The requirement is for some interfaces, there is no mapping requirement other then setting the filename dynamically, which maybe based on a certain value of the input file or a specific portion of string in the payload.
    The custom EJB takes the namespace and attribute as input parameters along with other string manupulation parameters to determine the receiver file name. That is if we are using sender JMS adapter, we can have namespace = http://sap.com/xi/XI/System/JMS and attribute as DCJMSMessageProperty1. The bean would read the value and perform the manipulation based on certain other input parameters and set the file.
    There is one particular bean : AF_Modules/DynamicConfigurationBean but it does not allow us to manipulate the filename.
    Any help would be much appreciated.
    Regards,
    Shiladitya

    Hi,
    please refer to the following links for your reference
    Re: Reading Dynamic Configuration information in side adapter module.
    Re: Dynamic Filename in File adapter
    Regards,
    Bhanu

  • ABAP mapping split messages and dynamic filename

    Hello,
    i have set up a IDOC to file scenario where the IDOC is split into several files, which works fine. In addition to this it is required to set a dynamic filename out of the ABAP mapping for each file. If only one file is created this works already as well but how do you set the dynamic configuration when the messages are split?
    Regards,
    Andreas
    Edited by: Andreas on Feb 26, 2009 9:09 AM

    you cannot do dynamic configuration for message splits. The below is from SAP help.
    Adapter-Specific Attributes and Multi-Mappings
    In multi-mappings, there are multiple message headers with adapter-specific attributes. The mapping API can only access one message header. This has the following consequences depending on whether there are multiple source or target messages:
    u25CF     1:n Transformation
    If there are multiple target messages, the header for the adapter-specific attributes is copied for each message. This means that you can only create one header for all adapter-specific attributes, and not individual headers.
    u25CF     n:1 Transformation
    This variant is only possible for multi-mappings in integration processes. If there is more than one source message, read-access to the adapter-specific attributes of the various message headers is not possible at runtime.
    u25CF     m:n Transformation
    All afore-mentioned restrictions apply here. Developers can at most write the same adapter-specific attributes for all target messages to the header, without read-access to the attributes of the source messages. m:n transformations are only supported within integration processes.
    What i will suggest is to use BPM to have the message split i.e 1:N mapping and then after that have another mapping 1-1 to have the dynamic configuration

  • How to pass dynamic filename to Receiver JMS channel

    Hi experts,
    I want to pass the dynamic filename to receiver JMS message Properties.
    for example
    I am passing directory name via adapter module AF_Modules/DynamicConfigurationBean with key and value combination like below. How to pass dynamic filename value to a dynamic property ( say DCJMSMessageProperty1)
    eg.
    key.0 - >insert http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0
    value.0 - >  testdirectory ( which is static value)
    Note: Im have not created any ESR object . i just have to bypass the file to a jms queue. I have used AAE integrated configuration scenario ( file to jms )
    Regards,
    Balaji
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:45 PM
    Edited by: Balaji Pichaimuthu on Jan 27, 2011 4:46 PM

    Already given link for the dynamic configuration code snippet in the earlier reply... Below is the code snippet
    Note: Use Adapter Specific Message Attributes for the target Communication Channel(CC).Check the indicator for filename in the advanced tab of CC
    //UDF code
    String filename="";
    String NameSpace = "http:/"+"/sap.com/xi/XI/System/JMS";
    try{
          DynamicConfiguration conf = (DynamicConfiguration) param.get(
            StreamTransformationConstants.DYNAMIC_CONFIGURATION);
          DynamicConfigurationKey key  =  DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File",   "FileName");
           // read filename value
           filename = conf.get(key);     
          // So far we extracted filename value .. now do your logic  something like this...
          DynamicConfigurationKey key2 = DynamicConfigurationKey.create(NameSpace,"yourjmsvalue goes here");
           conf.put(key2,filename);
         } catch(Exception e){

  • Dynamic FileName based on environment

    Hi expert,
    I have a proxy to file scenario in which I create dynamic FileName using an UDF. I'm using UDF because filename must contains date with a particular date format (yyDHHmm).
    My need is to generate file name prefix based on environment, for example:
    In DEV environment FileName must start with T
    In QTY FileName must start with Q
    In Prod FileName must start with G.
    Is possible to catch the environment name in UDF (I think from DynamicConfiguration)?
    Which values I have to test in the IF statement?
    thanks,
    Fabio

    Hi Fabio,
    Is possible using:
    String EnvironmentName = (String) System.getProperty("SAPSYSTEMNAME");
    Then, you can use the IF statement and a Concatenate statement:
    String output = null;
    if (EnvironmentName == 'DEV') {
    output = "D" + Filename;
    } else if (EnvironmentName == 'QAS') {
    output = "Q" + Filename;
    } else if (EnvironmentName == 'PRD') {
    output = "P" + Filename;

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

  • Batch Export Filename Errors

    When doing a batch export I receive a message:
    "Batch Export Filename Error
    The output filename for this item already exists for another item in the export queue.
    To continue the export, enter a new base output filename below and select ok."
    I then have to assign some random file name for each or the default mattes and titles in my timeline that are all named “color,” "Title 3D." So I am naming them “color1” “color2” etc. I just went through naming a ton of them and now it is asking me the same questions again!
    How can I avoid all of this?
    Thanks for your help!

    I have 4 tracks in the timeline:
    V4: Title 3D
    V3: Color (it is a black matte)
    V2: Video clip
    A3: audio
    A4: audio
    The video is cut into clips and I have copied-and-pasted many instances of the title and color clips so that it continuously plays during the duration of all of the video.
    I did a select all of the timeline and dragged everything to a new bin and did a batch export.
    Should I be doing this another way???? It just keeps asking me to rename the filenames over and over again and never gets anywhere.

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

Maybe you are looking for

  • Can't install 2GB memory - 1.85mhz G5 (PowerPC)

    Hi, I have a 1.8 G5 It has 1 gb ram and a continuity module. In the last 3 weeks I have 1. Tried another 1GB for a max of 2GB. 3 beeps 2. tried a Matched pair of Kingston 1GB's 3 beeps. 3. tried a matched pair of Samsung MAC spec memory. 3 beeps. Eve

  • Status profile in sales order

    Dear All, I have a requirement  as below In status profile  maintained 5 statuses in the sales order when the user  releases 4th status system should not allow to change the sales order .

  • Why don't the FAQ's in this Sub-Forum Work?

    Why don't the FAQ's in this Sub-Forum Work?  Not in Firefox 22.0 or IE 8-latest.

  • Response Payload (Mapped XML) in SXMB_MONI

    Hi, I found many posts with the same question and but couldn't get an answer Posting it again! I can find the request and response( XML after mapping) if it is a X - IDoc scenario. But for IDoc - X scenarios I can find only the request payload which

  • HT4759 how do I find my ipod that was stolen?

    how do I find my ipod gen 5 that was stolen? I regestered the ipod as usual, and have the serial number.