Receiver File adapter: dynamic folder name based on file name

Hi there,
is it possible to set up one communication channel that will use different target folders based on file name?
E.g.
File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
Thanks.

If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
In your abap mapping:
  DATA l_record type mpp_dynamic.
  l_record-namespace = 'http://sap.com/xi/XI/System/File'.
  l_record-name = 'FileName'.
  l_record-value = "your filename"
  dynamic_configuration->add_record( l_record ).
  l_record-namespace = 'http://sap.com/xi/XI/System/File'.
  l_record-name = 'Directory'.
  l_record-value = "your directory ".
  dynamic_configuration->add_record( l_record ).
Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
Regards,
Carme.

Similar Messages

  • Configure Sender File adapter dynamically

    Hi,
    I need to configure the sender file adapter dynamically. Ex: I will be providing the src dir , file name etc dynamically. I think this is not possible using module because module gets executed after file is picked (in my case file dir and file names need to be determined dynamically). I even don't won't to use directory API for craeting my file sender comm channel. Is there any other way to achive this.
    Regards,
    Rakesh

    Hi Rakesh,
         what is the Operating system of the PI server? Could you please kindly explain what conditions determine filename and source directory? I do not think there is anyway you can determine src file and dir names dynamically in PI.
    Here is what you can try.
    PI server is on windows system u need batch file. If its on unix or Linux you need scripts. Now what you have to do is place all files in a directory. Here the script/batch file will run continuously in background. Once it gets files it will rename files based on file content or file name then move them in different directories as per your conditions. your interface must have multiple communication channels and sender agreement (with diffrent parties) which will pick up those files from these directories.
    The name of directories will be fixed in each channel.
    regards
    Anupam

  • File Adapter: Is it possible to track files?

    Hello XI community,
    I've a scenario where the sender and receiver is the file adapter using NFS. When XI picks up the inbound file from a certain directory with a wildcard name like "T_xxx*" is there any chance to see the original name? In addition I'd like to know how to find out the relationship between the inbound filename and the outbound name which is actually created from the file adapter like "xxxxx_timestamp.xxx". The files I'm using are binaries so I don't use the file content in anyway. They are just passed through XI. But I'd like to track the files to be able to know which input file belongs to which output file. Maybe some of you know where to see this.
    Thanks in advance
    /Michael

    Hi once emore:
    take a look at this document:
    https://websmp201.sap-ag.de/nw-howtoguides
    -> exchange infrastructure -> how to Create Modules for the J2EE Adapter Engine
    it may help you:)
    Regards,
    michal

  • File Adapter does not process the same file twice

    SOA: 11.1.1.4 (non-HA).
    I have a file adapter that triggers when a new file gets to a directory; the file is not deleted after the process triggers.
    The process is supposed to call other services via a mediator and if any remote fault happens it should rollback automatically and re-trigger with the same file at the next polling interval.
    I have literally 3 scenarios:
    1). The file gets picked up once, the process fails and the file is never picked up again.
    Msg in log: The file : /xx/xx/xx/abc.xml is being ignored as it has already been processed
    2). If the mediator only routes to one service after the file gets picked up, it works as expect (that is rollback and restart at the next polling interval). If it has more than one sequential routing rule, I see the same error as above.
    3). File does not get picked up EVEN if I "touch" or rename the file.
    Msg in Log:
    File Adapter ProcessName Poller enqueuing file for processing :/xx/xx/xx/abc.xml
    File Adapter ProcessName Ignoring File : abc.xml as it is already enqued for processing.
    I have already checked, there is no permission issue.
    This is what my .jca file looks like:
    <adapter-config name="getFile" adapter="File Adapter" wsdlLocation="getFile.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter" UIincludeWildcard="*"/>
    <endpoint-activation portType="Read_ptt" operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.ScalableFileActivationSpec">
    <property name="DeleteFile" value="false"/>
    <property name="MinimumAge" value="5"/>
    <property name="SingleThreadModel" value="true"/>
    <property name="PhysicalDirectory" value="/xx/xx"/>
    <property name="Recursive" value="false"/>
    <property name="PollingFrequency" value="20"/>
    <property name="IncludeFiles" value=".*"/>
    <property name="UseHeaders" value="true"/>
    <property name="MaxRaiseSize" value="5"/>
    <property name="ListSorter" value="oracle.tip.adapter.file.inbound.listing.TimestampSorterAscending"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    Thanks for looking into it in advance.
    Any help with the error messages will be appreciated.

    You have to use MOVE operation, if there is any remote exception occured, then move the file to someother folder and again move back to the same folder where the file pickup will start.
    In that way you will be use the same file picked up next time when the polling happens.
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    Thanks,
    Vijay

  • File Adapter gets error while deleting the file

    Hi,
    We are running on PI 7.0 SP6. I built a simple integration scenario where a file is picked up from a certain directory on the server (PI server itself) and get processed according to some mapping rules and again put to an other directory. I used the file adapter for picking and putting the file with 2 different communication channels.
    My integration works fine. File is picked up processed and put into its new location.
    But the file adapter cannot work in archiving or deletion mode. So the file (to be picked up by PI) remains in its original location.
    I am getting the following error:
    Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/File##com.sap.aii.adapter.file.File2XI.deleteFile(FileHandle)#J2EE_GUEST#0####18a971f3338011dbcde800145e69a8d4#XI AF File2XI[:EBI:File_from_EBI_to_EXS]##0#0#Error#1#com.sap.aii.adapter.file.File2XI#Java###Deleting of file failed - cannot proceed#1#E:
    SCENARIOS
    EBITOEXS
    RFID
    GELEN
    tagdata22082006035719.xml#
    #1.5#00145E69A8D4005B0000004700000A6400041BC49A1D56D3#1156431120046#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/File##com.sap.aii.adapter.file.File2XI.processFileList()#J2EE_GUEST#0####18a971f3338011dbcde800145e69a8d4#XI AF File2XI[:EBI:File_from_EBI_to_EXS]##0#0#Error#1#com.sap.aii.adapter.file.File2XI#Plain###File 'E:
    SCENARIOS
    EBITOEXS
    RFID
    GELEN
    tagdata22082006035719.xml' - deleting after processing failed - retry#
    I tried everything but upgrading to a higher SP level and will do so unless anyone has an other suggestion.
    Thanks a lot,
    Murat Gölcü
    [email protected]

    Hi,
    These are a few things you can do:
    Check the permissions of the folder where the file is being Placed. (it will mostly have only read permission, this is what i could understand from your explanation)
    If you are doing Content conversion, please can you just remove it and see if the XML file is getting generated.
    Also, please check if it's picked up by any other application when you place it on the server.
    Regards,
    Abhy

  • File adapter didn't read the whole file

    Hi folks,
    we use the file adapter since 1 year and in the majority of cases it works fine. But sometimes the file adapter didn't read the whole file. In SAP we are missing some parts. Funnily enough in this cases he archive the whole file and not only the executed parts . Know anybody whats the reason of this effect and how we can solve it?
    Kind regards Johann M.

    Johann
    I think you miss understood me/I didn;t explain myself very well....
    If you take the file that doesn't work/process correctly, can you replicate the issue where the whole file is not copied across.
    If you can, you should be able to extend the FTP/File adapter trace file to find the cause if this issue.
    Log onto Visual Admin.
    &#61680;     Services
    &#61680;     Log Configurator
    &#61680;     Locations
    &#61680;     Choose the location (Java package) and the tracing level (severity)
    (for example, com.sap.aii.adapter.file)
    &#61680;     Root Location > com > sap > aii > File
    &#61680;     Set the severity and choose Copy Severity to Subtree
    Run interface and then check the trace file - remember to switch this back to Error...

  • Receiver File Adapter - Dynamic FTP Server Address

    Hi,  I would like to pass the FTP Server address to the Receiver File Adapter as an parameter.  Is this possible and if so what Name Space / Parametr Names add to the Product to define these values.
    Thanks
    Andre

    Hi Andre,
    If you have your server as a part of your payload, thendynamic file server generation concept can be done is as follows. 
    In your server name 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

  • File Adapter: Dynamic file name

    Hello,
    I would like to use a filename like this:
    Name.<DOCNUM>.Direction.<Timestamp>
    For DOCNUM I use variable substitution. Works fine.
    For <Timestamp> I need a different format as the timestamp function
    in file adapter create. So I try to set up my timestamp in mapping like
    dynamic file name:
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Timestamp");
    conf.put(key1, a);
    Input a is date function which creates my desired timestamp format. In file adapter I try this:
    Name.%DOCNUM%.Direction.%Timestamp%
    or
    Name.%DOCNUM%.Direction.Timestamp
    or
    Timestamp
    all doesn't work for Timestamp.
    So is there a possibility to configure a dynamic filename like this???
    Is there a possibility to access dynamic configuration variables in dynamic filename except
    the known for filename and directory??
    thanks
    chris
    Edited by: Christian Riekenberg on Mar 10, 2009 4:02 PM
    Edited by: Christian Riekenberg on Mar 10, 2009 4:05 PM

    your file name needs to be
    Name.<DOCNUM>.Direction.<Timestamp>
    dont use variable substitution. use only dynamic configuration and set the file name
    introduce a logic that will create the string
    Name.<DOCNUM>.Direction.<Timestamp>
    eg. String filename = "Name" + var_docnum + "Direction" + var_timestamp;
    then use the dynamic conf code to set the file name and use adapter specific properties in you adapter to retrieve it.
    Ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • How to create a write operation in file adapter dynamically in to a folder.

    Hi all
    i want to explain my scenario...
    i am giving input to file adpter which is having read operation,and i am giving that input to an human work flow.i had two operations reject and resubmit in my task flow...i am editing the task with some changes...and resubmiting the task from the oracle bpm worklist.......now how can i give that task to again my input folder.....
    and another question is,
    if i am using three file adpters with 3 differnt folder structure having read operations.and i am giving only one file to one file adapter.and i am giving it to human work flow and i am editing it and i have to resubmit the file to the input folder.....so i i have to give back to input folder dynamically(with out hard coding the folder structure).....How can i give ?????
    so any one can help me....please...
    Thanks in advance...
    varma.

    ya...its gd....but i had a problem in my scenariou....
    i used this concept as a error handling frame work....that means
    i had so many composites which take purchase order as its input from a file adapter........if the input order differs from my xsd,i populated that input as a error file in another folder using some fault handlers... and i am giving that folder to human work flow and i a m editing that task and i am resubmiting it...so that it should go to the input folder of my composites as a input again...so how to differ ,for which composite i have to give as this task as input again.....dynamically it should vary in ...........
    please help me....
    thanks in advance....
    varma

  • Receiver SOAP Adapter - Dynamic username & password

    Hi,
    I am working on a scenario where the receiver SOAP adapter will have dynamic user name & password. but the URL remains same. how do we achieve this.
    Thanks,
    Mahesh

    Hi Baskar,
    I have checked all your Replies in SDN related to SOAP Header Creation for Wssec Web Service.
    I am working on a Interface (CRM Proxy to Web Service having wssec) in PI 7.0 SP6. I have created the SOAP Header by using XSLT mapping to pass the username token and password but hardcoding user credentials in the XSLT mapping doesn't sound too neat. And transporting it from D to Q to P is even worse.
    And also i have 2 username and 2 passwords to access to different instances in the same web service. So i have to pass the different Username and Password based on the Instance in SOAP header dynamically using XSLT mapping.
    Therefore i request you help me out on how to pass the Username and password dynamically in the XSLT mapping to Create dynamic SOAP Header to access different instances.
    If possible can you provide step-by-step aproach including XSLT mapping and Code for dynamic SOAP Header creation.
    Thank you very much for your valuable inputs.
    Regards,
    Ajay Kodali.

  • Sender File Adapter - Dynamic Filename?

    Dear All,
    I have a simple requirement to retrieve a file named "XXX_ddmmyy" from an FTP site. The FTP site administrator will place a new file everyday. The date is part of the filename.
    I can find a lot of information on how to set the Filename for a "Receiver File Adapter", but none about dynamically setting of the filename for a "Sender File Adapter".
    Can you help please?
    Kind Regards
    Farshad

    Hi,
    You have mentioned over here that the requirement is to get the file "XXX_ddmmyy" from an FTP site.
    Is that site strictly for keeping files related to your requirement only or lot of other files are also being placed???
    If its strictly related to your requirement then you can use the filename "*.extension" and set the processing mode as "delete" so that once the File Adapter picks the file it will be automatically deleted.
    But here disadvantage is that the file wont be no longer present in FTP site once it is picked by File adapter.
    Thanks,
    Lekshmi.

  • How to send mails to "CC" and "BCC" using receiver mail adapter dynamically

    Hi,
    Due to business requirement PI need to send mails dynamically to u201CCCu201D and u201CBCCu201D using receiver mail adapter.
    We have an option to send mails to u201CTou201D dynamically, but are there any option to send mails u201CCCu201D and u201CBCCu201D dynamically.
    Please some help to resolve the issue. Thanks
    Regards,
    Sreeramulu Konjeti.

    Hi Sreeramulu,
    As mentioned by Lucas, you can use the UDF. Inn addition to that, you need to define the Variable Headers under Variable transport binding after enabling the Adapter Specific Message Attributes.
    For the Enabling ASMA, follow the below steps and check for the variable attributes.
    Select the Advanced  tab page.
       To save adapter-specific attributes in the message header of the XI message, select Use Adapter-Specific Message Attributes and Variable Transport Binding.
    The following attributes in the message header are then available for processing:
    ○       User: (technical name: TServerLocation)
    ○       Authentication key: (technical name: TAuthKey)
    The following mail header fields are available for processing:
    ○       From: (technical name: THeaderFROM)
    ○       To: (technical name: THeaderTO)
    ○       Cc: (technical name: THeaderCC)
    ○       Bcc: (technical name: THeaderBCC)
    ○       Subject: (technical name: THeaderSUBJECT)
    ○       Reference to the mail that is to be replied to: (technical name: THeaderIN-REPLY-TO)
    ○       Reply to: (technical name: THeaderREPLY-TO)
    ○       Mail client program: (technical name: THeaderX-MAILER)
    ○       Send confirmation of receipt: (technical name: THeaderDISPOSITION-NOTIFICATION-TO)
    ○       Priority: (technical name: THeaderPRIORITY)
    ○       Importance of message: (technical name: THeaderIMPORTANCE)
       To transfer further header fields, set the relevant indicator for Variable Header. The technical names for the fields are XHeaderName1, XHeaderName2, and XHeaderName3.
    The parameters are included in the mail header under the names specified here.
    The attribute namespace for the adapter is http://sap.com/xi/XI/System/Mail.
    Thanks,

  • File Adapter dynamic configuration

    Hi,
    I would like to know how to configure location,polling frequency, file name dynamically at runtime.?
    Is there any possibility to read configuration/property file at time?
    Regards,
    Govind

    Which SOA Suite Version you are using ? You can change the directory and file details. Pls refer Re: Get File name using File Adapter Hope that will help you.

  • File adapter - Write - Elapsed Time based batching not working.

    We are creating an asynchronous BPEL process that creates a file every 2 mins with the messages the BPEL process received in the last 2 minutes. We are using a file adapter with only "elapsed time" set to 2 minutes (Number of Messages and File size disabled) . If we deploy this into BPEL console and use bpel console's stress test feature, it doesnt create any file at all. If we use a file adapter based on Number of messages, it works fine. Can any one of you suggest what could be the problem ?

    Unfortunately, this is documented bahaviour (solution/workaround anyone?!):
    Elapsed Time Exceeds:
    Specify a time which, when exceeded, causes a new outgoing file to be created.
    Note:
    The Elapsed Time Exceeds batching criteria is evaluated and a new outgoing file is created, only when an invocation happens.
    For example, if you specify that elapsed time exceeds 15 seconds, then the first message that is received is not written out, even after 15 seconds, as batching conditions are not valid. If a second message is received, then batching conditions become valid for the first one, and an output file is created when the elapsed time exceeds 15 seconds.

  • Receiver file adapter posts multiples for singel source files

    Hi,
    I am using wild character in my input source ftp adapter but my receiver file adapter is creating multiple duplicate files. I am not sure why this happens as QOS is set to "Exactly Once" with archive processing mode. I tried with delete mode and the same error occurs. We had no problems testing it in our Dev environment but in QA its acting so strangely...Any advise is appreciated..
    -Teresa

    Hi,
    2. Homany files you posted at oubound directory?
    1.             You said duplicate files at receiver side, is the files having time stamp? if so those are not duplicate files.
    Thanks,
    Satish.

Maybe you are looking for

  • Vertical/Horizontal Scroll Bars in Numbers 3.0

    Just upgraded from Numbers 2.0.1 today.  I have a few simple spreadsheets that were converted to 3.0 that now have horizontal and vertical scroll bars that take the page WAY past where the sheet data is.  In fact, when I create a blank document, the

  • Is there a way to hav my ipod linked to more than 5 computers

    I have somehow linked my ipod to five computers.  I have a new laptop and it will not allow me to link my ipod due being linked to to many computers.  I only want to use this new laptop

  • How many pins does a FireWire 800 have?

    I'm trying to determine if a fire wire 800 is interchangeable with a fire wire (IEEE 1394a) 6 pin cable. 

  • Trying to get proper sound

    Hi, I have very low sound in my laptop with alsa so I wanted to try pulseaudio and oss. In ubuntu sound works great which has pulse by default. I tried setting up pulse in Arch with KDE but it doesn't seem to work. I tried oss and it doesn't work eit

  • Coding a button with 3 instances

    I have 3 images: 1.png, 2.png, and 3.png. Image 1.png is my "UP" state for my button. (the image for the button at normal with no activity) Image 2.png is my "OVER" state for my button. (when my mouse is hovering over the image) and Image 3.png is my