on 09-09-2010 9:17 AM
Hello,
We have a requirement where XI is used to transfer huge files(in MBs) in .dat format.
This is just a pass through scenario and no conversion is involved.
There is a risk that XI picks up incomplete file when it is being written.
Somehow,the partner is not convinced about using parameter 'Msecs to wait before Modification check' as it is quite critical that file should be processed only when it is finished.
They have suggested another approach that at the end of file ,they would have a unique identifier ,say, string EOF
We should search for this string in the file and only if it is there,file should be picked and placed on target FTP server.
There are different types of files and formats can be different,so it makes no sense to spend lot of efforts in content conversion for each type of file when no mapping is required.
Can anyone please let us know if there is a way to search for this string in the file and only if it is there,file would be picked.
Thanks a lot in advance.
Best Regards,
Shweta
Hi shwetha,
As per the requirement specified, I think Lookup would be a better solution.
Refer the below blog:
/people/sundararamaprasad.subbaraman/blog/2005/12/09/making-csv-file-lookup-possible-in-sap-xi
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta,
As far as I understand, you have to control this while picking up the file only(that is in sender channel), as JAVA mapping comes into the picture at mapping phase.
That is why I thought of Java Module option.
It will work in the same way as 'Msecs to wait before Modification check' would have worked, meaning, it will be checking continuosly whether 'EOF' string is there or not.
One the string is found, file will be picked up and sent to PI.
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shweta,
'Msecs to wait before Modification check' parameter is not supported for the FTP protocoal.
Please check the SAP Note 821267, Q 22, for this.
I guess, you have to develope the JAVA module for this requirement.
This module will check the file at sender side, once he will find the string 'EOF', the file will be sent to PI for further processing.
You have to make an entry of this module on Sender channel.
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
We could create a Java mapping which waits until it finds this EOF in the file.
So,even if the file is being written,it will be picked by XI and will be passed to this Java Mapping .
We use a String variable which holds contents of the file.
Now the question is,say,the file is incomplete,it is picked by XI,execute method in Java mapping is called and String variable is populated.
After sometime,when the file is complete,will this String variable be overwritten?(execute method called again?)
If not,then this Java mapping will be of no use
Please let us know.
Thanks a lot.
Regards,
Shweta
Hi Shweta ,
You will need to write a batch program whichl will check the file size after regular intervals and say if the re is no modification in file. it will move the file from location A to location B where XI will poll and pick the file .
Thiis batch program has to be written at the FTP location . since its FTP we cannot do much with XI
never had done anything like this ,
Hope my idea helps
Regards
Ninad
Hello Supriya,
Thanks a lot for the information.
Can we do the same using Java Mapping?
you mentioned "This module will check the file at sender side, once he will find the string 'EOF', the file will be sent to PI for further processing"
Atleast in case of Java mapping,by the time we check if EOF is there,file will be consumed.
How can we stop PI to pick up this file till this check happens?
Thanks.
Regards,
Shweta
Hi Shweta
" how can we stop PI from picking the file till the time EOF being checked "
Can you use the URLS to stop start communication channels externally in your java mapping program .
/people/william.li/blog/2007/05/04/control-communication-channels-externally-without-using-rwb
In case you are writing java mapping
else convince your client for batch program
Regards
Ninad
Hi,
I prefer your existing approch is best.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
I am sorry,I think,I am not able to explain my problem with Java Mapping correctly.
My Java mapping checks if EOF is there or not.But what action should I take if EOF is not there?
When Java mapping is executed,file is already consumed, so if I set the message status to fail,file will be lost.
So,even if the file is being written,it will be picked by XI and will be passed to this Java Mapping .
We use a String variable which holds contents of the file.
Now the question is,say,the file is incomplete,it is picked by XI,execute method in Java mapping is called and String variable is populated.
After sometime,when the file is complete,will this String variable be overwritten?(execute method called again?)
If not,then this Java mapping will be of no use
I would like to know if this Java mapping is called again and again till this file size changes?
Please let me know.
Thanks.
Regards,
Shweta
hello shweta,
Here is a batch script that will do this for you:
batch file begin ********************************************
@ ECHO OFF
:READFILE
SET | FIND "SEARCH_STRING" source.txt > NUL
IF ERRORLEVEL 1 GOTO READFILE
IF ERRORLEVEL 0 GOTO END
sleep 5
GOTO READFILE
:END
batch file end ***********************************************
here, SEARCH_STRING is the string that will be searched in file source.txt. This SEARCH_STRING denotes the end of file (the file is ready to be transferred).
This batch file should be called from PI "Run OS command before processing of the message".
I tried this on my system and it worked for me.
Just check at your end. I hope this will solve your query.
Regards, Gaurav.
Edited by: Kr.gaurav on Sep 9, 2010 3:54 PM
Hello shweta:
Please find my answers below:
1) This batch file will be placed on XI server?
Yes this batch file will be placed on the XI Server. Eg: E:\usr\sap\gobal\command.bat
2) From where does the file name source.txt come?Is it an example?If yes,what should I use as filename in my case?
The source.txt is just an example. You can enter the filename of the file where you want to check the string for end of file. This File can be any file on the XI Server. You can also pass the filename as its relative path. Example: "E:\usr\sap\source.txt"
Hope this answers your query.
Regards, Gaurav.
User | Count |
---|---|
96 | |
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.