on 06-25-2010 8:10 AM
Hi Gurus,
I have a scenario in MessageMapping where I want to compare 2 dates against 3rd date. Basically I am looking to input all three dates and compare two against the last one as shown below.
StartDate
InputDate
EndDate
I want to check,
StartDate = (or) < Inputdate
and
EndDate = (or) > Inputdate
I have used Standard CompareDates function with Fixvalue function to comeup with the solution. Since my Mapping is very complicated, I want to simplify this using UDF.
Appreciate any response. Thanks.
Regards,
hi,
before ussing a UDF, take in mind that SAP Best Practices recommend that first try to solve the mmaping ussing standard functiond and if not posible apply a UDF.
Thanks
Rodrigo P.
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 code in ur UDF.
UdF input parameters are : StartDate ,InputDate ,EndDate .
code inside UDF
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date sd = df.parse(StartDate);
Date id = df.parse(InputDate);
Date ed = df.parse(EndDate);
if ((sd.before(id) || (sd.equals(id))) && (ed.after(id)) || (ed.equals(id))) {
return true;
}
else{
return false;
}
} catch (Exception e){
e.printStackTrace();
}
Regards
AR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
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.