on 2022 Aug 02 5:10 PM
Hi Experts,
I have requirement to store the first day of previous month in property and utilise in query to filter out the terminated EE
from firstdayof previous month to till date.
Please help me to provide groovy scripts
Regards,
A Raheem
Hello Abdul,
Use below groovy script.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.*;
import java.text.SimpleDateFormat;
def Message processData(Message message) {
Calendar c = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
def todaysDate=formatter.format(c.getTime())
c.add(Calendar.MONTH,-1);
def startOfLastMonth="01"+formatter.format(c.getTime()).substring(2)
message.setHeader("todaysDate", todaysDate");
message.setHeader("startOfLastMonth", startOfLastMonth");
}
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
11 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.