Dynamic File naming in reciever File Adapter

Hi all,
I am using a reciever File adapter and my requirement is to generate 3 different file names based on the value of an element from the Payload.For example..
Say in Payload for the first Occurence of the Data segment which contains Field-1 and Field-1 Contains value X then filename should be  X.CSV,
same as
For the next occurence of the Data Segment if the Value of Field-1 is Y then File name should be Y.CSV.
Similarly For Z as well.
This is something like this...
SOurce Structure
================
IDOC
DATA SEGMENT-1
Field-1---> X
Field-2
Field 10
DATA SEGMENT-2
Field-1
Field-2
Field 10
DATA SEGMENT-3
Field-1
Field-2
Field 10
then the output and filenames  should be...
X.CSV
Field-1
Field-2
Field-3
Y.CSV
Field-1
Field-2
Field-3
Z.CSV
Field-1
Field-2
Field-3
Kindly help, is there any way i can do this using File Adapter Configurations .Please suggest.

Hi,
you can use a small business process.
There you will receiver the message in one receive step.
than you need a transformation Step with a mapping which split your message to several messages.
At least you have now a Multi Row container with one message for each data segment.
For sending each messages of this multirow container you need a block in BPM.. this you have to set to parallel processing.
Inside this block you have a sending step which send the single message.
and without BPM take a look at this Weblog(you need SP14):
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions me</a>
Regards,
Robin

