cancel
Showing results for 
Search instead for 
Did you mean: 

Inner join - OACT into query

Former Member
0 Kudos

How do I inner join OACT table ( acctcode) into this formula?

SELECT T0.[DocNum],T0.[CardCode], T0.[CardName], T0.[Address], T0.[DocStatus], T0.[NumAtCard], T1.[Dscription], T1.[VatSumSy], T1.[LineTotal], (T1.[LineTotal] + T1.[VatSumSy]) AS 'Row Total Incl Tax' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry

0 Kudos

hello help me plsss .... How can I do that. I want to merge the purchase requisition with the purchase order. and I want to pull the pen codes attached to them.

moshenaveh
Community Manager
Community Manager
0 Kudos

Welcome to the SAP Community! Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Secondly, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

Finally, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Great thanks!

Former Member
0 Kudos

Please try this:


SELECT T0.DocNum,T0.CardCode, T0.CardName, T0.Address, 
T0.DocStatus, T0.NumAtCard, T1.Dscription, T2.Formatcode, 
T1.VatSumSy, T1.LineTotal, (T1.LineTotal + T1.VatSumSy) 
AS 'Row Total Incl Tax' FROM ORDR T0 INNER JOIN RDR1 T1 
ON T0.DocEntry = T1.DocEntry 
INNER JOIN OACT T2 ON T2.AcctCode = T1.AcctCode
Where T0.DocType = 'S'

Thanks,

Gordon

Former Member
0 Kudos

I have come across a query for a draft Ap invoice (no JE created) - does this help?

SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.CardCode, T2.FormatCode, T2.[Segment_1], T2.[Segment_0], T2.[AcctName], T1.Dscription, T1.LineTotal, T1.VatSum FROM [dbo].[ODRF] T0 Inner Join [dbo].[DRF1] T1 ON T1.DocEntry = T0.DocEntry Inner Join [dbo].[OACT] T2 ON T2.AcctCode = T1.AcctCode Where T0.ObjType = '18' and T0.DocType = 'S'

Former Member
0 Kudos

Suda,

This is a 'service' sales order, and although there is no JE, the G/L codes are used in the document.

No way to link codes?

former_member583013
Active Contributor
0 Kudos

AcctCode with which field in ORDR?

There is no Journal Entry created on an Sales Order and we could not link it