on 01-17-2012 8:42 AM
Hi,
Please help me to write an UDF for getting filename dynamically in this format
AF_DeliveryN_<CustomerIdentifier>_<ABAP-Spool-Number>_<datetime stamp>.xml.
Regards
Sai
Hi,
This is a very common question. I do understand many new comer start posting this kind of basic questions which in past answered multiple times.
Please try to search on SDN first before posting any question. Also, read [Rules of Engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
Hence this thread is locked.
Regards
Aashish Sinha
SAP XI/PI Moderator
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
AF_DeliveryN_<CustomerIdentifier>_<ABAP-Spool-Number>_<datetime stamp>.xml.
mapping logic:
AF_DeliveryN + constant(_) + Concat+ CustomerIdentifier + Concat + constant(_) + Concat+ ABAP-Spool-Number+ Concat + constant(_) + Concat+ datetime stamp(UDF)Conactconstant(.XML)+ ConactDynamic udftarget node
ex for ADD time Stamp:
String AddTimestamp(String var1, Container container) throws StreamTransformationException{
String DATE_FORMAT_NOW = "yyyyMMddHHmmssSSS";
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return sdf.format(cal.getTime());
dynamic conf for file:
public String DynamicConfig(String a, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a);
return "";
thanks,
Edited by: bhavanisankar.solasu on Jan 17, 2012 10:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
string filename=conf.get(key);
filename="Your desired format";
conf.put(key,filename);
In above just put your desired file format in filename by using strings in double quotes concatenated with + sign.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.