Similar Messages

  • Output CSV File Naming Convention - Receiver File Adapter

    Dear SAP experts,
    I need help regarding my scenario.
    My scenario is this, Customer will send EDI message to XI. XI will then translate the message and convert it into XML.. After, a Receiver File Adapter will receive the XML then convert it into .csv file.
    I've already configured the Receiver File Adapter to convert the XML into .csv file.
    But, my problem now is how will I configure to have my output .csv file has a File Naming Convention.
    The output .csv file must be "CustomerName_YearMonthDate".
    From the EDI message, there is indicated Sender GLN in which, each customer has its own Sender GLN.
    E.g., Globus --> 200, Karstadt --> 300,  Metro --> 400.
    How will I configure so that I can have an output .csv file of,
    If Globus sends the EDI message, the output .csv file is Globus_20080304.csv.
    If Karstadt, Karstadt_20080304.csv.
    If Metro, Metro_20080304.csv.
    Kindly advise for a clear and complete solution.
    Thank you very much for your usual support.
    Fred

    Hi Nisar,
    My target message (XML) in the mapping is this,
    - <ns0:CSV>
        -  <SLI>
               <PERIO> </PERIO>
               <ILN> </ILN?
               <EAN> </EAN>
    perio, iln, and ean was rooted on SLI field. and the CSV is the rootnode of the target message.
    I have created a UDF on the message mapping to accomodate the output customer name, here is the codes:
    String fname="";
    if(GLN.equals("23456"))
    fname ="Globus" +dat;
    else if(GLN.equals("5678"))
    fname ="Karstadt"+dat;
    else if(GLN.equals("6789"))
    fname ="Metro"+dat;
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "FileName");
        conf.put(key,fname );
    E.g.,
    Globus --> 23456 (Sender GLN)
    Karstadt --> 5678 (Sender GLN)
    Metro --> 6789 (Sender GLN)
    This UDF i've made in the Message Mapping was mapped in the root node CSV.
    Is this UDF correct?
    Then on the File Receiver Configurations, here are the configs,
    Transport Protocol: File System (NFS)
    Message Protocol: File Content Conversion
    Adapter Engine: Integration Server
    File Access Parameters
    Target Directory: /var/opt/gsss/sample/csv
    File Name Scheme: .csv
    Processing Parameters
    File Construction Mode: Create
    - Overwrite Existing File
    Write Mode: Directly
    File Type: Text
    Variable Substitution --> ???
    Adapter Specific Message Attributes
    - Use Adapter-Specific Message Attributes
    - Fail if Adapter-Specific Message Attributes Missing
    - File Name
    Run Operating System Command After Message Processing
    Command Line: chmod 664%F
    Content Conversion Parameters
    Recordset Structure: SLI
    SLI.addHeaderLine: 3
    SLI.headerLine: PERIO;ILN;EAN
    SLI.fieldSeparator: ;
    SLI.endSeparator: 'nl'
    Adapter Status:
    Status: Active
    Kindly advise if my configs are correct.
    Thank you very much!
    Fred

  • Dynamic file naming for two or more files in same mappin

    Hello,
    I am working with Dynamic file naming on receiver files...
    Here two files are coming as output files...
    I am using JAva UDF to handle the two file name....
    But  one one file is formed and another is missing as its 505 file aleady existing error is coming in Receivr Communication channel monitoring...
    How to name different dynamic names for the two differenet files

    Hi Sunil,
    Go thru this blog:
    The specified item was not found.
    Use this Variable Substitution method as an alternative option:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
    OR
    The specified item was not found.
    Regards,
    Vinod.

  • Archiving in Reciever file adapter

    Hi .
    can any one plz help me in <b>archiving file's in reciever file adapter</b> .
    thanks
    shakif

    Hi Mohamed,
    Normally we acrchive the files only in the sender communicaton channel by selecting the processing mode as Archive and giving the path of the directory where the sucessfully processed files are to be placed int the archieve directory.
    There is no option to archieve the files in the receiver file adapter.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm">Configuring Sender File Adapter</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm">Configuring Receiver File Adapter</a>
    Regards
    Santhosh
    Remember to set the thread to solved when you have received a solution
    [url=Use a Good Subject Line, One Question Per Posting - Award Points;  Use a Good Subject Line, One Question Per Posting - Award Points[/url]

  • Error in reciever file adapter , where i am getting file name dynamically

    hi all,
    error in reciever file adapter , where i am getting file name dynamically, please help me in this isssue , i am trying for a long time
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)'

    i am getting new error
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
    this is my strcuture
    and i have changed my structure
    <HEADER>
    <ADDRESS1/>
    <ADDRESS2/>
    <ADDRESS3/>
    <ADDRESS4/>
    </HEADER>
    <HEADER_GST>
    <TAX1/>
    <TAX2/>
    <TAX3/>
    </HEADER_GST>
    <LINE>
    <QTY/>
    <UOM/>
    <UNIT_AMT/>
    <CHARGE_TO_DT/>
    </LINE>
    <FILENAME>
         <FILENAME/>
    </FILENAME>
    i have given the recordset structure as
    HEADER,HEADER_GST,LINE,FILE

  • Dynamic file naming with File/FTP adapter

    Hi all,
    I have a requirement for writing files with names of the files based on a customer ID.... a dynamic name based on a value retrieved from the customer DB.
    I have already tried using the dynamic file naming suggestion in the bpel dev guide, it does not work. I followed the instructions, the process fails to compile and throws "part" and "undefined variables" errors etc.
    Has anyone succesfully used file/ftp adapter to write files with dynamic file names (using a varibale), not %SEQ% or %datetime% formats?
    Thanks,
    Hasan

    You can create a header variable that will allow you to set the outbound file name inside the process. This variable is a message type. From the type chooser select:
    Message Types
    Partner Links
    Outbound Partner Link
    Outbound wsdl
    Message Types
    Imported WSDL
    fileAdapterOutboundHeader.wsdl
    OutboundHeader_msg
    This variable will have a part filename.
    Set this part to whatever you wish your file to be named.
    Select the invoke to your outbound file/ftp partnerlink. Move to the adapters tab and select the header variable you created as the Input Header Variable.

  • Dynamic naming of receiver file adapter

    Hello Friends,
    How to handle the dynamic file naming in XI at receiver side as file naming convention sequence to be incremented for every 1 hour...
    my Client expecting to handle at mapping...How to do this...
    Could any one give me the program if we need to do it in java...
    and pls also give another approach if any
    Setup dynamically ,

    >>as file naming convention sequence to be incremented for every 1 hour.
    Please elaborate this point. I'm again seeing same the question from your side.
    From Variable Substitution you can access only ASMA and can refer the payload element. But in the requirement is something else the you should have to go for Dynamic Configuration in Mapping program.
    Thanks
    Farooq
    Edited by: Farooq Farooqui on Aug 16, 2008 12:11 AM

  • Dynamic Filename for Reciever File Adapter

    Hi All,
    Can anyone answer to some of my quesries which are as follows
    a) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value.  I 
        search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e. 
    u201CAssuming that the following have been done and configured.
    1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
    2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
    b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
    c) .Can we trigger an RFC asynchronously and how?
    Your help is highly appreciated and
    Regards
    Faisal
    Edited by: Abdul Faisal on Nov 19, 2009 8:53 AM

    a) . Currently Iu2019m working on an IDOC-to-File scenario in which I need to create zip file on file server by using a payload value. I
    search sdn and found a bean that can be used to create zip file which is PayLoadZipBean. Iu2019m referring the below weblog for creating file name dynamically.
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    My question is can anyone explain or provide me the step by step procedure in detail for the prerequisite which are mention in the weblog, i.e.
    Hi  Use dynamic configuration UDF to create file name dynamically.its very easy search in sdn you will find the code,even you can create file directory name dynamically.
    In receiver file communication channel if you use PayLoadZipBean it will do Zipping of your message,for this you need to add this bean name additional parameters section in Receiver Channel.
    If you want to create zip file based on pay load value check the condition at mapping level based on that call the service,if you not required zip file in other case for that you need to create one more file receiver communication channel.
    u201CAssuming that the following have been done and configured.
    1.A value table has been created in the ABAP stack of the WAS in which XI is running and the entries as the file types, which will be written into the files are maintained.
    not claer,can you explain bit more
    2.Create a number range object in SNRO transaction in the same ABAP stack which will be having the sub objects as the file types maintained in the value table with their number ranges maintained. u201C
    b) .Can we use all mapping techniques (ABAP, Java, XSLT and Graphical) in a single scenario if yes then how to trigger them and which one executes much faster?
    We can use all mappings single scenario,how mean just add the mapping names in Operation/Interface mapping.
    As per my understanding Message Mapping works faster then JAVA then XSLT then ABAP,but it depends on how many lined of code you written.
    c) .Can we trigger an RFC asynchronously and how?
    Yes we can use RFC Asynchronous,search in sdn you will find it,if unable to find let me know.
    Regards,
    Raj

  • Sending File as attachment using Mail adapter with naming convention

    Dear All,
    I am working on a scenario in which my sender file adapter is sending one file named 'ABC.ok' in one of the folders in application server. I have to send the same file with the same name  to one of the folders at FTP and also to my customer at his email id.
    I have used File Content onversion at the receiver side and has selected adapter specific attributes due to which the required file is getting generated at FTP folder with the same name as that of the source. But how to send the same file using the mail adapter by keeping same name as "ABC.ok". Kindly guide me out in this.
    Regards,
    NJ

    what you need to do:
    1) Select ASMA in Sender and receiver File CC...already done
    2) Using the Dynamic Config UDF get the sender file name in the field Content-Type...for this you need to have a return statement in your UDF
    3) now before pushing this file name to the Content-Type you have to append (concat)the actual type of the file content (xml, txt)
    so your entire Content-Type node will have something like text/plain; name="abc.ok"
    SAP Note has reference on how to do this:
    https://service.sap.com/sap/support/notes/856599
    From the note:
    Q: How can I set the file name of a mail attachment?
    Regards,
    Abhishek.

  • Dynamic file naming at Receiver

    Hello Friends,
    How to handle the dynamic file naming in XI at receiver side as  file naming convention sequence to be incremented for every 1 hour...
    my Client expecting to handle at mapping...How to do this...
    Could any one give me the program if we need to do it in java...
    and pls also give another approach if any
    Setup dynamically ,

    >>naming convention sequence to be incremented for every 1 hour
    You can set the file construction mode as "Add counter" in the receiver file adapter
    Thanx
    Aamir
    Edited by: Aamir Suhail on Aug 15, 2008 7:57 AM

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Dynamic FTP Directory Address in File Adapter - is this possible?

    We have a customer who would like us to pick up a file via an FTP file adapter once per day. The problem is, they have a different directory each day containing the file. The directory name is of the form YYYY-MM-DD. The name of the file in the directory is always the same.
    Is it possible to dynamically calculate the Source Directory name in the FTP file adapter? If so, how?
    Kind Regards,
    Tony.

    >
    Dharamveer Gaur wrote:
    > Hi
    > Look this same thread:
    > Re: Dynamic folder name (when reading file in file adapter)
    Hi,
    All the examples I have seen are to configure the Receiver File Adapter, not the Sender File Adapter. I don't thinl I have seen one blog yet whereby the source directory of a Sender File Adapter has been dynamically configured. I wonder if it can be done because the sender file adapter does not have Variable Substitution possibilities for filenames and directories.
    So has anybody a link to a blog where this dynamic choice of a source directory has been done for a SENDER file adapter?
    BR,
    Tony.

  • Content conversion in Reciever File  Adapter

    Hi Frens,
    Iam doing A FCC in Reciever file adapter. My input structure is
    DT_structure
    ->Record
      ->Row
           Field1
           Field2
           Field3
    I have donr the configuration as
    Recordset Structure : Record,Row
    Row.fieldSeparator : ,
    Row.endSeparator : 'nl'
    Record.fieldSeparator : 'nl'.
    With this configuration  Iam able to display only one record but I need to display multiple records in the file. Please do suggest me wha need to be done to achieve this.
    Radhika.

    First check whether your datatype has the occurrence of records unbounded or not. Then goto content conversion. If both your Record and Row tags can occur multiple times, then use
    Recordset Structure : Record,*,Row,*
    Or if Record occurs only once and multiple Row nodes are required, then use
    Recordset Structure : Record,1,Row,*
    Regards,
    Prateek

  • Text file as an attachment in reciever mail adapter

    Hi Experts,
    I want to pick the text file using sender file adapter using file content converion, same file i need to send an attachment in reciever mail adapter.
    Can anybody help me how can i do this.
    Kind Regards,
    Praveen.
    Edited by: Praveen Kumar on Mar 10, 2010 9:08 AM

    Hi,
    >>>I want to pick the text file using sender file adapter using file content converion, same file i need to send an attachment in reciever mail adapter.
    use payload swap bean to put the attachment in place of the message payload - do the content conversion using
    content conversion adapter module, then do the same in the reverted order at the receiver
    there are dozenz of blogs showing how to use the two adapter modules I mentioned so just do a little search in blog section
    Regards,
    Michal Krawczyk

  • Error in reciever file adapter

    Getting following error in a reciever file adapter (stack trace extracted from defaultTrace)
    #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.connector.exceptions.BaseResourceException: Cannot open resource(Managed Connection) with LocalTransaction support or add a second one in the same transaction, for component "ejbContexts/sap.com/com.sap.aii.af.app/CallSapAdapter" in application "sap.com/com.sap.aii.af.app".
         at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:59)
         at com.sap.aii.af.ra.ms.runtime.Resources.getDBConnection(Resources.java:362)
         at com.sap.aii.af.ra.ms.impl.core.store.MessageStore.getMessageProfile(MessageStore.java:1228)
         at com.sap.aii.af.ra.ms.impl.ConnectionImpl.deliveryAck(ConnectionImpl.java:399)
         at com.sap.aii.adapter.file.SapAdapterServiceFrameImpl.sendAcks(SapAdapterServiceFrameImpl.java:350)
         at com.sap.aii.adapter.file.SapAdapterServiceFrameImpl.callSapAdapter(SapAdapterServiceFrameImpl.java:250)
         at com.sap.aii.af.modules.CallAdapterWithMessageBean.process_receiver(CallAdapterWithMessageBean.java:201)
         at com.sap.aii.af.modules.CallAdapterWithMessageBean.process(CallAdapterWithMessageBean.java:161)
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl1.process(ModuleLocalLocalObjectImpl1.java:103)
         at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:252)
         at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0.process(ModuleProcessorLocalLocalObjectImpl0.java:103)
         at com.sap.aii.af.listener.AFWListenerBean.onMessage(AFWListenerBean.java:243)
         at com.sap.aii.af.listener.AFWListenerLocalObjectImpl0.onMessage(AFWListenerLocalObjectImpl0.java:103)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:253)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:838)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.invokeHandler(ReceiveConsumer.java:351)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.onMessage(ReceiveConsumer.java:100)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:831)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.connector.exceptions.BaseResourceException: Cannot open resource(Managed Connection) with LocalTransaction support or add a second one in the same transaction, for component "ejbContexts/sap.com/com.sap.aii.af.app/CallSapAdapter" in application "sap.com/com.sap.aii.af.app".
         at com.sap.engine.services.connector.resource.impl.ResourceSetImpl.checkEnlist(ResourceSetImpl.java:308)
         at com.sap.engine.services.connector.jca.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:229)
         at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:51)
         ... 21 more

    HI,
    Refer this link. It gives solution to the above problem.
    http://help.sap.com/saphelp_nw04s/helpdata/en/5c/2f2c4142aef623e10000000a155106/content.htm
    Regards,
    Sudheer.

Maybe you are looking for