Skip to Content
0
Former Member
Mar 13, 2013 at 01:59 PM

Running an SQL across Several Companies

17 Views

Hello Experts...

Background: The Customer has three SAP B1 Companies all sitting on same server. Let’s call them S_Comp, U_Comp, and C_Comp. They want an SQL to be launched in C_Comp and have it pick up all the data from the three companies and then have the data displayed together. Just as an example and to make it simple, they want the SQL to provide a list of Customers (OCRD.CardCode and CardName) and a list of all Open Invoices (OINV.DocNum and DocTotal) from all three companies. The Customer Number on the three companies is the same…

So the basic SQL is something like this:

SELECT

T0.CardCode,

T0.CardName,

T1.DocNum,

T1.DocTotal

FROM OCRD T0

LEFT OUTER JOIN OINV T1

ON T0.CardCode = T1.CardCode

WHERE T1.DocStatus = 'O'

Any idea how to do this???

Thanks in advance - Zal