How to: Sender File Adapter to dinamically read all subfolders of a folder
Here is the scenario:
-Interface: A file to file interface.
-Objective: The idea is to move files from a file server to another file server.
-Master Source Folder: ...\OUTPUT\
-Master Destination Folder: .....\INPUT\
Interface example
-Source Folder: ...\OUTPUT\INTERFACE1
-Destination Folder: .....\INPUT\INTERFACE1
The idea is that the PI interface must read all the subfolders inside ..\OUTPUT\ and then move the files found to the corresponding folder in the target.
What we want to achive is to be able to add a new source folder i.e ...\OUTPUT\INTERFACE2 without having to modify the sender File adapter.
Actual status: Dynamic determination of the destination folder is already done, but source folders are statically defined in the sender file adapter.
Can this be done? Perhaps using a Bean Module or something?
Regards.
Mariano Billinghurst.
This is great! In the off chance anyone else is trying to do this, this is also useful if you have Papers and you want to switch to Mendeley. Papers keeps PDFs all organized by year and then author so the PDFs are all nested in subfolders. If you option-click the triangle next to the Papers folder, it will then show all the PDFs. Select All and then drag over the whole thing into Mendeley. I just imported my entire collection in under a minute. Glad I looked this up!
Similar Messages
-
Sender File Adapter is not reading anything
Hi,
I have a really strange problem here. I'm tyring to read a file using file adapter (FTP) and the adapter doesn't read anything and it does not throw any error in the communication channel monitoring.
I'm using a receiver file adapter to write files to the same FTP folder, so it can't be a connectivity problem. And I tried to get the file using Filezilla and it works fine...
In the sender file adapter I tried to simplify the maximum to solve the problem:
- NO File Content Conversion
- NO advanced attributes
- I used the "*" in the file name to read any file
- I've only configured the FTP connection, the folder and the file name. I don't understand why it isn't working...Yes I got this message:
Polling interval started. Length: 5,0 seconds
Now I tried something... In the FTP Connection parameters, I set as the server a random and unexisting name, and I get the same result...
I'm starting to thing that some firewall is blocking the connection, but I have to wait until next monday to know this. But I don't understand why the receiver FTP channel is working...
PD: The cache is correctly refreshed because I changed the polling interval time, and it has been updated on the monitoring -
How to pick files from multiple directories via Sender File Adapter?
Hi guys,
I have a scenario File to IDOC. The Sender File Adapter has to take all files: .xml from Source directory E://Current/.
Actually directories are like
E:/Plant1/Current/
E:/Plant1/History/
E:/Plant2/Current/
E:/Plant2/History/.
Can I have one Sender File Adapter to pick all *.xml files
from
E:/Plant1/Current/ and
E:/Plant2/Current/ and how can I write it in Source Directory of Communication Channel?
Or do I have to have a Sender File Adapter for each Plant?
Any suggestion please?
Kind regards,
Danijela ZivanovicHey
You might wanna have a look at "Additional selection for source file" parameter in sender file adapter.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/singleSenderFileCC4MultipleDirectories
XI/PI: how to exclude files in a sender File adapter?
Even though this method works but there are some constraints,please check help.sap.com for constraints.
Thanx
Aamir -
Sender File Adapter - Fixed Length
We have a Fixed File(Sender). With 3 fields. NO Header. Space is the separator for each fields
VendorNumber 10 bytes
VendorName 10 bytes
City 5 bytes
In the File we can have multiple records.
The Root Node is Vendor.
I am trying to define the SENDER FILE ADAPTER in the following way (I have referred mostly all the blogs) but my file is not picking up for some reason.
File looks like this
V123456789 A123456789 Bosto
V234567890 B123456789 Atlan
V334587900 C123456789 Austi
Note : I have been asked to give the Transport Protocol as "NFS" (Whether this is the problem???) I have summarised the complete details below. Please help me
Adapter Type : File Sender
Transport Protocol : NFS
Message Protocol : File Content Convervsion
Adapter Engine : Integration Server
FILE ACCESS PARAMETERS
Source Directory : /business
file Name : vendor.txt
Content Conversion Parameters
Document Name : Vendor
Document NameSpace: http://sap.com/xi/XI/SplitAndMerge
Recordsetname : Message1
Record Structure : File_MT,*
Recordset Sequence: Ascending
Key Field type : String(Case Sensitive)
Additional Parameters
File_MT.fieldFixedLengths 10,10,5
File_MT.fieldNames VendorNumber,VendorName,City
File_MT.fieldSeparator
File_MT..processFieldNames fromConfiguration.Hi Naveen,
Do check the following things,
>>Note : I have been asked to give the Transport Protocol as "NFS" (Whether this is the problem???) I have summarized the complete details below. Please help me
1.If your file resides on your local network/local computer give NFS(Network file system). if your file resides on a FTP location give FTP and also give the FTP log on parameters.
Additional Parameters
File_MT.fieldFixedLengths 10,10,5
File_MT.fieldNames VendorNumber,VendorName,City
File_MT.fieldSeparator
File_MT..processFieldNames fromConfiguration
2.If this structure does not match with the input file structure the file adapter wont pick up the file. So check for the help document provided by SAP in the following path.
help.sap.com --> Documentation --> SAPNetWeaver --> SAPNetWeaver '04 --> English --> process integration --> SAP Exchange Infrastructure --> connectivity --> Adapters --> File Adapter
Your file contains three records
V123456789 A123456789 Bosto
V234567890 B123456789 Atlan
V334587900 C123456789 Austi
You have mentioned the fieldSeperator as space but there is no File_MT.endSeparator '/n' which differentiates between each and every row (record).
Parameters for Record set Structures mentioned in the sender adapter configuration does not match with the actual file structure .
Try giving exact structures in the configuration of sender file adapter.
regards,
Aravindh. -
How to count the number of files read through sender file adapter
Hi ,
I have a scenario where I am reading files from a third party system and trying to send those files to R/3 system .The frequency is 1 file per day .But there can be situation where the source system can put 2 to 3 files in source folder and so XI sender adapter will pick up all the 3 files at time . And I want to send only 1 file at a time to r/3 .
Do you know any way to handle this requirement ?
Thanks ,
SuvarnaHi,
Like Bhavesh pointed out, you could EOIO as the Quality of Servie in the sender file adapter.
But I guess this would solve your issue only to a certain extent.
Marking this QOS in the sender file adapter would only mean sequential processing of the files. That is, the second file will be sent only when the first file is successfully received by the end system.
It would not ensure that the files are sent only after 15 mins of the first file is sent.
If the 15 mins time period is important, then this needs to be achieved using a BPM which ensures that the messages are sent to the target only every 15 mins.
In case, the frequency of the incoming files is not known (in which case, the having a BPM would be a bad idea) you could use a ztable, which stores the filename and time the file was sent to the R/3.
You could query this table each time, before sending the file data to the R/3
Regards,
Smitha.
Message was edited by:
Smitha Rao -
Using sender file adapter to read the most current file
Hi,
in my sender file adapter , i have to read the latest file- all files in the source directory are named as <filename><timestamp>.txt . I need to read the file with the latest timestamp (i.e. the most current file )
How do i configure this using file adapter.
thanksHi Sreeram,
thanks for the answer- but i found that the option can only be used with NFS transport protocol. what if i am using FTP ?
alos, by date option means- files are processed according to their time stamp in the file system, starting with the oldest file.
However in my case i only want to read the latest file and ignore the older files.
Thanks -
Read uniquely named file. Sender File Adapter unsuitable for synchronous
Hi All,
We have a requirement to read a specific file that has a unique name based on a transaction ID. The transaction ID will be passed from the source application.
The communication is required to be synchronous. There could be multiple requests/files generated and present at the directory at any given time but each corresponding to a specific transaction ID. If the file is not yet generated for that transaction ID we return back an error to the calling system.
I think we can not use Sender File Adapter - because of the dynamic naming and also because we have to return a synchronous response back depending on the file availability. i.e. We can not have a defined pattern in the file name nor can we specify a wild card as there could be more than one files in the location.
In theory we could use the File Sender adapter to read all the files in the directory and a BPM with correlation set based on the transaction ID and let the process wait for the request. But as far as possible I want to avoid this unnecessary wait or extra demand on the system. More so because the files could get big.
If I were using a tool like SAP Business Connector or webMethods then I would I used a readFile Java service and given it a filename to return the required bytes in a synchronous read.
Is something like this possible in XI? If someone has written a synchronous Java to read file can they share the code? Or do you suggest I write a ABAP server proxy to read the file? The problem however will be how do we map the data to a XML within the code.
All suggestions welcome. There has to be a simple and effective solution to this mundane requirement !
Wishing all SDNers a bright start to this new year,
Thanks,
Charu
Message was edited by:
Charu Kulkarni
"The transaction ID will be passed from the source application so we know what file to pick"Hi,
You could make the scenario a little simple and avoid custom development if the logic can be put into scripts(out of XI).
Say all the files are coming into a directory called D1.
Here, you could use a script to arrange all these in an order (say ascending) and move the first file into another directory D2.
The sender file adapter would poll this directory D2. The adapter can have a wild card character for the filename field now.
Once the file is in XI, you could check this against the transactionId present(I am not sure how you get this though!), and determine whether to send a mail, or to send a file back.
Here, I have assumed that there is somekind of order present in the files placed in the directory D1.
Again, this is just a suggestion.. I might be wrong with all the assumptions.
Regards,
Smitha. -
How to fetch XML file thru Sender File adapter
Dear friends,
I am having a scenario of fetching an xml file through sender file adapter. When i am testing my mapping in Test mode of message mapping it is working fine but when i fetch the real source xml file which is not having the XML namespace and Source Message type.
It is throwing error in Runtime.
At the same time when i edit the source xml file with the XML NAMESPACE & Source Meessage type it is passing successfully to the target system.
Kindly tell me friends how to solve this problem.
Take care,
KarthikHi Friends,
My Source XML file:
<?xml version="1.0" encoding="UTF-8"?>
<PeopleMsg>
<Records>
<Record>
<FirstName>Dawei</FirstName>
<LastName>He</LastName>
<MiddleNameOrInitials>D</MiddleNameOrInitials>
<IDs>
<IDType>
<IDTypeName>Employee ID (Country Equivalent)</IDTypeName>
</IDType>
<IDs>999999999999</IDs>
</IDs>
</Record>
</Records>
</PeopleMsg>
My xml file in the Test Tab of Message mapping:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Source_MT xmlns:ns0="http://kpmg.com/ibs/mdm">
<PeopleMsg>
<Records>
<Record>
<FirstName>Dawei</FirstName>
<LastName>He</LastName>
<MiddleNameOrInitials>D</MiddleNameOrInitials>
<IDs>
<IDType>
<IDTypeName>Employee ID (Country Equivalent)</IDTypeName>
</IDType>
<IDs>999999999999</IDs>
</IDs>
</Record>
</Records>
</PeopleMsg>
</ns0:Source_MT> -
How to transfer input file into XI through sender file adapter
Hi
I am quite new to XI. Want to know how I can transfer a file into XI through sender file adapter. I dont have any input file, so I have to create a sample input file and I want to transfer that into XI. Can you please advise me of the steps involved in that. I have finished work in design and directory, now I want to push file the sample file into XI. The receiver adapter is an IDoc adapter. And also a very trivial question. How I can place my sample file into my source directory. ThanksHi Rajiv,
If your transport protocol is NFS then you need to put the file in the XI server. Because it becomes the Network File System. For that you can just type the ip address of the XI server in the "run" command or in the browser with "
" then in any of the Folders you can paste your file. But ensure that this is the path you give in your Sender File Adapter.
If your transport protocol is FTP then you need to see that ftp is running in your system. for that go to Control Panel>Add/Remove Programs>Add/Remove Components. In that check the IIS server and go to details and see that ftp is also checked. Now ftp is running in your system.
Now open your C:> drive >InetPub>ftproot . and create a folder here and paste your file. In the configuration of your File sender adapter just mention the name of the folder.
For your information, you can create a file with xml tags and namespace and message type manually (or) you can directly get it from the test tab of message mapping and generate source code. -
How to know if file is being picked up by XI through sender file adapter -
Hi
How can I check if the file is being picked up XI through sender file adapter? Can you please help.
Thanks in advanceHi Rajiv,
Select teh File processing mode as
1. Read only -> After reading the file it will change the read only property of the file. Just right click on the file, select properties.If the file has been read then ReadOnly check box will be enabled. If u are testing several times then it will be more useful.
2. Archive -> Then u need to give some other folder name where u want to archive it.
3.Delete -> It will delete if the file has been successfully read.
regards,
Gowtham K.
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm -
How to get the filename in mapping when using sender File adapter?
hi Experts,
I have scenario where XI reads the input file using Sender file adapter.
The file name is configured in the communication channel.
In my message mapping it is possible to read this file name?
Thanks
gopalHi Gpoal,
Use Dynamic Configuration - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards,
Geetha -
How to configure Sender File Adapter to pick couples files in order !!
Hi Folks,
I am really looking for one requirement like, Sender file adapter has to pick multiple files by file name based with some time gap? Can we?
I have got one BPM in this, I have tried with Process mode : Name and Date, with wait step on BPM, but no use. The way how PI behaving, if 40 files in file directory, it is picking all files in one shot. Start processing but not in order.
The problem is on Receiver system side. The receiver system is SNC system, if old data receives later than earlier date data; we get data obsolete application error.
Ex: If I receive 25th and 26th files, first I need to process 25th first on PI sends to SNC, I need to give some time gap and pick another file or even PI picks and process 26th file, no problem but I need to give some time gap to send SNC to this 26th date file?
Please how guys, throw me your great ideas
Thanks in advance!!
Regards
San@ Sandhya
If there are 40 files , can you please specify how many types of files are ther like say first A type shud be picked then B type then C type and so on so forth ?
LIke in my case I had only three types of files file1 and file 2 file 3
and in the directory also only three files will be placed at a time
you need to have some logic to separate the type of files in differnt folders and then process them
@ farooq yes . it will create problem if 40 files are kept at a time .
Regards
Ninad -
How do i extract Delimited falt file-Sender File adapter FCC Parameters
Hello,
I'm trying to extract data from a flat file. The file is built as tab delimited. I cant find the option of tab delimited in the XI Sender File adapter FCC Parameters. How do i extract tab delimited file?
Please Advice,
RajeshHI,
You can use Fieldseperator as '0X09'...
Look at this blog...........you can solve this problem...
NAB the TAB (File Adapter)
Thanks,
Madhu
Edited by: Madhu sudhan Reddy on Jul 28, 2008 9:02 AM -
Sender File Adapter - FCC - No incoming field separator - How to do FCC?
Hi,
I have a sender File adapter and I need to do the File Content Conversion but there apparently no incoming field separator and the file ocntains just running text - no data records but just information.
For example the incoming file is something like:
The Hongkong and Shanghai Banking Corporation Limited 27JAN2009 PAGE 1
Incorporated in Hong Kong with limited liability
ABC IAL LIMITED ABU DHABI, UAE
ABC MIDDLE EAST Account No. 001-8888888
ABU DHABI Payment Set AAA
BBB MAIL BOX NO.99 Contact Person ABC LIMITED
7777777777 Telephone
AUTOPAY LIST - PROCESSED
(AUTOPAY-OUT SALARY)
Payment Date 27JAN2009
First Party Narrative . 66666666
Second Party Narrative .
The Message type that I am mapping to contains:
MT_XXXX
WA
Item
Item2
Item3
This is so that the information can be mapped to different field areas and send across to the Receiver Mail Adapter. In the mail i receive, i get the running text. I tried giving the field separator as '0x09' but it is not working.
I have also tried WA..fieldContentFormatting to nothing but again no luck.
I have tried with Recordset Sequence with Ascending and variable and have also tried Recordsets per Message with * and blank - but it did not help.
Please advice.
Regards,
ArchanaHi,
I assumed that it was tab but when I made the change in FCC, it did not work.
I would still like to have a output where it looks like below if more than 2 types of information in 1 line as below:
ABC IAL LIMITED ABU DHABI, UAE
ABC MIDDLE EAST Account No. 001-9999999999999
and not something like:
ABC IAL LIMITED ABU DHABI, UAE
ABC MIDDLE EAST Account No. 001-999999999999
I am not sure what to do here.
Help please.
Regards,
Archana -
XI Sender file adapter - How to process data and control files.
Hello all,
I have the following requirement to fulfill: I am using an FTP client (XI Sender file adapter) to retrieve data from an FTP site. To make sure I am not picking up a data file that is currently being written to, 2 files are actually present on the FTP site (for each data file):
1. abc.ctrl (control file with no data in it. Indicates that the data file has been completely written).
2. abc.dat (actual data file).
I want the file/ftp connector in XI to retrieve the data file (abc.dat) only if the control file (abc.ctrl) is present. After the processing of the data file is finished, both files (.dat and .ctrl) should be deleted.
Is there an elegant and robust way to accomplish this?
Thanks for your help.Hi Yves,
in my opinion there's no problem with files currently being written in combination with a polling file adapter because the final file name should be available only when the file is transferred completely. I'm using different file sender adapters very often and never had any problems. After picking up the files I move them to the corresponding archive folders mentioned in the adapters so that a second processing cannot occur.
Regards
Ralph
Maybe you are looking for
-
Hi When I try to connect to my wifi network I receive message "Unable to join network "Netgear" this starated as of 8/16 before thsn I never had this problem connecting to this network previously .I have attempted after manually entry of DNS still no
-
My firefox is not loading when my mouse pointer is inactive. It is loading only if i do something with mouse pointer. Im having latest firefox 25 beta. Win 7 32 bit OS. And its performance is very slow ,often gets struck while using gaming sites.
-
Cannon smartbase mp360 or bin it and get a budget inkjet
Hi all, I need a really quick response if possible as I have to get a printer working on my mac by the end of next week. I have just bought a macbook with Tiger and cannot get my cannon smartbase mp360 to work. So far the only solution I have found i
-
Osx 10.7.3 HP Printer driver UPDATE keeps REPEATING
Hello everyone, I am having a very strange problem with my macbook pro early 2011 (intel core duo I5 2.3Ghz - 8Gb ram, 500 GB hard disk, Intel Hd 3000 graphics card with 512mb memory (shared)) I have been installing the same update for approximately
-
PLM550 SAP Resource- und Portfoliomanagement – RPM 5.0
Für Berater und Projektteammitglieder, die vor der Einführung von SAP RPM 5.0 stehen, bieten wir im Q1/2011 wiederum den PLM550 an. In diesem Training werdenFunktionen, Prozesse und Integrationsmöglichkeiten von SAP Resource and Portfolio Management