Background: Pick files from directory at central instance
Hi,
In Background, We want to pick files from the directory present central instance. I am using FM RZL_READ_DIR_LOCAL to read all files present in directory and later we process each of them.
This FM works fine while I work online but not in background. In Development and Quality servers it works fine in background. possible reason could be that we dont have central instance in dev and quality server.
Please suggest.
Thanks
You can go through his article once
link:[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2?quicklink=index&overridelayout=true]
Your presentation server must be switched on when performing these kind of actions.
Similar Messages
-
How to pick files from ECC directory
Hi All,
I have to pick files from the directory of ECC. can anyone tell me how to configure the sender File apapter? Can i use NFS for the same?
Regards,
Lavanya RHi Lavanya,
With my knowledge two ways to pick the file from ECC using File adapter.
1. If you use NFS, mount point should be created in ECC for the Directory to access from PI.
2. If you use FTP, FTP ports must be opened between PI and ECC. -
Regarding picking files from sender Adapter
I want to pick files from multiple directories from the sender adapter.
Is there any way to write a module fro the above functionality?
If possible, please provide the solution for the above queryHi virkram,
take a look to this thread
Re: File Sender Adapter - Multiple Source Directory
Hope this help
Francesco -
How to delete a READ ONLY file from Directory
Hi Friends,
how to delete a READ ONLY file from Directory , file is in my system only.
Please help me .
note: its read only file.
Thank you.
Karthik.hI,
try with this statement.
delete dataset <datasetname>.
this will definitely work.
Regards,
Nagaraj -
Read file from directory, update contents of the each file
hai,
I could not understand how to debug the error i have now.
target
1- read the files from directory // i able ot do this part
2- for each file
for each file read the content & compare with the existing List & update the list // i able to do this part
when i try to combine both parts , i got some following error
run:
E:\java\check\100130.ixf
Error: children[i] (The system cannot find the file specified)
BUILD SUCCESSFUL (total time: 2 seconds)
i can see from the code that children[i] only gives the error when i use that in the second part of the code.
can any one help me on this??
Thanks
Priyan
the original code
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.util.ArrayList;
public class CompareList
public static void main(String[] args){
ArrayList a1 = new ArrayList();
ArrayList a2 = new ArrayList();
a1.add("1");
a1.add("2");
a1.add("3");
a1.add("4");
a1.add("5");
a1.add("6");
a1.add("7");
a1.add("8");
a1.add("9");
a1.add("10");
a1.add("11");
a1.add("12");
a1.add("13");
a1.add("14");
a1.add("15");
a1.add("16");
a1.add("17");
a1.add("18");
a1.add("19");
a1.add("20");
a1.add("21");
a1.add("22");
a1.add("23");
a1.add("24");
a1.add("25");
a1.add("26");
a1.add("27");
a1.add("28");
a1.add("29");
a1.add("30");
a1.add("31");
a1.add("32");
a1.add("33");
a1.add("34");
a1.add("35");
a1.add("36");
a1.add("37");
a1.add("38");
a1.add("39");
a1.add("40");
a1.add("41");
a1.add("42");
a1.add("43");
a1.add("44");
a1.add("45");
a1.add("46");
a1.add("47");
a1.add("48");
a1.add("49");
a1.add("50");
a1.add("51");
a1.add("52");
try{
File dir = new File("E:\\java\\check");
File[] children = dir.listFiles();
if (children == null) {
System.out.println("does not exist or is not a directory");
else {
for (int i = 0; i < children.length; i++) {
System.out.println( children);
FileInputStream fstream = new FileInputStream("children[i]");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
String line =strLine.substring(0,2);
// Print the content on the console
//System.out.println(line);
a2.add(line);
} // end of add list2
if (a1.size() > a2.size())
int k = 0;
for (int l = 0; l < a2.size(); l++)
if (!((String)a1.get(l)).equals((String)a2.get(l)))
//System.out.println((String)a2.get(i));
// System.out.println("dd");
k = l;
k++;
for (int l = k; l < a1.size(); l++)
System.out.println((String)a1.get(l));
String str = "children[l]";
File file = new File(str);
RandomAccessFile rand = new RandomAccessFile(file,"rw");
rand.seek(file.length()); //Seek to end of file
rand.writeBytes((String)a1.get(i)); //Write end of file
rand.writeBytes("., 0.");
rand.writeBytes("\n");
}// end of comparing and updating the list2
in.close();
catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());thanks for the information.
i tried, the error
like this
run:
E:\java\check\100130.ixf
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
at java.lang.String.substring(String.java:1935)
at CompareList.main(CompareList.java:84)
BUILD SUCCESSFUL (total time: 0 seconds)this comes because in my code i used children[i] as string in the later part
else {
for (int i = 0; i < children.length; i++) {
System.out.println( children);
FileInputStream fstream = new FileInputStream(children[i]);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
String line =strLine.substring(0,2);
a2.add(line);
System.out.println(line);
} // end of add list2
if (a1.size() > a2.size())
int k = 0;
for (int l = 0; l < a2.size(); l++)
if (!((String)a1.get(l)).equals((String)a2.get(l)))
//System.out.println((String)a2.get(i));
// System.out.println("dd");
k = l;
k++;
for (int l = k; l < a1.size(); l++)
System.out.println((String)a1.get(l));
String str = "children[l]";
File file = new File(str);
RandomAccessFile rand = new RandomAccessFile(file,"rw");
rand.seek(file.length()); //Seek to end of file
rand.writeBytes((String)a1.get(i)); //Write end of file
rand.writeBytes("., 0.");
rand.writeBytes("\n");
rand.close();
}// end of comparing and updating the list2
in.close();
i stil could not figure out it yet. do u have any clue with this. -
HOW TO READ MULTIPLE FILES FROM DIRECTORY
i have a directory with 100 .sql insert scripts.i want to read all .sql files from directory and execute the insert script automatically.
Let's suppose you have 3 files: "first.sql", "second.sql" and "third.sql". Create a file named "all.sql" in the same directory, containing this:
@@first.sql
@@second.sql
@@third.sqlRun "all.sql". -
Upload file from Directory via Background Jod
Hi All,
I want to upload a excel from directory. which is neither on my PC nor on application server. This is on some other PC.
I used the FM TEXT_CONVERT_XLS_TO_SAP which is working fine for foreground mode But not working background job because GUI FMs work for foreground mode only.
As of my knowledge I can not use OPEN DATASET if file not exist on application server.
Please suggest how can read this file from any PC in background mode.
JitendraAsk you basis/network admin for tools like FTP or shared folder to access data files.
If you are not executing on a workstation with Excel installed, you cannot use OLE2 to convert Excel to Abap (nor any GUI tools) so either convert sheet to a flat (e.g. csv) format or use a tool like abap2xlsx.
NB: Also use search tool, there are already many threads/discussion on this kind of subjects.
Regards,
Raymond -
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 -
Biztalk 2013 to pick files from webdav
Hi Guys,
Can anyone let me know whether Biztalk 2013 will work with webdav to pick files? I am thinking to use webdav and host an endpoint in IIS to store the files created by different applications. The reason would be just to avoid sharing of windows file paths
and use a consistent authentication mechanism at the IIS level.
So if any application puts a file in to the webdav, Can we configure Biztalk to pick those files? If so, do we get same message context properties as FILE adapter?
Thanks
JBHi Janardhan,
Before I validate this approach of using WebDav as file share for BizTalk, let me just answer your question directly.
While configuring WebDav, you would create a file share for WebDAV and map this file
share to your virtual directory. And if you want to use WebDav as file share (for files created by different applications) then you can use BizTalk file adapter to access the files, so in this case since you have used the File adapter you will have file adapter
related context properties to the message published in to BizTalk message box db. You have to ensure, BizTalk host instance’s credentials uses by the file Receive location to pick the files from file share of WebDav has access to receive the files.
Following article can help you on creating file share in WebDav
MSDN
Blog:Setting up WebDAV on IIS using Windows Authentication and a UNC, mapped drive or file share
But instead of considering this option did you consider the following options through which you can still control the access at IIS level.:
BTSHTTPReceive.dll:
You can configure virtual directory with BTSHTTPReceive.dl in IIS.
Once IIS is configured for
BTSHTTPReceive.dl
BizTalk listens to this URL and, through the use of BTSHTTPReceive.dll and the HTTP receive adapter message posted to this URL is passed to the BizTalk MessageBox
Following article shall help to know details about this and how to configure it
http://tech.movie-stars.us/windows_server/biztalk-2010-recipes---adapters---configuring-http-receives.aspx
http://soa-thoughts.blogspot.co.uk/2011/07/using-btshttpreceive-in-x64-environment.html
http://www.biztalkbill.com/Home/tabid/40/EntryId/66/Configuring-BTSHTTPReceive-dll-to-work-on-IIS-7.aspx
Publish schema as WCF Service:
You can build a single schema that has a child node of type “any.” Then, you can use the “publish schemas as WCF service” option of the publishing wizards to create a general
purpose service which can be used to receive different types of message from different applications. Here different application/customer client call this WCF service upload their data document in the <Any> section of the schema, If you’re using
WCF receive locations, you can always strip out the wrapper node before publishing to the MessageBox.
For more options, read the following article:
Four Ways to Accept Any XML Data Into BizTalk Web
Services
I would certainly consider other option before using WebDav as file share for BizTalk to process the file.
The above methods are suggested since you want to control the access level at IIS, other obvious options are FTP..
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Need Help: Have to route file from directory to directory in same system
Hi Experts,
I need to route xml file from one directory to another and then to another one in the local system. For example, i have the file in directory A, i need to delete that file from that location and place it in B and then from B i have to move it to A again and then move it to C.
The path will be: A-> B -> A -> C
where A, B, C are folder names
How can i do that in SAP-XI in ID? Do i need to create two communication channels? Please guide me and help me out of this.Hi Arkesh,
>>For example, i have the file in directory A, i need to delete that file from that location and place it in B and then from B i have to move it to A again and then move it to C.
For doing this why you need SAP PI? you can better do this with a script or batch job.
>>A-> B -> A -> C
A to B will be one interface and B-->A will be another one. The file getting picked from A and getting dropped to A (in second scenrio) shoudl not have the same name else these two interfaces will go in a loop.
A to C will be the third scenario
each scenario will have a sender file adapter and a receiver file adapter.
But still I didn't get the business usage or usage of PI in this case
Regards
Suraj -
Searching file from directory located at http path.
Hi All,
I have made the program to search for a file in a directory and its subdirectories. This is working fine when my directory is located on local machine. But if the same directory is placed in HTTP path, the code fails to search a directory. Does anyone has idea how can i connect to site so as to access the directories. I used URL and URLConnection to read and write file to the site, and this is also working fine but when it comes to directories i find no solution. Please help.This works fine if i map http://flash/ on my C: and
try to list files in directory C:\Mojo. Can you please
tell how can i know whether the http server i am
trying to access allows directory listing or not.
Because if it does not i have administrator rights on
the server and i can make the changes required.You can see if your Web server allows directory listing by simply
typing in the URL you want to examine, inside your browser, and see if
it shows you a directory listing. For instance, if you type in:
http://flash/Mojo/
in your browser's address bar, and you see a list of files in that
directory, then your Web server supports directory listing.
Note, though, that you can't use the File list() method to get a list of files.
You'll have to make a connection, read the input stream, and then parse
the filenames out of the HTML that the Web server returns. (You can see
what the HTML looks like, by doing View Source inside your brower. That's
what you'll get back from your Java program.)
--Steve -
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,
VijayActually 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. -
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 -
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 -
Peculiar behaviour in picking file from FTP in File-IDoc scenario
Dear XI Expert,
I have successfully completed configuration of FTP --> XI --> IDoc scenario. I have noticed a peculiar behaviour in picking the file from FTP. I placed a file on FTP and activated File Adapter with poll interval '60' secs and processing mode as 'Archive'. For the first time it has picked the file with expected behaviour and IDoc got posted to SAP successfully. But when I placed file for the second time and when refreshed the FTP directory, immediately file got archived without waiting for 60 secs. But in sxi_monitor I could not see any activity of processing this scenario. Surprise is that, file got archived in target directory. This goes on and on... without registering any activity of processing the message in Message monitoring.
In adapter monitoring it shows the message as described below:
<i>History:
2006-05-09 22:57:25 : Processing started
2006-05-09 22:57:25 : Error: Processing interrupted due to error: FTPEx: No such file
2006-05-09 22:57:24 : Processing started
2006-05-09 22:57:24 : Error: Processing interrupted due to error: FTPEx: No such file</i>
For your information my SAP XI system is on SP16.
Please find below the parameters of sender adapter:
<i>Quality of service: Exactly once
Poll interval: 60 secs
Processing mode: Archive
Connect Mode: Per File Transfer
Transfer Mode: Binary</i>
Can anybody help me out in resolving such a problem in this scenario?Hi Jayakrishnan,
Thanks for your reply.
Once again the same problem is noticed. i.e., for the first time when file adapter is activated the file got picked, activities were logged in monitoring and IDoc got posted to destination system. For the second time when file is placed, before 60 secs got completed the file is picked and archived in the target directory. No activities in monitoring are logged.
I have tried it checking the message at adapter level, but it is showing 'No results' (even in the case of successful pick of the file for the first time, not even it is showing other file adapters).
I was not able to understand where the problem could lie?
Regards,
Suraj Kumar
Maybe you are looking for
-
Sender mail adapter : How to get mail in both payload AND attachment ?
Hi, I need to get the mail content both ways every time : -In attachment in order to store it later. -In payload in order to use it. I don't see any way to do this. Any ideas ? JB.
-
How to turn off pop-up blocker on macbook pro
I need to disable my pop-up blocker on macbook pro
-
SAP Cloud Application Studio Make Account All Tabs fields/Table Entry readonly
Hi Experts, I have urgent requirement with the below scenario. Scenario : In Account have flag Prospect if this flag check then all the fields under "Header" and all Tabs(ADDRESSES , SALES DATA etc) fields are editable. But if the flag is unchecked t
-
How to use OCR Font A type by the time of writing some text into Pdf fil
Hi, I am generating one pdf file in java. How can I use OCR Font A for text of pdf file ..Please can any one help where can I get OCR Font A and how to use that one in java ... I want to write some text into pdf file and that text should use OCR Font
-
Thunderbolt 27' has gray lines across the screen
I have gray horizontal lines every 10 pixels on my Thunderbolt Display 27'. Does anyobody know how to solve it? I have all updates installed, I tried to un-plug/plug-in the display and restart MBP but it didn't help. What's interesting, I do not expe