on 03-25-2013 1:44 PM
Hi,
I have created a Date field called TestDate in SAP ESourcing 7. now i need to validate the TestDate month with current month. But am not sure how to get the month from the customized date. can anyone help me on this. below is the code.
tDate= doc.getExtensionField("testDate").get();
if(tDate >=Calendar.JANUARY && tDate<=Calendar.MARCH)
{
ae = new ApplicationException(session);
ae1 = new ApplicationException(session);
ae1.setMessageId(exception_implementation_date); // use to lookup localized exception message text
ae.chainAtEnd(ae1);
if (ae.getChain() != null) {
throw ae.getChain();
}
}
}
Thank You.
Hi Vimal,
Assuming the testDate is a Date extension field, doc.getExtensionField(“testDate”).get() would return SysDateIfc which has getDate() method. This returns java.util.Date. So you can do something like...
testDate = doc.getExtensionField(“testDate”).get();
month = testDate.getDate().getMonth();
Regards,
Vikram
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.