on 03-07-2012 10:29 AM
Hello Everyone,
I have a Idoc to file scenaraio . The file comes regularly and whenevr the file comes, it should get suffix with datestamp and then the counter.
The name is should be Partner_YYYYMMDDHHMMSSL.xml.
Where L is counter and should be increased everytime.
Regards,
Ravi
please chk below code but for this also u have to go for DC....give a try
http://wiki.sdn.sap.com/wiki/display/Snippets/UDFtoReadMessageIDofaPIMessage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First of all, this requirement can only be fulfilled with NFS transfer protocol - otherwise you will not be able to use the Add Counter option of the receiver CC.
Now, you cannot use just one dynamic filename feature for this purpose. Only File Construction Mode can handle sequence number counter, and you cannot use both: Timestamp and Counter in File Construction Mode. So you will have to use two options in parallel: ASMA+Dynamic Configuration and File Construction Mode = Add Counter.
Please refer to this Wiki for implementation guidelines:
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have a look:
http://wiki.sdn.sap.com/wiki/display/XI/AttribMapper-AssignAS2Filename+Dynamically
try to create file name in mapping itself using a comination of DC along with number range functionality...just give a try and let us know the output
try below logic:
partnerconstant(_) concat -> time stamp udf + concatcounter concat+constant(.xml) +concat -> dynamic config udf -> target node.
click on counter standard function and enter Initial value 1 and incremental 1 .
time stamp udf:
String AddTimestamp(String var1, Container container) throws StreamTransformationException{
String DATE_FORMAT_NOW = "yyyyMMddHHmmss";
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return sdf.format(cal.getTime());
}
note :add import instructions(pkg) java.text.SimpleDateFormat
dynamic conf:
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 "";
}
in id:
you have to enable ASMA and File Name properties in Receiver File Adapter.
Edited by: bhavanisankar.solasu on Mar 7, 2012 4:13 PM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
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.