Skip to Content

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

How to send notifications one time per record using Alerts

Hello Professionals,

I want to send a notification to user after Document approval, so, i tried to use alerts using query, but i faced a problem of How can i run the query and send notification one time per record, I do not want to send a lot of notifications for the same record.

How can i resolve this issue?

Thanks in advance,

Tags:
Former Member
replied


Hi,


One way to achieve this via code by adding CreateTS to Where clause in the query.


For example, the following code sends an alert for A/P Down Payment added within the last 15 minutes


SELECT T0.[DocNum], T0.[DocTotal], T0.[CreateDate],

'Time' =case when T0.[CreateTS]>100000 Then left(T0.[CreateTS],2) +':'+left(right(T0.[CreateTS],4),2)+':'+right(T0.[CreateTS],2)

else '0'+left(T0.[CreateTS],1) +':'+left(right(T0.[CreateTS],4),2)+':'+right(T0.[CreateTS],2)

end ,T0.[CreateTS], T1.[U_NAME]

FROM [dbo].[ODPO] T0

INNER JOIN OUSR T1 ON T0.UserSign = T1.USERID


WHERE DATEDIFF(day,T0.[CreateDate],getdate())=0 --same day

--time format in CreateTS is HHMMSS. To convert the current time to the same format and get only the documents added the last minute

and (DATEPART(hour,getdate())*10000

+DATEPART(minute,getdate())*100

+DATEPART(Second,getdate()))-T0.[CreateTS]<1501 --15 Minutes


Order By T0.[DocNum] Desc


One thing more, in the alerts management make the frequency 15 min


I hope this helps.


Regards,

Alaa

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