cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the month from extension field type Date

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Former Member
0 Kudos

Thanks Vikram,

I have already got the details.

Thank again

Answers (0)