on 08-21-2011 11:52 AM
Hi,
I am having IDOC to Ftp scenario, where i need to send the IDOC on condition.
1. In IDOC there is a field Location, based on this field the target files has to be created.
ex:-
1. for Location India ---> file has to be created in INDIAN folder
2. for Location USA ---> file has to be created in USA folder
3. 2. for Location Uk ---> file has to be created in UK folder etc.......
Like this there are nearly 20 folders where i need to create at the target side, based on the location field the fied has to be created at the respective folder automatically.
When i trigger the IDOC with the Location INDIA, automatically the file has to get created in INDIAN FOLDER.
Please help me...
cheers
nissi
Hi,
I have worked on such scenario.
I will give you brief detail.
Create N number of Service INterface (Number of countries). Create multiple Operation mapping. Then in the Interface Determination put the condition for the filed which carry Country Name and then different channels can route them to different folder using multiple Receiver Agreement and Receiver Channel.
Hope this approach suits you.
Regards....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
All your folders are on one FTP machine? or on defferent FTP Machines?
1. IF floders are on different FTP machines then you can use condition in Receiver Determination and use multiple Communication channels to place the files.
2. If folders are on one FTP Machine : You can use the Variable Substituion using location field for Targer Directory .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nissi,
Check this [Link|http://wiki.sdn.sap.com/wiki/display/NWTech/OneIDOCtoMultipleFilessendingtoMultiplefoldersoftheFTPusingsingleCommunicationChannel(SAPXI-PIProcess+Integration)].
thanks and Regards,
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nissi,
Could you please kindly look into this blog
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Hope this helps.
regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupam,
I checked the link u have sent, but in my scenario i am not able to compare with your link, i am just confused, because i am new to this xi, but dont get me wrong in suggesting me.
in my case my based on the Field Location, the file has to generate in respective Folder. how can i with this requirement kindly suggest me.
Nissi
Hi,
Write dynamic configuration UDF to pass directory based on input field.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public String dynamicDirectoryName(String Location, Container container) throws StreamTransformationException
{
String Directory;
String inputFileName;
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
Directory = conf.get(key2);
If(Location.equals("India")
{
Directory = "/India/";
}
else if(Location.equals("Austrlia"))
{
Directory = "/Austrlia/";
}
conf.put(key2,Directory);
return Directory;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
chk this...(this will suits ur req):
/people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot
in the above blog instead of "File" name parameter using "Directory" and adjust the code accordingly....
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
Hi Roy,
Thanks for your code, its very useful and suits to my requirement. But i am having folders already in my target file system.
Based upon the location ID . directly the the file should be placed in the respective folder.
please find the below code and suggest me if any changes to be done.
**************************************************************************************************************
public String dynamicDirectoryName(String Location, Container container) throws StreamTransformationException
{
String Directory;
String inputFileName;
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//Directory = conf.put(key1,location);
inputFileName = con.put(key2,location);
//Directory = conf.get(key1);
inputFileName = conf.get(key2);
If(inputFileName.equals("INDIA")
{
con.put(key2,"INDIA");
}
else if(inputFileName.equals("AUSTRALIA"))
{
con.put(key2,"AUSTRALIA");
}
else
{
return "";
}
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.