cancel
Showing results for 
Search instead for 
Did you mean: 

Add Document Creator Name in a Query

0 Kudos

I am making a query about the status of a certain document and all its related target document (PR - PO - GRPO - AP Invoice - Outgoing Payment)

This is my query:

How can I insert the creator name of each of the document in my query?

My SAP version is 9.2 PL 3

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

agustin_marcoscividanes
Active Contributor
0 Kudos

Hi

try this query:

select a.docdate as 'PO Date', a.DocDueDate as 'GRPO Date', a.DocNum as 'PO Number', a.CardCode as 'Supplier Code', a.CardName as 'Supplier Name', b.Dscription as 'Product', b.Quantity, a.docstatus as 'PO Status', d.DocNum as 'GRPO Number', d.DocStatus as 'GRPO Status', f.DocNum as 'AP Invoice Number', f.DocStatus as ' AP Invoice Status', g.u_name as 'User' from OPOR a left join POR1 b on a.docentry = b.docentry left join PDN1 c on c.baseref = b.TrgetEntry and c.ItemCode = b.ItemCode left join OPDN d on c.docentry = d.docentry left join PCH1 e on e.BaseRef = c.TrgetEntry and e.ItemCode = c.ItemCode left join OPCH f on e.docentry = f.DocEntry
inner join OUSR g on g.userid = a.usersign where a.U_NT is null and a.DocDate between [%0] and [%1]

Kind regards

Agustín

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this for PO and follow for other documents:-

SELECT T1.[U_NAME] FROM OPOR T0 INNER JOIN OUSR T1 ON T0.[UserSign] = T1.[USERID]

Regards,

Nagarajan

0 Kudos

Hello Nagarajan,

Sorry but the query you suggested does not work.

This is my query to see the PO status and all its' related target documents:

select a.docdate as 'PO Date', a.DocDueDate as 'GRPO Date', a.DocNum as 'PO Number', a.CardCode as 'Supplier Code', a.CardName as 'Supplier Name', b.Dscription as 'Product', b.Quantity, a.docstatus as 'PO Status', d.DocNum as 'GRPO Number', d.DocStatus as 'GRPO Status', f.DocNum as 'AP Invoice Number', f.DocStatus as ' AP Invoice Status' from OPOR a left join POR1 b on a.docentry = b.docentry left join PDN1 c on c.baseref = b.TrgetEntry and c.ItemCode = b.ItemCode left join OPDN d on c.docentry = d.docentry left join PCH1 e on e.BaseRef = c.TrgetEntry and e.ItemCode = c.ItemCode left join OPCH f on e.docentry = f.DocEntry where a.U_NT is null and a.DocDate between [%0] and [%1]

Now, I need to see who created the PO, the GRPO, AP Invoice and Outgoing Payment

Thanks

kothandaraman_nagarajan
Active Contributor
0 Kudos

To get user name of each document, you have to link OUSR table with OPOR, OPDN, OPCH. Please try yourself.

Let me know if you face any issue.