Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Yesterday's Date


I need to access Yesterdays Date in Message Mapping.

How UDF will look llike?

This is performing arithmetic operations on System DAte.



Former Member
Former Member replied


try using this simple udf

cache parameter : value

public String ystdate(Container container)
long oneDay = (long) 1000.0 * 60 * 60 * 24;
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");

java.util.Date today = new java.util.Date(System.currentTimeMillis());

java.util.Date yesterday = new java.util.Date(System.currentTimeMillis()-oneDay);

String b = dateFormat.format(yesterday);
return b;

Under imports in udf
specify java.util.*;java.text.*;



Edited by: malini balasubramaniam on Sep 18, 2008 1:28 PM

Edited by: malini balasubramaniam on Sep 18, 2008 2:11 PM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question