on 01-28-2013 11:23 AM
Hello Experts,
I have IDOC to file scenario, when IDOC created data need to send create folder.
if same data changed then IDOC need to send to change folder in file server.
to recognize create or change in IDOC one filed contain X, if X is there then change.
i can achive this requirement using the receiver determination, i can put contion , if X then go to Create folder Business system,
correct me if i am wrong.
Regards,
Chinna
Hi Chinna,
I have already done this kind of requirement. Go with ASMA. Create UDF in Mapping level
1. Create two parameters for tow different folder.
2. Configure this two paratmers in Interface Determination in ID(put the values as Directory names)
3. My requirement is like when Country = CA file should have go to CA folder and Country = US it file have to go to US folder.
In the below mapping I am passing first parameter when ever country = CA else I am passing the second parameter.
Trt this it should work.
Thanks,
Satish.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi China,
Field1-->map with default --> equals to (X)-->if true return change else create -->udf
Execution type :single values
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String DirName = ""/development/notification/"+Input+"/" ;
conf.put(key,DirName );
return Input ; //It is up to you
Regards
Venkat
Hi Chinna,
This is UDF code. In my case I am generating both file name and directory name dynamically. As I said in above I am passing the Folder Names using parameterzied mapping.
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String vFileName = FileName1 ;
conf.put(key, vFileName);
// code for folder path
DynamicConfigurationKey keyDir = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String vDirectory = Directory1 ;
conf.put(keyDir, vDirectory);
return vFileName ;
Thanks,
Satish.
Dynmic configuration UDF write a condition to pass directory name according to condition and map UDF to root node in mapping level. You dont need multiple receiver channels.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajshekhar,
Thanks for the reply.
i dont have good knowledge in writing UDF. below UDF for dynamic path creation.
to pass two paths how to modify it.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key, "/development/notification/update/"+dir );
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File",
"FileName");
conf1.put(key1,dir +".txt");
return" " ;
Regards,
Chinna
Hi Chinna,
Try this UDF. Input to this UDF is the field value(x) depending on which the target folder name will be decided. The UDF will have execution type "single value". I have assumed that the field value(x) is either "A" or "B". You need to alter the constant value("A") in the UDF if necessary.
public String TargetDirectory(String x,Container container)
{
String dir="";
if(x.equals("A"))
{
dir="change";
}
else
{
dir="create"
}
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key, "/development/notification/update/"+dir );
return" " ;
}
You can map the output of UDF to the root node of target XML.
Regards
Anupam
Hi,
Case1:
If target server is same and you just want to place in different folders based on some condition.
At mapping level you can configure the directory name using ASMA.
Case2:
Target side if you are using two different communication component ; then go with XPATH in RD and routing.
Case3:
Target side if you are using 1 communication component and two different servers then go with XPATH in ID and routing.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Chinna,
Find below link for similar thread,
Regards,
Sunil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.