on 06-18-2009 5:12 AM
Hi
I have a scenario where in i have add the number days to date.
ex: if the date is 02092009 and if the days is 30. then the result of adding days to the date should be 02102009.
Do we have any readily available UDFs in XI if not it would be appreciated if i can get some procedure to implement this.
Dear Kalyan,
try with the following UDF and let me know in case of any issues;
try
{
Date dat = new SimpleDateFormat("ddMMyyyy").parse(a[0]);
Calendar cal = new GregorianCalendar();
cal.setTime(dat);
cal.add(Calendar.DAY_OF_MONTH, +cnt[0]);
Date bar = cal.getTime();
String expDate = new SimpleDateFormat("ddMMyyyy").format(bar);
result.addValue(expDate);
}
catch(Exception ex)
{
System.out.println(ex);
}
Note:
====
a[0] and cnt[0] are the two input values to the UDF.
a[0] --> date
cnt[0] --> days of the date
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
you can use this code in user defined function
Calendar cal = Calendar.getInstance();
/* here u can parse the individual values for year month and day, other calendar function are also available .*/
cal.set(1999,11,28);
/* here instead of value 30 u can pass the specific node integer value to add the no of days.*/
cal.add(Calendar.DATE, 30);
return cal.getTime().toString();
Regards,
Syed
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.
Hi
No Standard function given by SAP XI, need to built our own UDF to acheive this
rgds
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
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.