Hi Experts,
I Wanted to Run a Query based on the User Session and i have tried the below Query But i have not get the desired OutPut.
Scenario :
Lets Say there are 5 Users and Each User will collect the Receipts simultaneously with their user logins Per Session (Lets assume Each Session is of 1 Hour and there will be 6 sessions Per Day).After the End Of the Each Session before logout from SAP ,User have to run a Report to show how much each they have collected Session1[09.00 am to 10.00 am] and after Some Time Other Users/Same Users will Login to SAP with The Same User Id's for Session 2[10.15 am to 11:15 am] and at the end of the Session they have to run the report for the receipts collected only in the Session 2 and like wise there will be multiple sessions Per Day .So I am trying for a query to find the receipts collected in each session.
SELECT DISTINCT T0.[DocNum], T0.[DocDate],
T0.[CashSum], T0.[CreditSum], T0.[CheckSum], T0.[TrsfrSum],
T0.[TrsfrDate], T0.[TrsfrRef], T0.[CounterRef], T0.[PrjCode], T0.[PaymentRef] ,
T0.[CreateDate],T0.[DocTime],
T0.USERSIGN,T1.USER_CODE,T1.U_NAME
FROM ORCT T0
LEFT JOIN OUSR T1 ON T1.USERID=T0.USERSIGN
INNER JOIN USR5 T2 ON T2.USERCODE=T1.USER_CODE
WHERE T0.DOCDATE= CONVERT(DATE,GETDATE(),111) AND T2.Action between 'I' and 'O'
Pl Provide any Suggestions to acheive the above.
Regards
Vamsi