on 09-12-2008 2:26 AM
Hi All
I need some inputs and thoughts from you all,
I will explain you the scenario, The scenario is like this FTP (File1.txt, File2.ctl)--> PI -->SAP(Idoc)
--> Two files one File1.txt and another File2.ctl should be picked from PI and send to SAP (IDOC) which
{ --> .txt contains all the data (TXTVYYYYMMDDHHMMSS.txt)
And
--> .ctl is an empty file (CTLYYYYMMDDHHMMSS.ctl)
}
-->File2.ctl* file will be created only after the File1.txt file has been created in FTP serveru2026
-->.ctl file concept is that PI should start processing .txt file only after if .ctl file is created/available then only it has permission to read the .txt file other wise the .txt file should not be processed
Please help me in achieving this.
Thanks and Regards,
Sridhar Reddy
Hey
Since we can't have dynamic names in sender file adapter,it will be really complicated to implement this in XI.
We has the same requirement but we asked the sender application system to write the file in a temporary format like .dat and then once the file is completely written,rename it to .txt format.
The sender file adapter will pick only *.txt files.
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey
well we looked at lots of options like scripts and controlling adapters externally but the problem we faced was that since the file name in sender adapter can't be dynamic we were unable to handle it in XI.
The best solution which came from SAP was to tweak the sender application system itself.
If you come up with a better solution,please update us:)
Thanx
Aamir
Handled Shell scripts at the FTP server and scheduled
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 try using enhancement module in sender file adapter, so the file adapter only monitoring .ctl file and the enhancement module will get the original data (.txt) base on the .ctl filename and replace the main content of the message.
you will get the .txt content for further processing. just need little bit java programming to build enhancement module.
Best Regards
Fernand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernand,
Thanx for the reply,
Can you please let me know which one is better in implementing
1.
Should i use the Operating System Command and write shell script as suggested
like this if exist c:\src\abc.ctl copy c:\src\abc.txt c:\dest
2.
Or should i go the way you suggested...
Thanks and Regards,
Sridhar Reddy
Is your problem solved...
If yes then let your solution to known to everybody so that in future someone may get help from this..
Thanks,
JAY
Edited by: JGD on Sep 15, 2008 7:00 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridhar,
Hmm......looks complicated.
What I understood is this;
In FTP direcoty, there will control file(.ctl) & its corresponding data file for IDOC (.txt). They are unique and can be identified by DateTimeStamp format for the logic which should be implemented.
The control file will be only triggering point for your scenario i.e., it has nothing to do with application for posting data to IDOC.
First let me know if my understanding is correct for your requirement.
Thanks,
Gujjeti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
-
In FTP direcoty, there will control file(.ctl) & its corresponding data file for IDOC (.txt). They are unique and can be identified by DateTimeStamp format for the logic which should be implemented.
-
Yes Praveen the control file(.ctl) and data file (.txt) file will have the file name like this
ADMYYYYMMHHSS.txt
ADMYYYYMMHHSS.ctl
.txt file has to be picked up only if .ctl file is found/available on the FTP server and then only ADMYYYYMMHHSS.txt file has to be sent to SAP(IDOC)
Regards,
Sridhar Reddy
Hi Sridhar,
May be it is one of the possible solutions.
Use File Adapter with correct FTP parameters to pool the *.ctl files and then in mapping (Java Mapping) using dynamic configuration code read the CTL filename just pooled.
Do some manipulation within javacode to get the first part of the filename i.e., filename without extension and store it to some temporary string variable by adding ".txt" suffix.
Now within java mapping code use FTP JAVA API to connect to the FTP directory & check if the corresponding .txt file exists, then read the entire file stream and store it into another file within PI system directory. Once complete stream is read from FTP directory either delete or archive the file within FTP directory according to your requirement.
Configure a second scenario which will pool for the PI System directory for the copied .txt files. Once the file gets picked map it to IDOC structure (preferably graphical mapping) and then the IDOC adapter will take care of the things as per your configuration.
So your scenario is split into two scenarios
1. FTP(*.CTL) using FileAdapter ---> PI (JavaMapping) ---> PI Local Directory using FileAdapter
2. PI Local Directory using FileAdapter ---> PI ---> IDOC
For the first part, as said above use java mapping to read the corresponding .txt stream and dump it to PI Local Directory which is triggering point for your second scenario.
I hope this works.
Thanks,
Gujjeti
hi sreedahr,
i posted this in one of the forums and i got this reply....hope it gives u a clear picture.
you can achive this by writing script at communication channel configuaration.
check this link: i posted your requirement only in that forum
http://www.computing.net/answers/programming/shell-script-code-for-file-transfer/16959.html
regards.
Sirdhar,
Yes you have to use the same location otherwise ,, the command line argument will not be active.
Thanks,
JAY
Edited by: JGD on Sep 12, 2008 8:46 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10377] [original link is broken] [original link is broken] [original link is broken];
this blog might be resembly ur needs.
Regards .
Siddhesh Naik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There are two option you can follow to achive this, if i am wrong then update me.
1. Write a script, use the script in the configuration communication channel.
The script will check the date of creation of the file and then it will check if there is any *.CTL file is present . If the file is present with the current date then it will pick the *.CTL file and the it will pick the *.TXT file.
Conern: If there are multiple file that need to be processed at a sigle point of time then the option of using the command line argument in the CC will behave in a different way.. sometimes it will fetch and sometimes it will fail to process anything.
2. The second option is to write a functional module and call it in mapping. The functional module will the required job of processing the files in the sequiential order: once the correct order is maintained then the process will run sucessfully.
Thanks,
JAY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If u are using linux script to copy data from Temporary folder to XI than u can check for
if ls *.CTL
then
cd $DEST_DIR
lcd $SOURCE_DIR7
mget $FILE\*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sridhar,
The files are placing on ftp server, so we can write the ftp script to validate the said condition.The source sytem will place the files on some temp folder.The ftp script which is scheduled as per u r requirement, it will read the files from temp folder it will check the file with extension .ctl is there or not. If it is there script will replace the .txt file from temp folder to another folder. From this folder file sender channel can process the file.
Hope ftp script idea will helps to you.
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
never faced this situation but...just thinking on these lines if it is possible:
say u will place the files in a temporary folder and write a script to read the extension .ctl and match the same with .txt file once this is fine then script will transfer the .txt file to another folder and file adapter will pick from there.
just thinking not sure if it is 100% solution.
please let us know if u solved this one with other options.
regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.