on 02-02-2010 12:56 PM
Hi SDners,
I have reqiurment , that i have to append the records in one file as i sending data in batchs for one day, at the same time i want to overwrite the existing file for next day.so my querey is that can i do appending and overwrite function both at one time.
Regards
Ganga
Edited by: gangadhar kh on Feb 2, 2010 1:56 PM
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Standard functionality does not allow you to do this, workaround could be tried with OS command...
check my wiki [More with the File Adapter|https://wiki.sdn.sap.com/wiki/display/XI/MorewiththeFileAdapter] Scenario # 2. This should help you at least a little...
~SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Santosh,
that means we have to write the adapter module.or can we do one thing that can we make two communication channel and send some value from ECC side in payload that if <field1 Value=1> then append (CC) will be activate and when lnew day record will come like first field value=2 then overwrite(CC) will be activated.
Regards
>>that means we have to write the adapter module.
No.....
You could do the below
Let the Scenario be with mode as append in the communication channel.
Schedule a Shell script in CRON job(if linux OS) to run at the end of the day. The script will rename the actual file/ delete the file / archieve it to an different location. By this when the interface run for the first time the next day it will create a new file since the existing file might have renamed/moved/deleted and for the remaining of the day it will append to the existing file.
~SaNv...
In receiver file adapter use mode as "Append" and file name for eg. sourcefile.txt. The below 2 cases are possible in this.
1. The CC will create file sourcefile.txt and write content to it if file does not exist already.
2. If file exist already, it will append the contents to the existing file sourcefile.txt.
Write a script/batch file and schedule it to run once in a day which will rename the file for eg. sourcefile_old.txt or delete it.
So when the interface runs for the first time after script/batch execution, it will execute case#1(since sourcefile.txt is either deleted or renamed) mentioned above, in all other run it will execute case#2.
Hope this clarifies.
~SaNv...
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.