File adapter doubt

i have doubt regarding file adapter
can a file adapter work dynamically?
for example: we are configuring one file name and a path.
whether multiple files can be taken from the path dynamically when using file adapter.
Message was edited by:
        allen washburn

Hi Allen -
On the sender file adapter side you have the wildcard options (e.g. *, ?) and in addition you can set exclusion masks to exclude files with a certain pattern.   You can set additional folders too for additional files in a different location (<a href="http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm">Additional Files</a>)
On the receiver side, you can use <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm">Variable Substitution</a> to dynamically set the filename and path based on message content (payload or header).
Regards,
Jin

Similar Messages

  • Doubt regarding Recever file adapter file content conversion (FCC)

    Hi Expetrts, below is the my target structure.
    <?xml version="1.0" encoding="TF-8"?>
    <ns1:MT_StatusChange xmlns:ns1="urn:passhe.com/ChangeOfStatusISA26">
         <IV_ST_OBJID>65390091</IV_ST_OBJID>
         <IV_BEGDA>25082008</IV_BEGDA>
         <LT_STUDENT_STATUS>
               <item>
              <HS_CAMPUS>65</HS_CAMPUS>
              <STOBJID>65390091</STOBJID>
              <STUDENT12>michal</STUDENT12>
              <HS_STATUS>MISC</HS_STATUS>
               <item>
            <LT_STUDENT_STATUS>
    </ns1:MT_StatusChange>
    How to configure in File Content Conversion Recever File Adapter for above target structure. i have done as below, but i am getting error.  please correct me where i did mistake.
    Recordset Structure : IV_ST_OBJID,IV_BEGDA,LT_STUDENT_STATUS,item
    IV_ST_OBJID.fieldNames : IV_ST_OBJID  -> for this field there is no subfield
    IV_ST_OBJID.fieldSeparator: , (comma)
    IV_BEGDA.fieldNames : IV_BEGDA -> for this field there is no subfield
    IV_BEGDA.fieldSeparator: , (comma)
    LT_STUDENT_STATUS.fieldNames  : HS_CAMPUS,STOBJID,STUDENT12,HS_STATUS
    LT_STUDENT_STATUS.fieldSeparator: 'nl'
    item.fieldNames  : HS_CAMPUS,STOBJID,STUDENT12,HS_STATUS
    item.fieldSeparator: , (comma)
    I am getting below error:
    'Conversion configuration error: Unknown structure 'ns1:MT_StatusChange' found in document', probably configuration error in file adapter (XML parser error)'
    Thanks
    Dhanush.

    Hi Dhanush,
                        It is better always if u have a structure with Header and trailers if u have a subsrtuctures in it & always try make it in this format:
    <?xml version="1.0" encoding="UTF-8"?>
    <MT_ContentConversion_Test>
       <Header>
          <F1>HF1</F1>
          <F2>HF2</F2>
       </Header>
       <Item>
          <F1>IF1</F1>
          <F2>IF2</F2>
       <Item>
       <Trailer>
          <F1>TF1</F1>
          <F2>TF2</F2>
       </Trailer>
    </ns0:MT_ContentConversion_Test>
    Try to go through this blog it will be very helpful to u :
    /people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
    Regards,
    Vinod.

  • Doubt regarding file content conversion Recever File adapter.

    target structure.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_ChangeOfAddress xmlns:ns1="urn:passhe.com/ChangeOfAddressISA28">
         <BUSINESS_PARTNER>
              <item>
                   <CAMPUSCODE>65</CAMPUSCODE>
                   <STUDENTNUMBER>6500000192</STUDENTNUMBER>
                   <ST_OBJID>732298498</ST_OBJID>
              </item>
         </BUSINESS_PARTNER>
    </ns1:MT_ChangeOfAddress>
    target structure is look like this.
    MT_ChangeOfAddress
         BUSINESS_PARTNER  (1,1)
              item       (0 to unbounded)
                  CAMPUSCODE (0,1)
                  STUDENTNUMBER (0,1)
                        ST_OBJID      (0,1)
    I have given below parameters in recever file adapter (file content conversion)
    Recordset Structure : item
    item.fieldNames  : CAMPUSCODE,STUDENTNUMBER,ST_OBJID
    item.fieldSeparator: , (comma)
    i am getting first two digits in my output file: that  file has only first two digits that is : 65
    may i know how hould i define file contente conversion recever adapter to get proper data in file adapter.
    thanks,s
    Dhanush

    Hi,
    Go through these blogs:
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    /people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    Thanks,
    Satya

  • Doubt: addHeaderLine File Content Conversion Recever File adapter.

    Hi,
    Below XML Target Structure ( Recever File Adapter- FCC)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_ChangeOfAddress xmlns:ns1="urn:passhe.com/ChangeOfAddressISA28">
        <BUSINESS_PARTNER>
                 <item>
                        <CAMPUSCODE>65</CAMPUSCODE>
                         <STUDENTNUMBER>6500000192</STUDENTNUMBER>
                         <ST_OBJID>732298498</ST_OBJID>
                 </item>
        </BUSINESS_PARTNER>
    </ns1:MT_ChangeOfAddress>
    Recever File Adapter- FCC : i have done below configurations.
    BUSINESS_PARTNER.addHeaderLine = 1 ( i tryed with value 2 also) and also tryed with item.addHeaderLine = 1 ( i tryed with value 2 also) i am not getting Header line in my out put file and rest fine
    Recordset Structure: BUSINESS_PARTNER,item
    BUSINESS_PARTNER.fieldNames : item
    BUSINESS_PARTNER.fieldSeparator: ,(comma)
    item.fieldNames : CAMPUSCODE,STUDENTNUMBER,ST_OBJID
    item.fieldSeparator : , (comma)
    BUSINESS_PARTNER.addHeaderLine = 1 ( i tryed with giveing  value as  2) and also tryed this way also item.addHeaderLine = 1 ( i tryed with giveing  value as  2) i am not getting XML Header line in my out put file and rest is working fine. please help me out.
    Thanks,
    Dhanush

    Dhanush,
    According to help.sap.com standard structure
    <root>...
    <nameA>
    <value1>value</value1>
    <value2>value</value2>
    <value3>value</value3>
    </nameA1>
    <nameB>
    <value4>value</value4>
    </nameB>
    </root>...
    I guess if you  reduce it to one level like by removing item or BUSINESS_PARTNER it should work.
    http://help.sap.com/saphelp_erp2004/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
    Gaurav Jain

  • Doubt in File Adapter

    Hi,
    In file adapter, CSV format i know how to use the ',', but this time i need to use Field separator as a TAB(tab key). How can we solve this problem?
    Rewards waiting for the right ans.
    Thanks
       Vinod V

    Hi,
    For TAB as Delimiter use '0*09'
    Or
    open the Notepad and press TAB then copy that & paste it in the content conversion
    Regards
    Seshagiri

  • Date and Time in Sender File Adapter Target Directory

    Hi there,
    is there a way of using Date and Time from XI to the Target Directory naming? To use variable substitution some fields of the message had to contain that date and time information, which is not our case.
    For filename you can use "add time stamp" option, but and for target directory?
    Thanks and regards,
    Henrique.

    > <i>Do you have further information on how to perform
    > this with shell commands?</i>
    > >> You need to write a shell script. This script will
    > add the date/time stamp into the folder in the target
    > system. This shell script is executed from the File
    > adapter. So once the file is written into the target
    > directory, then it will rename the directory.
    Hi there, Moorthy
    We've tried to write that shell script that you mentioned, but now we have a few doubts on how to make it create the proper directory.
    In the file adapter, my target directory is "/%var1%/%var2%/", where %var1% and %var2% are variable substitutions, referencing data which comes from the payload. Now, I need the shell script to append "/<Year>/<Month>/" in the target directory. But where to archive the script? If it stays in the root directory, than how to make it create "/<Year>/<Month>/" folders inside a directory which is variable (/%var1%/%var2%/)?
    Is there a way of passing %var1% and %var2% as parameters for the shell script?
    Thanks a lot,
    Henrique.

  • How to create multiple files with Receiver File Adapter in SAP PI 7.31 Java Stack

    Dear Friends,
    I am using Sender JDBC Adapter and Receiver File Adapter in Integration Flow in SAP PI 7.3 EHP 1 SP08 Java Stack environment. The requirement is that we need to create multiple files based on the row count in jdbc resultset. If there are 5 rows in resultset, we need to create 5 XML files with one row elements in one file. Similarly if there are 10 rows, we need to create 10 XML files.
    So how can we create multiple files in this scenario. I tried placing a for loop in the Java Mapping as below in the transform method:
    DynamicConfiguration conf = arg0.getDynamicConfiguration();
    StringBuffer sbFileData = new StringBuffer();
    for (int i =0; i < record.size(); i++ {
         . // Create XML for each row and Marshal the object into to the String Buffer
         String strFileName = "DC_" + new SimpleDateFormat("ddMMyyyyHHmm").format(new java.util.Date())+"_"+i+".xml";
         conf.put(KEY_FILENAME, strFileName);
         arg1.getOutputPayload().getOutputStream().write(sbFileData.toString().getBytes("UTF-8"));
         arg1.getOutputPayload().getOutputStream().flush();
    So here I'm flushing the OutputStream for each record. But it's not creating the multiple file, instead it creates only one file will all record XMLs appended to each other.
    Please let me know if I missing something or need to do some thing else.
    Regards,
    Shreyansh Shah

    Hi
    You can easily achieve this using graphical mapping.  Create your target message type like below
    MT_Target
      Details  0 to 1
          Data  0 to 1
    Source sample structure
    <resultset>
    <row>
    <column-name>column-value</ column-name>
    </row>
    Then do the message mapping like below
    map <row> with  MT_Target
    contant ----> Deatils
    column-name ------>Data
    In the signature tab of message mapping, choose the occurrence of your target message type as
    0 to unbounded.
    This will generate multiple files from multiple rows.
    Let me know if you have any doubt.

  • Polling interval in file adapter.

    Hi,
    I have a doubt regarding the file adapter polling interval.
    Suppose we get a file of size 512 MB and PI file adapter taking long time (say 15 Min) to process it, we have a polling interval of 10 min.
    I have a 2 doubt in this case.
    1. what will happen in the next polling interval. because the older file still is in process and it is still in the source folder location.
    2. if at the same time there is new file get places in same folder location. then how the file adapter behave in this case. Is it start picking the second file or again poll the incomplete file.
    I want to know that is PI maintaining some lock while processing some file from source folder.
    regards,
    Navneet

    Hi,
    I guess normally it should process both files, earlier one which is in process and the new one as well (it depends your selection string in file name scheme).
    Also refer thsi Wiki to help in avoiding duplicate file processing:
    http://wiki.sdn.sap.com/wiki/display/XI/DifferentwaystokeepyourInterfacefromprocessingduplicate+files
    Regards,
    Divyesh Vasani

  • Sender File Adapter. Fixed Lengths and Field Separator

    Hello guys,
    I have a doubt in Sender File Adapter with Content Conversion.
    I have a text file like:
    a,b,c,,e
    I have the configuration in the adapter:
    Register.fieldNames: a,b,c,d,e
    Register.fieldSeparator: ,
    The question I have is can I format the length of the text when i create the XML?
    I woul like to create the XML like:
    <Row>
      <Register>
        <a>a   </a>
        <a>b  </a>
        <a>c  </a>
        <a>   </a>
        <a>e   </a>
      </Register>
    </Row>
    I would like that when I create the file in Field A I have length = 4, but I have only 1 in the entry, and I want to fill the rest of the length with spaces.
    I tried with FieldFixedLengths but when I test it the fields are not being formatted and take the commas as part of the field.
    I know that this can be done in Receiver File Adapter, you leave for example one field of 5 length and you format it to 12 length with spaces.
    Is this possible for Sender File ADapter?
    Many thanks.
    Regards,
    Xavi.

    hi,
    See the example given in this bog, in this blog the string has been splited into different fields as per the field length, so you may use the same concept to get your output.
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    I hope it helps you.
    Regards,
    Sarvesh

  • File Adapter-Module configuration

    Hi All,
    I have the following requiremnt.
    "Duplicate files should not process"
    Following are the File Access Parameters.
    Source Directory: ABC (ex: contains aa1,aa2,aa3,aa4 files)
    Filename: *
    File name mask: aa*
    My doubt is if they place aa1 file again in ftp , i should not process.
    For this I'm thinking to write module configuration.
    Can any one suggests , whether this is the correct approach? If it is could u explain how to write this module and where to write this module and how to import in xI, do i need to pass any parameter name in module configuration.
    Regards,
    venu.

    Hi Venu,
    You can go with Module in the Sender File Adapter.
    First you need to check the file name and you need to store this file name in the Database.( you can use Java Database).
    If there is an entry in the database for that file, then reject the whole file as per the business requirement. So that you can avoid , overhead of Mapping. Because if there is an error set the flag in the message and check this flag in your Receiver Determination, if it is an error send into error directory.
    Another way is outside the XI, i.e using shell scripts.
    Regards,
    Moorthy

  • 'Source Directory doesn't exist' error in sender file adapter

    Hi All,
    I m getting the error 'Source Directory doesn't exist' in sender file adapter.
    The source file directory doesn't exist in XI Server. Its in a different system.
    gone through other sdn t hreads.
    the options seems to be
    1. either to mount the Source Directory on the XI Server.
    2. Install a FTP server and use FTP protocol.
    My doubt is that, could nt we give necessary access rights to the XIAFUSER whihc will access the Source Directory?
    Wont it be sufficient?

    Hi Aarthi,
    If you are using system other than XI, then you have to use FTP server
    else check you have proper authorization of read/write to the source directory...
    and check the name of it as well, as it is case sensetive and you have provided the proper details of server.
    check these blog as well...
    /people/venugopalarao.immadisetty/blog/2007/01/24/troubleshooting-file-to-idoc-scenario-in-xi
    /people/shabarish.vijayakumar/blog/2006/08/01/along-came-a-file-adapter-mr-ftp-and-rest-of-the-gang
    Sachin
    Edited by: Sachin Dhingra on Mar 24, 2009 12:16 PM

  • Send a mail if no file in Sender File Adapter

    Hello guys,
    I have one doubt. I have a sender File adapter with FTP transfer protocol. I want to pull the file every 24 hours. If the file does not exist, there is any way to have an error and send a mail to the client?
    Is a requierement to do one interface, they want that XI sends a mail if no file is encounteref in the server when XI goes to pull the file. Is this possible?
    Many thanks in advance.
    Regards,
    Xavi.

    Hi,
    Refer to following link
    Read Excel instead of XML through FileAdapter
    This has good example of developing module. Only code is available. For further help you can look in Help.sap for crating module they also provide sample code.
    No need to call alert from module . go upto 24 hars if no file is received set your own structure.
    Give condition in receiver detrmination to send mail if file is not picked.
    revert back for any clearity.
    Thanks
    Sunil Singh

  • How can I read different files in the file adapter

    Hi,
    I have a scenario like file(content conversion and FTP) to Proxy and need to read 2 files which have different structures.
    The file structures is as follows.
    FileA.txt
    EMPID, Designtion,code,DOB,dept,deptID and 13 fields etc..
    FileB.txt
    officercode, dept,workspecs,FLAGarm,FLAGfoot and 27 fields etc.
    Both files needs to be read by the file adapter at same time and should send to the proxy to feed in ECC.
    Please help me in designing the above scenario with or without BPM.
    Thanks
    Manmadha

    Hello,
    Since u want to combine the two files from sender , you need to use BPM for it.
    First of all create Mapping. In your mapping program go to messages tab and add the two source messages types and in the target add the target message type. Come to your design tab and design the mappings.
    BPM:
    -- Insert Fork with two branches necessary condition. In first branch insert Receive step and check start process checkbox.
    --In second branch insert Receive step and check start process checkbox.
    -- Insert Transformation step after Fork branch step.
    -- Insert Send step [the outcome of transformation step needs to be send]
    Design the above structure, if you have any doubts, dp reply back.
    Best regards,
    raj.

  • OS command error=13, Permission denied in File Adapter

    Hi All,
    I am trying to call the OS commands in File adaper, when i check the Audit log i am getting Error exectuting the command. the same command when i check in OS its working fine.
    i have collected the debug log and i can see the message saying
    Catching #1#java.io.IOException: java.io.IOException: error=13, Permission denied
         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
         at java.lang.Runtime.exec(Runtime.java:591)
         at java.lang.Runtime.exec(Runtime.java:429)
         at java.lang.Runtime.exec(Runtime.java:326)
         at com.sap.aii.af.lib.util.system.CommandLauncher.exec(CommandLauncher.java:64)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:58)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:33)
         at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:991)
         at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:622)
         at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:500)
         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:169)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:266)
    I hope the problem with problem XI communication with OS level, Could you pls suggest me the problem?
    Thanks,
    Venkat

    Hello!
    You can see more information about os command using the file adapter in SAP note:
    #841704 - XI File & JDBC Adapter: Operating system command
    o  The command line of an operating system command run through the
       File and JDBC Adapter is interpreted slightly different compared
       to common operating system shells. E.g. quotes and apostrophes
       are handled differently. If in doubt, check if the command can be
       successfully run through the Java Runtime.exec(...) API. Also
       note that the command is run as user "<sid>adm" (Unix) /
       "SAPService<SID>" (Windows).
       Under Windows, this especially means that you cannot use any
       shell commands interpreted by teh command processor (such as
       "copy", "ren" or "del") using the operating system command.
    Best regards,
    Franklin

  • Cannot send file to XI ,and File Adapter Error in RWB- Adapter Monitor

    i develop the file to file scenario, and everything in Integration Builder is right, and the configuration is no problem
    but it cannot send file to XI, so the whole process
    cannot start. The file adapter seems not work
    how can i solve the problem?
    Thank you for your reply

    Hi Leo,
    I Guess you should first see if the file is being picked... for that do the following.
    While configuring your Sender File Adapter, let the mode be DELETE. This way, we will know if the file is being picked by the File adapter. The file will be deleted and you can be sure that it has been picked up.
    In your runtime workbench home, there will be a tab, Component Monitoring, click on it. Select status as all, and click on display. The components will be displayed on ur screen. In that, under Integration Server, there will be a link for Adapter Engine. Click on it. Now, scroll down, and u will see a link to adapter monitoring, there under FILE ADAPTER see the log of the file adapter
    and also, you can see the flow of your message in the integration engine in SXMB_MONI.
    <b>Do this and let us know what is happening...</b>
    Meanwhile i would also suggest you to go through the explanation of a simmilar scenario that i have explained below and compare it with what you have done..
    Please go thru the following links and clear all your doubts.
    Communication channel:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/65/b11c409ce22402e10000000a1550b0/frameset.htm">Assigning Communication Channels</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/2b/d5653fd1d3b81ae10000000a114084/content.htm">Communication Channel</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm">Configuring the Sender File/FTP Adapter</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm">Configuring the Receiver File/FTP Adapter</a>
    Receiver agreement:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/56/02e63f48e58f15e10000000a155106/frameset.htm">Receiver Agreement</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c1/5194426b44c56ae10000000a155106/frameset.htm">Creating a Receiver Agreement</a>
    Sender agreement:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/db/73e03fc2269615e10000000a155106/frameset.htm">Sender Agreement</a>
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/522041cfb7f423e10000000a155106/frameset.htm">Creating a Sender Agreement</a>
    For detailed info, I would suggest that you go through these weblogs:
    <a href="/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1">Introduction to simple(File-XI-File)scenario for Starters</a>
    <a href="/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2">Introduction to simple (File-XI-File)scenario for starters part2</a>
    I hope it helps.
    Regards,
    Abhy

Maybe you are looking for