on 11-24-2014 7:38 AM
Hello Team,
I am using PI 7.11 SP 12, I have a new requirement in which I need to drop files on the target FTP and implemented by pass scenario..
But the client requirement is "Folder shall be created with a naming convention of “<Country Code>_<date>_<time>” like “IND_112414_163000”." and the files should be placed in this sub-folder on daily basis in which date should change daily.
Could you please let me know how this process can be approach.
Thank you in advance.
Thanks
Ravi.
Hello All,
Please find the below code I have used for the same :
String directoryname = new String("");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
directoryname = "/1234/AA_";
conf1.put(key1,directoryname);
return directoryname;
And in mapping I have used concat the time stamp to it. But the directory name is not adding any time stamp at last. The directory is simply showing /1234/AA_. No time stamp(yyyymmdd_HHmmss) is adding.
Please correct my UDF.
Thanks
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>>And in mapping I have used concat the time stamp to it. But the directory name is not adding any time stamp at last. The directory is simply showing /1234/AA_
If you concat after the UDF, it doesn't work.
You have to concat before the UDF then pass the value to UDF and set the dynamic directory in UDF.
You can do like this.
To your UDF pass a variable. i.e. concat "/1234/AA_" + current date (require format).
Inside your UDF, just change conf1.put(key1,your input variable);
Hi Ravi,
A few cents, to work with dates inside the UDF you can follow Aashish Sinha answer in this thread
Regards.
Hi Hareesh,
I have tried using above mapping, still getting the error:
"Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: An error occurred while connecting to the FTP server 'ftp.xxx.com:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 Unexpected reply codeThe system cannot find the path specified. '. For details, contact your FTP server vendor."
Kindly suggest.
Thanks
Ravi.
Hi,
The error before was due to not checking directory in ASMA in sender channel, now I have selected and the target directory is creating with required name.
But I am unable to find the data in the file, rather getting xml tags as below :
"
<?xml version="1.0" encoding="UTF-8" ?>
"
Suggest please.
Ravi.
Hi Ravi,
What is at your sender side? Are yo sending multiple files...what configuration u did at sender CC.
Are you able to view all the files/attachment in MONI ?
For FTP /File sender, you can refer to following:
SAPTechnical.COM - Picking multiple files using File-Adapter FTP
Sender File Adapter Frequently Asked Questions - Process Integration - SCN Wiki
Regards,
Azhar
Ravi,
If you are using MM, it will treat the incoming file as payload..and will map it to target structure as XML format..
For Pass through you should not create ESR object (dummy reference to be made in ID config)
But since you require Directory/File name Dynamically i believe you might need to do it using Java Mapping..
Please refer following for details:
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
Regards,
Azhar
Hi Ravi,
You can use the ASMA properties of the receiver file adapter to achieve your goal.
Check this thread and this wiki Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integr...
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I believe you can achieve this by using the Dynamic Configuration - ASMA.
Please refer the following link:
(Check Adapter-Specific Message Attributes and Dynamic Configuration Option)
Tick / Unable Directory Option in Receiver CC and also Create Target Directory option in the CC. From your MM pass the required Names for Directory and File Name as shown in the blog.
Regards,
Azhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Ravi,
You can use the 'Variable Substitution' along with Add time stamp options on receiver file adapter.
thanks-
Rams
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.