cancel
Showing results for 
Search instead for 
Did you mean: 

Alert Generates only for 'manager' User

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear All,

I am facing a problem in using a query for generating alerts....

SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser, t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval' and t1.U_Status = 'Open' and t2.USERID = $[USER]

This query is poping up only for 'manager' user...Not for any other user...Please help me regarding this... What type of permission should this user have..?

Any kind of help would be appreciated....

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

S0004823299
Participant
0 Kudos

Hello Ankit,

In the alert management window, you have defined the users that you want to receive that alert. So make sure that all those users are logged into the system (including the manager if he is defined to receive the alert).

Wait for the alert to be triggered following the rule you set up in the Alert Management Window (hourly, daily, monthly, etc).

Check if the alert is being sent.

I had this same problem, and I found the behaviour.

Kind regards

former_member204969
Active Contributor
0 Kudos

What is you purpose using the $[user] expression?  The $[user] returns the code of the actual user only if it is executed in a formatted search!

If you want to send the alert to the user defined by the t2.userid, you should create separate queries for every user with hard-coded userid!

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The purpose behind using the $[USER] was as follows:

See if there are 12 Entries for a document.

User1 made 6 of them, User2 made 3 of them, User3 made 2 and User4 made 1. Total 12 are there.

But then User1 should get the alert of approval only for those document, to which he has created. As User1 added the 6 document. Then alert should be only for those 6 documents..

Hope you Understood..

Thanks

Former Member
0 Kudos

Hi,

In your UDT @REQUISITIONMASTER, you should have an Integer field to match USERID column in OUSR to link.

Link by text is always problematic.

Thanks,

Gordon

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gordon,

If I do this, Can you tell me what changes I should make to my query...? I will be very Thankful...

Thanks

former_member209066
Active Contributor
0 Kudos

Hi,

Change the Query

SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser, t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM dbo.[@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval' and t1.U_Status = 'Open' and t2.USERID = $[USER]

Check it

Thanks,

Nithi

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nithi,

Not Working...Kindly suggest... See my scenario is if there are 10 Requisition Entered in the database,

then user 'Store2' should get the alert of Approval for only those document, to which he has created...

Thanks

Former Member
0 Kudos

Hi,

    I think this is an authorization issue.... Pls check this link. It may help you....

http://www.scribd.com/doc/52389761/4/General-Authorizations

and Just try with the Full Authorization in Query Manager.

Good Luck...

Regards,

Priya

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Priya,

Thanks for your reply..I have gone through this document earlier. Can you please tell me what type of authorization is needed for the other users to pop up the alert...?

Thanks

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Dear All,

Please suggest something...Waiting for the response..

Thanks

KennedyT21
Active Contributor
0 Kudos

Hi Ankit,

Does The User has Authorization for Alert management...

In General -- Administration-- Alert management

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Yes, this user is having the full autorization.

Thanks

KennedyT21
Active Contributor
0 Kudos

HI Ankit,

Does the Query retrieve the records for the User.....

Regards

Kennedy

Former Member
0 Kudos

Hi Ankit.........

Is he Super User?

Please check whether he has authorization for SQL statement execution or not........

Regards,

Rahul

Former Member
0 Kudos

Hi,

   Give full authorization to Customization Tools & check.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Yes, the query is retrieving the result for the user...

Thanks

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rahul,

Are you talking about Customization Tools Authorization..It has full authorization.

Thanks

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Given...But not happening...

Thanks

Former Member
0 Kudos

Hi,

    Have to give full authorization for Execute Commands in Customization tools.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Priya,

Yes it is having...

Thanks

KennedyT21
Active Contributor
0 Kudos

Hi Ankit Chauhan ,

Try to Inactive the alert and make a new Alert and try ...

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi.

Not Happening....

Thanks

Former Member
0 Kudos

Hi,

    First try with any simple query & Set the frequency 1 minute and check the Alerts whether popup for the user or not.

If it is ok, then you have to check your query only.

Regards,

Priya

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Priya,

Yes you were right...If I remove t2.USERID = $[USER] from my query, is has started to generate Alerts... But then it doesn't fulfill my requirements... Suggest how can I show alerts user wise....

Thanks

KennedyT21
Active Contributor
0 Kudos

Hi Ankit,

I think What user you are login will be captured @ $[USER] so does that user has the documents check in query first....

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Sorry I didn't get you Can you please explain ?...See what is happening if I remove $[USER] from my condition..Alert is generating. But not when I use it... So what should i do for showing the alert userwise...

Thanks

KennedyT21
Active Contributor
0 Kudos

Hi Ankit,

Hard code the UserId and check does the query retrieve the output...

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Yes its working, if I HardCode UserID.... But you can understand this is not possible, if I HardCode it..

Any suggestion please...

Thanks

KennedyT21
Active Contributor
0 Kudos

Try This

SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser,

t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval'

and t1.U_Status = 'Open' and t2.Internal_k = $[USER]

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Its also not working....

Thanks

KennedyT21
Active Contributor
0 Kudos

HI Ankit,

Save This Query and execute first if it produce the result then assign to alert...

Declare @d1 as int

set @d1 = ( Select INTERNAL_K from OUSR where INTERNAL_K=$[USER])

select @d1

  SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser,

t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval'

and t1.U_Status = 'Open' and t2.Internal_k = @d1

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

It is not Executing first...Secondly If I save it & open through the another user..It is only giving the USerID from OUSR.

Thanks

KennedyT21
Active Contributor
0 Kudos

Declare @d1 as int

set @d1 = ( Select INTERNAL_K from OUSR where INTERNAL_K=$[USER])

  SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser,

t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval'

and t1.U_Status = 'Open' and t2.Internal_k = @d1

Small mistake try this

KennedyT21
Active Contributor
0 Kudos

Hey

i think this will work out... First save the query and then execute and check does the query retrive the correct output.. if it retrieves out put then try to alert....

Declare @d1 as int

set @d1 = ( Select INTERNAL_K from OUSR where INTERNAL_K=$[USER])

  SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser,

t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

inner join OUSR t2 on t1.U_SAPUser=t2.U_NAME Where t1.U_Approval = 'Approval'

and t1.U_Status = 'Open' and t2.Internal_k = @d1

Hope helpful.

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Sorry..But not happening...

Thanks

KennedyT21
Active Contributor
0 Kudos

Try This

Declare @d1 as nvarchar(100)

set @d1 = ( Select U_NAME from OUSR where INTERNAL_K=$[USER])

  SELECT t1.DocNum as 'Requisition No.', t1.U_RequestBy, t1.U_SAPUser,

t1.U_Status, t1.U_Approval, t1.U_Remarks, t1.U_ISType, t1.U_ReqTypeM FROM [@REQUISITIONMASTER] t1

  Where t1.U_Approval = 'Approval'

and t1.U_Status = 'Open' and t1.U_SAPUser = @d1

Regards

kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Nothing is happening..

Thanks

KennedyT21
Active Contributor
0 Kudos

does the query retrieve the output?

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Yes this is also interesting....If I go through Tools-Query Manager and here if i select the Query it gives an error as 'Invalid Syntax Near USER'

if I go to Tools-Queries-User Queries-

Then the query shows me the result as i needed... But not poping up alerts..

Thanks

KennedyT21
Active Contributor
0 Kudos

Cool now i think this functionality is not possible dear.. i think this the Limitation of sap B1...

You required to find some other solution..

before that have you try to change the query in the alert management , by saving this query in the new name and tried ??

Regards

Kennedy

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kennedy,

Thanks for your assistance buddy...I think yes you are right..I am to go with other solution... Because alert is generating if I remove $[USER] condition for every user...

Thanks

KennedyT21
Active Contributor
0 Kudos

Cool close the tread with helpful answers ....

Regards

Kennedy