on 03-22-2013 9:53 AM
Hello,
I am working on an IDOC to file scenario where I need to name the reciever file with partial value of an IDOC field.
Example : the value in the IDOC field is: AB-09273-T67E
Name of the receiver file should be : 09273-T67E.xml
I think,if I write an UDF ,it can solve the problem.If any one can help me with the code on UDF,it would be very kind.
Thanks & regards,
Sambaran
Hi,
Use the below code.Pass the field value as the input to udf.
String temp = f.substring(3,f.length()-1);
String fname = temp.concat(".xml");
DynamicConfigurationconf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKeyFileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
conf.put(FileName,fname);
return ""; //up to you
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sambaran,
F is the field name that would be input parameter of the UDF.
In Message mapping pass the IDOC field to the UDF & pass the output to Message Type(MT_***).
Hope this will help you in passing the IDOC field to the output.
Regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sambaran,
You need to enable ASMA property in receiver comm channel & enable file name as check box.
Directory path would the same as per your requirement & you can keep any thing as file name as place holder, the file name you set in the UDF will over write the one as place holder.
Regards,
Ashish
Hi Venkat,
Thanks for the input.So,I need to replace the "f" by the "fieldname" I imagine? and how the mapping would look like?
Fieldname-->UDF--->Message type??
Regards,
Sambaran
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.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.