File Adapter: picking files from multiple directories
Hi all,
In a sender file communication channel with Transport
Protocol FTP, There are 2 parameters for Picking up the file
called Source Directory and Filename. If I want to pick the
files from 2 or more directories, What needs to be done.
Or is it possible to do so ?
Without making duplicate interfaces what else can be done ?
Regards,
Vijay
Actually it is possible to select files from different folders for sender channel. It is available with SP14.
I just copy following description from help.sap.com
Advanced Selection for Source File
If you want to set an exclusion mask for the File Name specified above, or if you want to specify multiple directories using a file name mask and exclusion mask, set the Advanced Selection for Source File indicator.
¡ Specify an Exclusion Mask for the file name specified above.
Example
You want to process all files that have the extension '.txt', but want to exclude all files that begin with the letter 'a'. To do this, enter .txt for File Name, and a for Exclusion Mask.
¡ You can enter additional specifications for source directories, file names, and exclusion masks in the table. This data is processed in addition to the details specified above.
Similar Messages
-
How to pickup files from multiple directories
Hi all,
How to pickup files from multiple directories and send it to two different folders at target
Ex:
files\xi\us\US.txt
files\xi\uk\UK.txt
i need to pick up the above mentioned two files and send it to the following paths
app1\files\us\download\US.txt
app1\files\uk\download\UK.txt
US.txt has to goto US folder and UK.txt has to goto UK folder only
RegardsHi,
To pick form multiple folders, select Advanced Mode for file selection in file adapter..
there u can specify directory name/file names
Refer
/people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
To put those files at multiple folders write a command line arguments for this.. go through this weblog...
/people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
XI/PI: Command line sample functions
/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
Hope this will help you....
Regds,
Pinangshuk. -
FILES FROM MULTIPLE DIRECTORIES
Hi Experts,
I got a doubt here plz clarify it
1.How can we pick files from multiple directories ? and all the files will have different names?
Plz clarify this, good explanations willbe rewarded .
Regards,
Vinod.Hi Vinod Reddy,
One way that i know to solve this prob is by using the 'File Name Masking'.
This can be done with the sender channel, where you have to specify the
source directory as <NOTHING>
source file as <NOTHING>
This gives you an advanced selection option, where you need to give the Source Directories along with the File name masks (the source files).
Hope this may solve your problem.
regards
vinod v
reward me if its helpful. -
Picking up files from multiple directories
Hi All
We have scenario where each sore has its one folder with all the files in the folder, now there is about 200 stores so and about 30 interfaces that picks up files from those directories. It's gonna take some time to add al the directories to all 30 interfaces. Is there an easier way to do this?
Regards>
stephan claassen wrote:
> Hi
>
> Thx for reply
>
> abhishek salvi what do mean by ServerName/*? we only have the IP.
> If I put in /SAPXI/METSAPXI/* it sais: A file or directory in the path name does not exist
>
> Regards
Suppose you have one File Server installed (say SAP).....it has only two sub-folders (say XI and PI)....now you want to pick files from both the sub-folders....so you can try SAP/* ........
Please open your File Server location and any sub-folder within it and check if it is / or \ .....and then use the slash (/ or \) accordingly ......if you have IP and no name then give the IP.....rest logic remains the same....
Regards,
Abhishek. -
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 -
Multiple source files from multiple directories in sender CC
Dear all,
My requirrement is that ,I need to use multiple directories in sender CC (only one) and send the files to receivers.
Kindly let me know how it can be done.
Thanks,
SrinivasaHi,
under advanced tab.............If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
The variables can refer to attributes of the message header or elements of the message payload.
○ If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
○ If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.
Thanks,
Madhu -
Batch Script to display last modified file from multiple directories
Hello,
I am trying to find the name of the latest file or the last modified file from a set of given directories.
I approached the problem by breaking it into two parts: a. read all the directories from a .txt file and display the names of those directories and files under those directories. b. Find the latest file present in any given directory and
Upto this point all worked well, but when I am trying to combine both these batch scripts, I am unable to get the desired result.
I am using BATCH SCRIPT only to complete this.
My tried script is as below:
a. TO SEE ALL THE DIRECTORIES SPECIFIED IN "path_123.txt" FILE
for /f "delims=" %%i in ('type "C:\Users\sonkar\Desktop\path_123.txt" ') do (set locall=%%i
echo %locall%
echo %%i
b. TO FIND THE LATEST FILE PRESENT IN THE DIRECTORY
set BUILDDROP="E:\"
for /f "tokens=*" %%a in ('dir /A:-D /B /O:-D %BUILDDROP%') do set NEWEST=%%a&& goto :next
:next
echo %NEWEST%
But when combining both is not working at all.
Any help is appreciated.Since batch files lack the ability to do date arithmetic you are pushing them well beyond their limits. Either VBScript of PowerShell could handle this type of task. Here is a VBScript solution. You must save the code in a .vbs file, then modify it to suit
your exact needs.
'Find the most recent file in a collection of folders
'11 Sep 2014 FNL
Dim dDate, dDate_, sFile, sFile_
Set oFSO = CreateObject("Scripting.Filesystemobject")
Set oList = ofso.OpenTextFile("C:\Users\sonkar\Desktop\path_123.txt", 1)
aList = Split(olist.ReadAll, vbCrLf)
oList.close
dDate = cdate("01/01/2000")
For Each sFolder In aList
dDate_ = cdate("01/01/2000")
ProcessFolder(sFolder)
If dDate_ > dDate Then
dDate = dDate_
sFile = sFile_
End If
Next
WScript.Echo "Most recent file: """ & sFile & """"
WScript.Echo "File date: " &dDate
Sub ProcessFolder(sFldr)
If LTrim(sFldr) = "" Then Exit Sub
WScript.Echo "Processing """ & sFldr & """"
For Each oFile In oFSO.GetFolder(sFldr).Files
If oFile.DateLastModified > dDate_ Then
dDate_ = oFile.DateLastModified
sFile_ = oFile.Path
End if
Next
For Each oFolder In oFSO.GetFolder(sFldr).SubFolders
ProcessFolder(oFolder.path)
Next
End sub -
Read files from multiple directories
Hy to all! I have a little problem with reading files from a hierarchy of directories,something like this: directory A contains: 4 filed and directory B, and also B contains 3 files and 2 directories and so on. i want to make a method that reads all the files from directory A (including all files from subdirectory). I know i have to use recursive programming, i need a method that will be use to do this. Can U help me to do this????? Thank you all.
Can U help me to do this?Sure. First, review basic File IO in Java: [http://java.sun.com/docs/books/tutorial/essential/io/file.html]
Second, have a look at the numerous examples available on the Internet: [http://www.google.com/search?q=java+traverse+directory]
Third, let us know if you run into any specific problems.
Good luck! -
[SOLVED]Copying multiple files from multiple directories to one folder
Title says it all. I have a discography folder with subfolders of the different years and albums of a band each containing music, some also have more sub folders. What I want to do is copy all of the music (.mp3's) from all the folders and sub folders into just one music folder. I found a find and -exec cp command before but it did absolutely nothing for whatever reason. Perhaps I did it wrong. Can anyone help me?
Thanks
Last edited by SiegeMachine (2009-11-15 06:54:40). refers to the directory to search (the current directory), it's not a pattern - here's what you want:
find . -iname '*.mp3' -type f -exec cp {} target_dir/ \;
This is assuming you're in the music directory - if not, you want
find /path/to/music -iname '*.mp3' -type f -exec cp {} target_dir/ \;
Last edited by Pox (2009-11-15 06:53:59) -
Retrive files from multiple source directories
Hi,
I need to retrive diffirent formet files from multiple directories and based on file name I need to send it to destination folders. Can anybody suggest me How can I impliment this interface.
Thanks & Regards
VenkatKVenkat,
I hope since you are taking different format files, you are not doing any mapping. You are moving from one location to another location, because if you different formats then you can do in one mapping your requirement.
If it is correct then as shabharish mentioned you can pick the files using multiple file sender adapters. With this you can pick the files, but to send to different directories enable ASMA in sender file commkunication channel. Then in receiver communication check the extension for each format and then give the directory name so that it routes to the destination you mentioned.
Regards,
---Satish -
To pick files from multiple directory in FILE ADAPTER
Hi all,
Is their any settings or adapter configuration parameters to be used to pick the files from multiple directory .Hi,
You can only specify one directory on the communication channel. The advance selection allows the selection of different files within this directory.
Therefore you will need a communication channel for each directory you wish to pull files from.
(Just looked at the blog and see it is possible after all - I'm on the wrong SP)
Kind regards
Colin.
Message was edited by:
Colin Bickell -
Picking files from multiple folders based on name send to destination folde
Hi,
I want to pick multiple files from multiple folders with one root folder. Based on file name I want to send it to diffirent folders. No need to go for message mapping. Can anyone suggest me.
Thanks & Regards,
Prasad Kotla.Hi Prasad,
to pick the files from multiple source directory, can use "Advance Selection for Source File" in Sender CC.
If you wand to develop a Scenario without Message mapping, develop a scenario as "Sender as Virtual receiver"
This option is available in Sender agreement, just give the dummy name for Msg Interface and Namespace, Name defined should be same in Rec Agreement.
Develop only: Sende CC, Receiver CC, SA, RA
No need to develop ID and RD as no mapping is involved.
If u want to send the files to different folders of receiver side, just develop the adapter module which changes the directory based on the sender filename.
If the sender and receiver directory is same than check the "adapter specific Msg Attribute" and "directory" checkbox in both the sender and receiver CC. in this case no need to develop Custom module for changing the directory. files will be automatically placed in the path they were picked from sendor directory
appreciate if useful
regards,
chandra shekhar -
Save file in multiple directories using receiver file adapter?
Hi,
Is it posible to save file in multiple directories using receiver file adapter?
Regards,
AshishWell, there is a round about way to do that -
The idea is to use multi mapping. 1:n mapping
1) Map ur message to 2 different record set nodes. Since you want to use the same file both the mapping will look exactly the same. make sure that the filepath and filename are a part of the output payload message
2) In the file adapter config. make sure the the file name and file path are from these payload fields. You can use a context object to refer these fields. Voila...the files are created in the 2 direcoties you mentioned.
of course the simplest way is to route the same message to 2 business systems/services and write them out using 2 ccs.,
Arvind R -
How to write file into multiple directories by using file adapter?
i need to write my file into multiple directories,i able to do in single directory.But i need to write to muliple directories.Please help me out.Thanks in advance.
If you are passing the values at runtime then you can loop it and and invoke the file adapter in loop by dynamically passing the value in invoke properties for "File Directory and File name" etc.
-
'No Upload Authorization' While Uploading a Text File from Multiple Select
Hi all,
The User is trying to upload a text file from Multiple Selection screen of a Query in BEx and it gives the error message of 'No Upload Authorization' (Error DB886).
In 'Logon data' tab of Tcode SU01, it has 'User' for 'User Group for Authorization check' for this User.
I could upload a text file from Multiple Selection screen with my User Id.
An idea about this error, PLEASE ?
Thanks,
Venkat.Hi Ron,
This User does not have the access to Tcode ST01.
The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
Any further suggestions, PLEASE.
Thanks.
Maybe you are looking for
-
How can I change a wrong e-mail adres in the Adobe ID for an E-Reader.
I have an Adobe ID for Digital Editions for my pc. Then I connected an E-Reader to my pc and I had to authorize the reader with an Adobe ID. I thought it would be the same as the ID for my pc, but the system send my the message that this ID already w
-
Customer /Vendor line item..
Hi.. One query..for line item display of GL account we select in GL master "line item display" but for customer and vendor line item display in FBL1N & FBL5N...from where we tick the line item dispaly . Please reply
-
Editing a wordpress theme in Dreamweaver
Hi there I have been looking every where for help on how to setup a wordpress theme in dreamweaver. So that I could edit it in Dreamweaver which would be so much easier. The main reason is so that I can add and delete what I want and make a theme bet
-
I get emails with .eml attachments which should use Power Point to open. However, I have not been able to open them with my OSX.4.11 which has Microsoft Ofc for Mac, & for which I downloaded Ofc Open XML Converter for Mac 1.0 this morning, from Apple
-
I just finished patching our test portal system. The database\message server which also has an app server on it starts up and runs just fine. The problem we are having is the second app server which is on a different windows host will not start (jcon