Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent How To Join Two Tables Without Primary Key

former_member859179
Discoverer
0 Kudos
509
  • SAP Managed Tags:

first of all W means pending approvals , so i want to see all the pending approvals and their authorizers in the table OWDD but i am not able to connect OWDD & WDD1 table together so when i run this query it gives me all pending ones but the list is very long it shouldn't be this long as u can see in table OWDD pending approvals are like very few, 20 or 30 but this query shows 200+ results pls help

5 REPLIES 5

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos
317
  • SAP Managed Tags:

Thank you for visiting SAP Community to get answers to your questions.

As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement & additional resources to your reference that can really benefit you:

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

All the best,

Alex

akmal1216
Employee
Employee
317
  • SAP Managed Tags:

Hello,

The Invoice table is not directly linked with the approval table. but the doc which goes for approval are stored as draft until it is getting posted.

So from the draft table you can link the approval table like, here is select query:

SELECT * FROM OWDD T0 
INNER JOIN WDD1 T1 ON T0.WddCode = T1.WddCode 
INNER JOIN ODRF T2 ON T0.DocEntry = T2.DocEntry

0 Kudos
317
  • SAP Managed Tags:

i basically need all the authorisers of only pending, from owdd table

0 Kudos
317
  • SAP Managed Tags:

im very new to this, so how to add where clause here because when I put where status = 'w' it still shows all including status y and n

0 Kudos
317
  • SAP Managed Tags:

Hello,

Here it is:

SELECT * FROM OWDD AS T0 
 INNER JOIN WDD1 AS T1 ON T0.WddCode = T1.WddCode 
 INNER JOIN ODRF AS T2 ON T0.DocEntry = T2.DocEntry
  WHERE T0.STATUS = 'W'