on 02-08-2006 3:43 PM
Hello,
I have the following scenario:
SAP R/3 (via ABAP Proxy or RFC Adapter) -> XI -> File Adapter
For each document generated in SAP R/3 I create one file in the target directories.
I have the following target directories.
->Root Directory
--->Child 1
--->Child 2
--->Child 3
--->...
Each day there is a batch job in SAP R/3 that runs at 05:00AM and generates the files.
What I want to do before the process runs on SAP R/3 is to delete all the files from the day before (in the target directories) so that after running the process only remains the files for the current date.
Any ideias?
Thanks in advance,
Diz IsMi
Hi,
Check if this method can help you,
Create a User Defined function which does the job of Deleting the previous day's Folder/files by a normal File I/O operation.
Use this function in your mapping and when this gets executed for the first time for that day in the batch process, the Files will get deleated. Then set a flag say, <i>isFilesDeleated = 'true'</i> in the Global container, next time the function will not execute since the job has been done and the flag is set in the Global container.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
May be You can use File Adapter Module to delete the files. Initially you send the dummy file for which the Module is written and that module can delete the day before files.
I dont know about the performance of this method, but you may consider doing like this.
regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
you can use:
Executing Operating System Commands <b>Before</b>/After Message Processing - option in the receiver file adapter
and this command will delete all files in the folders
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Michal,
Thanks for your answer. Yes... that is one of the solutions I had in my mind but the problem is that this way I would be executing the same OS command for each file I was receiving. I mean:
Receive file 1 in /root/currentday/child1 => rm root/daybefore/*
Receive file 2 in /root/currentday/child1 => rm root/daybefore/*
and so on
Don't you think this is an "ugly" solution?
And probably it is not very performant also, don't you think?
Tha other solution I thougth was to adapt the process in SAP R/3 so that it would send a DUMMY file before sending real files. I would use this DUMMY file to delete the day before files with the functionality provided by the receiver file adapter.
Any other ideias?
Thanks again
Diz
Hi Diz,
I am just curious ....Can i ask you one thing..
If you want to delete all the OLD files / directories...can't you write a batch job on the system( where files are written) to delete all unwanted old files ? (independent of XI / SAP R3 etc....)
Or should it be done only on receiving some particular message from SAP R/3 ?
Thanks,
Renjith
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.